Konsole
Konsole::Filter::HotSpot Class Reference
#include <Filter.h>

Detailed Description
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.
Definition at line 70 of file Filter.h.
Public Types | |
enum | Type { NotSpecified, Link, Marker } |
Public Member Functions | |
virtual QList< QAction * > | actions () |
virtual void | activate (QObject *object=0)=0 |
int | endColumn () const |
int | endLine () const |
HotSpot (int startLine, int startColumn, int endLine, int endColumn) | |
int | startColumn () const |
int | startLine () const |
virtual QString | tooltip () const |
Type | type () const |
virtual | ~HotSpot () |
Protected Member Functions | |
void | setType (Type type) |
Member Enumeration Documentation
Constructor & Destructor Documentation
Filter::HotSpot::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.
Reimplemented in Konsole::RegExpFilter::HotSpot, and Konsole::UrlFilter::HotSpot.
Definition at line 279 of file Filter.cpp.
Filter::HotSpot::~HotSpot | ( | ) | [virtual] |
Member Function Documentation
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar.
Reimplemented in Konsole::UrlFilter::HotSpot.
Definition at line 291 of file Filter.cpp.
virtual void Konsole::Filter::HotSpot::activate | ( | QObject * | object = 0 |
) | [pure virtual] |
Causes the an action associated with a hotspot to be triggered.
- Parameters:
-
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 Konsole::RegExpFilter::HotSpot, and Konsole::UrlFilter::HotSpot.
int Filter::HotSpot::endColumn | ( | ) | const |
Returns the column on endLine() where the hotspot area ends.
Definition at line 307 of file Filter.cpp.
int Filter::HotSpot::endLine | ( | ) | const |
void Filter::HotSpot::setType | ( | Type | type | ) | [protected] |
int Filter::HotSpot::startColumn | ( | ) | const |
Returns the column on startLine() where the hotspot area starts.
Definition at line 303 of file Filter.cpp.
int Filter::HotSpot::startLine | ( | ) | const |
QString Filter::HotSpot::tooltip | ( | ) | const [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 Konsole::UrlFilter::HotSpot.
Definition at line 287 of file Filter.cpp.
Filter::HotSpot::Type Filter::HotSpot::type | ( | ) | 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 311 of file Filter.cpp.
The documentation for this class was generated from the following files: