Hotspot type created by UrlFilter instances. More...
#include "Filter.h"
Public Member Functions | |
HotSpot (int startLine, int startColumn, int endLine, int endColumn, Type t) | |
virtual | ~HotSpot () |
virtual QList< QAction * > | actions () |
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar. More... | |
virtual void | activate (QObject *object=nullptr) |
Open a web browser at the current URL. More... | |
QStringList | capturedTexts () const |
Returns the texts found by the filter when matching the filter's regular expression. More... | |
int | endColumn () const |
Returns the column on endLine() where the hotspot area ends. More... | |
int | endLine () const |
Returns the line where the hotspot area ends. More... | |
FilterObject * | get_urlObject () |
void | setCapturedTexts (const QStringList &texts) |
Sets the captured texts associated with this hotspot. More... | |
int | startColumn () const |
Returns the column on startLine() where the hotspot area starts. More... | |
int | startLine () const |
Returns the line when the hotspot area starts. More... | |
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. More... | |
Type | type () const |
Returns the type of the hotspot. More... | |
Protected Member Functions | |
void | setType (Type type) |
Sets the type of a hotspot. More... | |
Private Types | |
enum | UrlType { StandardUrl , Email , ErrorLink , ParseErrorLink , Unknown } |
Private Member Functions | |
UrlType | urlType () const |
Private Attributes | |
QStringList | _capturedTexts |
int | _endColumn |
int | _endLine |
int | _startColumn |
int | _startLine |
Type | _type |
FilterObject * | _urlObject |
Hotspot type created by UrlFilter instances.
The activate() method opens a web browser at the given URL when called.
|
private |
UrlFilter::HotSpot::HotSpot | ( | int | startLine, |
int | startColumn, | ||
int | endLine, | ||
int | endColumn, | ||
Type | t | ||
) |
Definition at line 472 of file Filter.cpp.
|
virtual |
Reimplemented from Filter::HotSpot.
Definition at line 602 of file Filter.cpp.
References _urlObject.
|
virtual |
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar.
Reimplemented from Filter::HotSpot.
Definition at line 610 of file Filter.cpp.
References Filter::ErrorLink, UrlFilter::ErrorLinkRegExp, and UrlFilter::ParseErrorLinkRegExp.
|
virtual |
Open a web browser at the current URL.
The url itself can be determined using the capturedTexts() method.
Reimplemented from RegExpFilter::HotSpot.
Definition at line 508 of file Filter.cpp.
References Filter::ErrorLink, UrlFilter::ErrorLinkRegExp, and UrlFilter::ParseErrorLinkRegExp.
|
inherited |
Returns the texts found by the filter when matching the filter's regular expression.
Definition at line 347 of file Filter.cpp.
|
inherited |
Returns the column on endLine() where the hotspot area ends.
Definition at line 314 of file Filter.cpp.
Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), TerminalView::mouseMoveEvent(), and TerminalView::paintFilters().
|
inherited |
Returns the line where the hotspot area ends.
Definition at line 306 of file Filter.cpp.
Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), TerminalView::mouseMoveEvent(), and TerminalView::paintFilters().
|
inline |
|
inherited |
Sets the captured texts associated with this hotspot.
Definition at line 343 of file Filter.cpp.
Referenced by RegExpFilter::process(), and UrlFilter::process().
|
protectedinherited |
Sets the type of a hotspot.
This should only be set once
Definition at line 322 of file Filter.cpp.
Referenced by RegExpFilter::HotSpot::HotSpot().
|
inherited |
Returns the column on startLine() where the hotspot area starts.
Definition at line 310 of file Filter.cpp.
Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), TerminalView::mouseMoveEvent(), and TerminalView::paintFilters().
|
inherited |
Returns the line when the hotspot area starts.
Definition at line 302 of file Filter.cpp.
Referenced by Filter::addHotSpot(), Filter::hotSpotAt(), TerminalView::hotSpotRegion(), TerminalView::mouseMoveEvent(), 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 from Filter::HotSpot.
Definition at line 479 of file Filter.cpp.
|
inherited |
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 318 of file Filter.cpp.
Referenced by TerminalView::mouseMoveEvent(), TerminalView::mousePressEvent(), and TerminalView::paintFilters().
|
private |
Definition at line 492 of file Filter.cpp.
References UrlFilter::EmailAddressRegExp, Filter::ErrorLink, UrlFilter::ErrorLinkRegExp, UrlFilter::FullUrlRegExp, and UrlFilter::ParseErrorLinkRegExp.
|
privateinherited |
|
private |
Definition at line 304 of file Filter.h.
Referenced by ~HotSpot(), and get_urlObject().