Konsole::Filter::HotSpot

Search for usage in LXR

Konsole::Filter::HotSpot Class Referenceabstract

#include <Filter.h>

Inheritance diagram for Konsole::Filter::HotSpot:

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.

Definition at line 68 of file Filter.h.

Member Enumeration Documentation

◆ Type

enum Konsole::Filter::HotSpot::Type

Definition at line 78 of file Filter.h.

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

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 Konsole::UrlFilter::HotSpot.

Definition at line 275 of file Filter.cpp.

◆ activate()

virtual void Konsole::Filter::HotSpot::activate ( const QString & action = QString())
pure virtual

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

Parameters
actionThe 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()

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

Sets the type of a hotspot.

This should only be set once

Definition at line 299 of file Filter.cpp.

◆ 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:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:55:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.