GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Filter::HotSpot Class Reference

Represents an area of text which matched the pattern a particular filter has been looking for. More...

#include "Filter.h"

Inheritance diagram for Filter::HotSpot:
Inheritance graph
[legend]
Collaboration diagram for Filter::HotSpot:
Collaboration graph
[legend]

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

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 69 of file Filter.h.

Member Enumeration Documentation

Enumerator:
NotSpecified 
Link 
Marker 

Definition at line 79 of file Filter.h.

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 UrlFilter::HotSpot, and RegExpFilter::HotSpot.

Definition at line 287 of file Filter.cpp.

Filter::HotSpot::~HotSpot ( )
virtual

Reimplemented in UrlFilter::HotSpot.

Definition at line 247 of file Filter.cpp.

Member Function Documentation

QList< QAction * > Filter::HotSpot::actions ( )
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().

virtual void Filter::HotSpot::activate ( QObject object = 0)
pure virtual

Causes the an action associated with a hotspot to be triggered.

Parameters
objectThe 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().

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

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().

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 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().

Member Data Documentation

int Filter::HotSpot::_endColumn
private

Definition at line 133 of file Filter.h.

int Filter::HotSpot::_endLine
private

Definition at line 132 of file Filter.h.

int Filter::HotSpot::_startColumn
private

Definition at line 131 of file Filter.h.

int Filter::HotSpot::_startLine
private

Definition at line 130 of file Filter.h.

Type Filter::HotSpot::_type
private

Definition at line 134 of file Filter.h.


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