Konsole::Filter::HotSpot
#include <Filter.h>
Public Types | |
enum | Type { NotSpecified , Link , Marker } |
Public Member Functions | |
HotSpot (int startLine, int startColumn, int endLine, int endColumn) | |
virtual QList< QAction * > | actions () |
virtual void | activate (const QString &action=QString())=0 |
int | endColumn () const |
int | endLine () const |
int | startColumn () const |
int | startLine () const |
Type | type () const |
Protected Member Functions | |
void | setType (Type type) |
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.
Member Enumeration Documentation
◆ Type
Constructor & Destructor Documentation
◆ HotSpot()
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.
Definition at line 267 of file Filter.cpp.
Member Function Documentation
◆ actions()
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 275 of file Filter.cpp.
◆ activate()
Causes the an action associated with a hotspot to be triggered.
- Parameters
-
action The action to trigger. This is typically empty ( in which case the default action should be performed ) or one of the object names from the actions() list. In which case the associated action should be performed.
Implemented in Konsole::RegExpFilter::HotSpot, and Konsole::UrlFilter::HotSpot.
◆ endColumn()
int Filter::HotSpot::endColumn | ( | ) | const |
Returns the column on endLine() where the hotspot area ends.
Definition at line 291 of file Filter.cpp.
◆ endLine()
int Filter::HotSpot::endLine | ( | ) | const |
Returns the line where the hotspot area ends.
Definition at line 283 of file Filter.cpp.
◆ setType()
|
protected |
◆ startColumn()
int Filter::HotSpot::startColumn | ( | ) | const |
Returns the column on startLine() where the hotspot area starts.
Definition at line 287 of file Filter.cpp.
◆ startLine()
int Filter::HotSpot::startLine | ( | ) | const |
Returns the line when the hotspot area starts.
Definition at line 279 of file Filter.cpp.
◆ type()
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 295 of file Filter.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:08:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.