GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
Represents an area of text which matched the pattern a particular filter has been looking for. More...
#include "Filter.h"
Public Types | |
enum | Type { NotSpecified, Link, Marker } |
Public Member Functions | |
HotSpot (int startLine, int startColumn, int endLine, int endColumn) | |
Constructs a new hotspot which covers the area from (startLine ,startColumn ) to (endLine ,endColumn ) in a block of text. | |
virtual | ~HotSpot () |
virtual QList< QAction * > | actions () |
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar. | |
virtual void | activate (QObject *object=0)=0 |
Causes the an action associated with a hotspot to be triggered. | |
int | endColumn () const |
Returns the column on endLine() where the hotspot area ends. | |
int | endLine () const |
Returns the line where the hotspot area ends. | |
int | startColumn () const |
Returns the column on startLine() where the hotspot area starts. | |
int | startLine () const |
Returns the line when the hotspot area starts. | |
virtual QString | tooltip () const |
Returns the text of a tooltip to be shown when the mouse moves over the hotspot, or an empty string if there is no tooltip associated with this hotspot. | |
Type | type () const |
Returns the type of the hotspot. |
Protected Member Functions | |
void | setType (Type type) |
Sets the type of a hotspot. |
Private Attributes | |
int | _endColumn |
int | _endLine |
int | _startColumn |
int | _startLine |
Type | _type |
Represents an area of text which matched the pattern a particular filter has been looking for.
Each hotspot has a type identifier associated with it ( such as a link or a highlighted section ), and an action. When the user performs some activity such as a mouse-click in a hotspot area ( the exact action will depend on what is displaying the block of text which the filter is processing ), the hotspot's activate() method should be called. Depending on the type of hotspot this will trigger a suitable response.
For example, if a hotspot represents a URL then a suitable action would be opening that URL in a web browser. Hotspots may have more than one action, in which case the list of actions can be obtained using the actions() method. These actions may then be displayed in a popup menu or toolbar for example.
Constructs a new hotspot which covers the area from (startLine
,startColumn
) to (endLine
,endColumn
) in a block of text.
Reimplemented in UrlFilter::HotSpot, and RegExpFilter::HotSpot.
Definition at line 287 of file Filter.cpp.
|
virtual |
Reimplemented in UrlFilter::HotSpot.
Definition at line 247 of file Filter.cpp.
|
virtual |
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar.
Reimplemented in UrlFilter::HotSpot.
Definition at line 299 of file Filter.cpp.
Referenced by TerminalView::filterActions().
Causes the an action associated with a hotspot to be triggered.
object | The object which caused the hotspot to be triggered. This is typically null ( in which case the default action should be performed ) or one of the objects from the actions() list. In which case the associated action should be performed. |
Implemented in UrlFilter::HotSpot, and RegExpFilter::HotSpot.
int Filter::HotSpot::endColumn | ( | ) | const |
Returns the column on endLine() where the hotspot area ends.
Definition at line 315 of file Filter.cpp.
Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), and TerminalView::paintFilters().
int Filter::HotSpot::endLine | ( | ) | const |
Returns the line where the hotspot area ends.
Definition at line 307 of file Filter.cpp.
Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), and TerminalView::paintFilters().
Sets the type of a hotspot.
This should only be set once
Definition at line 323 of file Filter.cpp.
Referenced by RegExpFilter::HotSpot::HotSpot(), and UrlFilter::HotSpot::HotSpot().
int Filter::HotSpot::startColumn | ( | ) | const |
Returns the column on startLine() where the hotspot area starts.
Definition at line 311 of file Filter.cpp.
Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), and TerminalView::paintFilters().
int Filter::HotSpot::startLine | ( | ) | const |
Returns the line when the hotspot area starts.
Definition at line 303 of file Filter.cpp.
Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), and TerminalView::paintFilters().
|
virtual |
Returns the text of a tooltip to be shown when the mouse moves over the hotspot, or an empty string if there is no tooltip associated with this hotspot.
The default implementation returns an empty string.
Reimplemented in UrlFilter::HotSpot.
Definition at line 295 of file Filter.cpp.
Filter::HotSpot::Type Filter::HotSpot::type | ( | void | ) | const |
Returns the type of the hotspot.
This is usually used as a hint for views on how to represent the hotspot graphically. eg. Link hotspots are typically underlined when the user mouses over them
Definition at line 319 of file Filter.cpp.
Referenced by TerminalView::paintFilters().