Konsole
Filter.cpp
Go to the documentation of this file.
118 void TerminalImageFilterChain::setImage(const Character* const image , int lines , int columns, const QVector<LineProperty>& lineProperties)
204 startColumn = string_width(buffer()->mid(_linePositions->value(i), position - _linePositions->value(i)));
426 // Note: Altering these regular expressions can have a major effect on the performance of the filters
427 // used for finding URLs in the text, especially if they are very general and could match very long
433 // protocolname:// or www. followed by anything other than whitespaces, <, >, ' or ", and ends before whitespaces, <, >, ', ", ], !, ), :, comma and dot
434 const QRegExp UrlFilter::FullUrlRegExp("(www\\.(?!\\.)|[a-z][a-z0-9+.-]*://)[^\\s<>'\"]+[^!,\\.\\s<>'\"\\]\\)\\:]");
void setText(const QString &text)
void clear()
HotSpot * hotSpotAt(int line, int column) const
Adds a new line of text to the filter and increments the line count.
Definition: Filter.cpp:240
const T & next()
Represents an area of text which matched the pattern a particular filter has been looking for...
Definition: Filter.h:70
Filter::HotSpot * hotSpotAt(int line, int column) const
Returns the first hotspot which occurs at line, column or 0 if no hotspot was found.
Definition: Filter.cpp:81
virtual RegExpFilter::HotSpot * newHotSpot(int, int, int, int)
Called when a match for the regular expression is encountered.
Definition: Filter.cpp:373
QString & prepend(QChar ch)
void setCapturedTexts(const QStringList &texts)
Sets the captured texts associated with this hotspot.
Definition: Filter.cpp:307
void getLineColumn(int position, int &startLine, int &startColumn)
Converts a character position within buffer() to a line and column.
Definition: Filter.cpp:189
virtual void activate(QObject *object=0)
Causes the action associated with a hotspot to be triggered.
Definition: Filter.cpp:303
virtual void decodeLine(const Character *const characters, int count, LineProperty properties)
Converts a line of terminal characters with associated properties into a text string and writes the s...
Definition: TerminalCharacterDecoder.cpp:68
T value(int i) const
virtual ~TerminalImageFilterChain()
Definition: Filter.cpp:112
T value(int i) const
A terminal character decoder which produces plain text, ignoring colors and other appearance-related ...
Definition: TerminalCharacterDecoder.h:72
int matchedLength() const
A single character in the terminal which consists of a unicode character value, foreground and backgr...
Definition: Character.h:77
int indexIn(const QString &str, int offset, CaretMode caretMode) const
virtual RegExpFilter::HotSpot * newHotSpot(int startLine, int startColumn, int endLine, int endColumn)
Called when a match for the regular expression is encountered.
Definition: Filter.cpp:367
QWidget * activeWindow()
int count(const T &value) const
void append(const T &value)
Definition: Filter.h:86
bool empty() const
void setTrailingWhitespace(bool enable)
Set whether trailing whitespace at the end of lines should be included in the output.
Definition: TerminalCharacterDecoder.cpp:41
QClipboard * clipboard()
QStringList capturedTexts() const
void setObjectName(const QString &name)
int removeAll(const T &value)
virtual void process()
Reimplemented to search the filter's text buffer for text matching regExp()
Definition: Filter.cpp:328
Definition: Filter.h:284
void setBuffer(const QString *buffer, const QList< int > *linePositions)
TODO: Document me.
Definition: Filter.cpp:183
QList< HotSpot * > hotSpotsAtLine(int line) const
Returns the list of hotspots identified by the filter which occur on a given line.
Definition: Filter.cpp:235
TerminalImageFilterChain()
Definition: Filter.cpp:106
void remove()
void setBuffer(const QString *buffer, const QList< int > *linePositions)
Sets the buffer for each filter in the chain to process.
Definition: Filter.cpp:65
QList< HotSpot * > hotSpots() const
Returns the list of hotspots identified by the filter.
Definition: Filter.cpp:231
void setRegExp(const QRegExp &text)
Sets the regular expression which the filter searches for in blocks of text.
Definition: Filter.cpp:316
A filter which searches for sections of text matching a regular expression and creates a new RegExpFi...
Definition: Filter.h:182
bool contains(QChar ch, Qt::CaseSensitivity cs) const
bool hasNext() const
virtual QList< QAction * > actions()
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar...
Definition: Filter.cpp:264
A filter processes blocks of text looking for certain patterns (such as URLs or keywords from a list)...
Definition: Filter.h:55
virtual void activate(QObject *object=0)
Open a web browser at the current URL.
Definition: Filter.cpp:398
virtual void begin(QTextStream *output)
Begin decoding characters.
Definition: TerminalCharacterDecoder.cpp:49
T & next()
Definition: Filter.h:84
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: Filter.cpp:256
HotSpot(int startLine, int startColumn, int endLine, int endColumn)
Definition: Filter.cpp:297
QRegExp regExp() const
Returns the regular expression which the filter searches for in blocks of text.
Definition: Filter.cpp:320
int length() const
int endColumn() const
Returns the column on endLine() where the hotspot area ends.
Definition: Filter.cpp:280
void setImage(const Character *const image, int lines, int columns, const QVector< LineProperty > &lineProperties)
Set the current terminal image to image.
Definition: Filter.cpp:118
void reset()
Empties the filters internal buffer and resets the line count back to 0.
Definition: Filter.cpp:177
void setText(const QString &text, Mode mode)
QStringList capturedTexts() const
Returns the texts found by the filter when matching the filter's regular expression.
Definition: Filter.cpp:311
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual QList< QAction * > actions()
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar...
Definition: Filter.cpp:455
bool exactMatch(const QString &str) const
HotSpot(int startLine, int startColumn, int endLine, int endColumn)
Definition: Filter.cpp:379
int startColumn() const
Returns the column on startLine() where the hotspot area starts.
Definition: Filter.cpp:276
QList< Filter::HotSpot * > hotSpots() const
Returns a list of all the hotspots in all the chain's filters.
Definition: Filter.cpp:95
bool hasNext() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.