27 #include <QtCore/QList>
28 #include <QtCore/QObject>
29 #include <QtCore/QStringList>
30 #include <QtCore/QHash>
31 #include <QtCore/QRegExp>
123 virtual QString
tooltip()
const;
174 void getLineColumn(
int position ,
int& startLine ,
int& startColumn);
239 int endLine,
int endColumn);
269 virtual QString
tooltip()
const;
372 const QVector<LineProperty>& lineProperties);
virtual QList< QAction * > actions()
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar...
int startColumn() const
Returns the column on startLine() where the hotspot area starts.
QStringList capturedTexts() const
Returns the texts found by the filter when matching the filter's regular expression.
int endLine() const
Returns the line where the hotspot area ends.
const QList< int > * _linePositions
void addHotSpot(HotSpot *)
Adds a new hotspot to the list.
void reset()
Resets each filter in the chain.
void clear()
Removes all filters from the chain.
QList< Filter::HotSpot > hotSpotsAtLine(int line) const
Returns a list of all hotspots at the given line in all the chain's filters.
const QString * buffer()
Returns the internal buffer.
HotSpot(int startLine, int startColumn, int endLine, int endColumn)
A single character in the terminal which consists of a unicode character value, foreground and backgr...
A filter chain which processes character images from terminal displays.
void addFilter(Filter *filter)
Adds a new filter to the chain.
void getLineColumn(int position, int &startLine, int &startColumn)
Converts a character position within buffer() to a line and column.
virtual QString tooltip() const
Returns the text of a tooltip to be shown when the mouse moves over the hotspot, or an empty string i...
bool containsFilter(Filter *filter)
Returns true if the chain contains filter.
A filter which matches URLs in blocks of text.
Represents an area of text which matched the pattern a particular filter has been looking for...
Filter::HotSpot * hotSpotAt(int line, int column) const
Returns the first hotspot which occurs at line, column or 0 if no hotspot was found.
A filter which searches for sections of text matching a regular expression and creates a new RegExpFi...
QList< int > * _linePositions
virtual ~TerminalImageFilterChain()
QRegExp regExp() const
Returns the regular expression which the filter searches for in blocks of text.
A filter processes blocks of text looking for certain patterns (such as URLs or keywords from a list)...
int startLine() const
Returns the line when the hotspot area starts.
void process()
Processes each filter in the chain.
virtual RegExpFilter::HotSpot * newHotSpot(int startLine, int startColumn, int endLine, int endColumn)
Called when a match for the regular expression is encountered.
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.
QList< HotSpot * > hotSpotsAtLine(int line) const
Returns the list of hotspots identified by the filter which occur on a given line.
virtual QList< QAction * > actions()
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar...
QList< HotSpot * > _hotspotList
QList< Filter::HotSpot * > hotSpots() const
Returns a list of all the hotspots in all the chain's filters.
Filter::HotSpot * _filter
HotSpot(int startLine, int startColumn, int endLine, int endColumn)
virtual void process()
Reimplemented to search the filter's text buffer for text matching regExp()
void setBuffer(const QString *buffer, const QList< int > *linePositions)
Sets the buffer for each filter in the chain to process.
QList< HotSpot * > hotSpots() const
Returns the list of hotspots identified by the filter.
void reset()
Empties the filters internal buffer and resets the line count back to 0.
virtual RegExpFilter::HotSpot * newHotSpot(int, int, int, int)
Called when a match for the regular expression is encountered.
FilterObject(Filter::HotSpot *filter)
void setType(Type type)
Sets the type of a hotspot.
Filter()
Constructs a new filter.
HotSpot * hotSpotAt(int line, int column) const
Adds a new line of text to the filter and increments the line count.
MArray< double > filter(MArray< double > &, MArray< double > &, MArray< double > &, int dim)
TerminalImageFilterChain()
static const QRegExp EmailAddressRegExp
void setRegExp(const QRegExp &text)
Sets the regular expression which the filter searches for in blocks of text.
static const QRegExp FullUrlRegExp
A chain which allows a group of filters to be processed as one.
RegExpFilter()
Constructs a new regular expression filter.
virtual void activate(QObject *object=0)
Open a web browser at the current URL.
void removeFilter(Filter *filter)
Removes a filter from the chain.
virtual void activate(QObject *object=0)=0
Causes the an action associated with a hotspot to be triggered.
Type of hotspot created by RegExpFilter.
static const QRegExp CompleteUrlRegExp
QStringList _capturedTexts
virtual QString tooltip() const
Returns the text of a tooltip to be shown when the mouse moves over the hotspot, or an empty string i...
void setImage(const Character *const image, int lines, int columns, const QVector< LineProperty > &lineProperties)
Set the current terminal image to image.
int endColumn() const
Returns the column on endLine() where the hotspot area ends.
void setBuffer(const QString *buffer, const QList< int > *linePositions)
TODO: Document me.
Type type() const
Returns the type of the hotspot.
FilterObject * _urlObject
void setCapturedTexts(const QStringList &texts)
Sets the captured texts associated with this hotspot.
virtual void process()=0
Causes the filter to process the block of text currently in its internal buffer.
QMultiHash< int, HotSpot * > _hotspots
virtual void activate(QObject *object=0)
Causes the an action associated with a hotspot to be triggered.
Hotspot type created by UrlFilter instances.