GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
UrlFilter::HotSpot Class Reference

Hotspot type created by UrlFilter instances. More...

#include "Filter.h"

Inheritance diagram for UrlFilter::HotSpot:
Collaboration diagram for UrlFilter::HotSpot:

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...
 
FilterObjectget_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

FilterObject_urlObject
 

Detailed Description

Hotspot type created by UrlFilter instances.

The activate() method opens a web browser at the given URL when called.

Definition at line 275 of file Filter.h.

Member Enumeration Documentation

◆ UrlType

Enumerator
StandardUrl 
Email 
ErrorLink 
ParseErrorLink 
Unknown 

Definition at line 294 of file Filter.h.

Constructor & Destructor Documentation

◆ HotSpot()

UrlFilter::HotSpot::HotSpot ( int  startLine,
int  startColumn,
int  endLine,
int  endColumn,
Type  t 
)

Definition at line 475 of file Filter.cpp.

◆ ~HotSpot()

UrlFilter::HotSpot::~HotSpot ( )
virtual

Reimplemented from Filter::HotSpot.

Definition at line 605 of file Filter.cpp.

References _urlObject.

Member Function Documentation

◆ actions()

QList< QAction * > UrlFilter::HotSpot::actions ( void  )
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 613 of file Filter.cpp.

References arg, Filter::ErrorLink, UrlFilter::ErrorLinkRegExp, list, UrlFilter::ParseErrorLinkRegExp, and url.

◆ activate()

void UrlFilter::HotSpot::activate ( QObject object = nullptr)
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 511 of file Filter.cpp.

References Filter::ErrorLink, UrlFilter::ErrorLinkRegExp, UrlFilter::ParseErrorLinkRegExp, and url.

◆ capturedTexts()

QStringList RegExpFilter::HotSpot::capturedTexts ( ) const
inherited

Returns the texts found by the filter when matching the filter's regular expression.

Definition at line 350 of file Filter.cpp.

◆ endColumn()

int Filter::HotSpot::endColumn ( ) const
inherited

Returns the column on endLine() where the hotspot area ends.

Definition at line 317 of file Filter.cpp.

Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), and TerminalView::paintFilters().

◆ endLine()

int Filter::HotSpot::endLine ( ) const
inherited

Returns the line where the hotspot area ends.

Definition at line 309 of file Filter.cpp.

Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), and TerminalView::paintFilters().

◆ get_urlObject()

FilterObject* UrlFilter::HotSpot::get_urlObject ( )
inline

Definition at line 291 of file Filter.h.

References _urlObject.

◆ setCapturedTexts()

void RegExpFilter::HotSpot::setCapturedTexts ( const QStringList &  texts)
inherited

Sets the captured texts associated with this hotspot.

Definition at line 346 of file Filter.cpp.

◆ setType()

void Filter::HotSpot::setType ( Filter::Type  type)
protectedinherited

Sets the type of a hotspot.

This should only be set once

Definition at line 325 of file Filter.cpp.

References type.

Referenced by RegExpFilter::HotSpot::HotSpot().

◆ startColumn()

int Filter::HotSpot::startColumn ( ) const
inherited

Returns the column on startLine() where the hotspot area starts.

Definition at line 313 of file Filter.cpp.

Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), and TerminalView::paintFilters().

◆ startLine()

int Filter::HotSpot::startLine ( ) const
inherited

Returns the line when the hotspot area starts.

Definition at line 305 of file Filter.cpp.

Referenced by Filter::hotSpotAt(), TerminalView::hotSpotRegion(), and TerminalView::paintFilters().

◆ tooltip()

QString UrlFilter::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 from Filter::HotSpot.

Definition at line 482 of file Filter.cpp.

References url.

◆ type()

Filter::Type Filter::HotSpot::type ( void  ) const
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 321 of file Filter.cpp.

Referenced by TerminalView::mousePressEvent(), and TerminalView::paintFilters().

◆ urlType()

Member Data Documentation

◆ _urlObject

FilterObject* UrlFilter::HotSpot::_urlObject
private

Definition at line 304 of file Filter.h.

Referenced by get_urlObject(), and ~HotSpot().


The documentation for this class was generated from the following files: