28 #include <QtCore/QList> 29 #include <QtCore/QObject> 30 #include <QtCore/QStringList> 31 #include <QtCore/QHash> 32 #include <QtCore/QRegExp> 131 virtual QString
tooltip()
const;
182 void getLineColumn(
int position ,
int& startLine ,
int& startColumn);
256 int endLine,
int endColumn,
Type);
289 virtual QString
tooltip()
const;
409 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...
const QList< int > * _linePositions
OCTAVE_EXPORT octave_value_list column
For example cd octave end example noindent changes the current working directory to file
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 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.
QRegExp regExp() const
Returns the regular expression which the filter searches for in blocks of text.
const QString * buffer()
Returns the internal buffer.
static const QRegExp CompleteErrorLinkRegExp
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.
int endLine() const
Returns the line where the hotspot area ends.
void request_open_file_signal(const QString &, int)
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.
void request_edit_mfile_signal(const QString &, int)
bool containsFilter(Filter *filter)
Returns true if the chain contains filter.
A filter which matches URLs in blocks of text.
QList< HotSpot * > hotSpots() const
Returns the list of hotspots identified by the filter.
static const QRegExp ErrorLinkRegExp
A filter which searches for sections of text matching a regular expression and creates a new RegExpFi...
QList< int > * _linePositions
virtual ~TerminalImageFilterChain()
virtual void activate(QObject *object=nullptr)=0
Causes the an action associated with a hotspot to be triggered.
int startColumn() const
Returns the column on startLine() where the hotspot area starts.
void request_open_file(const QString &file, int line)
Type type() const
Returns the type of the hotspot.
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
virtual void activate(QObject *object=nullptr)
Open a web browser at the current URL.
A filter processes blocks of text looking for certain patterns (such as URLs or keywords from a list)...
void process()
Processes each filter in the chain.
QStringList capturedTexts() const
Returns the texts found by the filter when matching the filter's regular expression.
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 QList< QAction * > actions()
Returns a list of actions associated with the hotspot which can be used in a menu or toolbar...
QList< HotSpot * > _hotspotList
Filter::HotSpot * _filter
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.
virtual void process()
Reimplemented to search the filter's text buffer for text matching regExp()
void reset()
Empties the filters internal buffer and resets the line count back to 0.
QList< HotSpot * > hotSpotsAtLine(int line) const
Returns the list of hotspots identified by the filter which occur on a given line.
RegExpFilter(Type)
Constructs a new regular expression filter.
FilterObject(Filter::HotSpot *filter)
void setType(Type type)
Sets the type of a hotspot.
Filter()
Constructs a new filter.
void request_open_file_signal(const QString &, int)
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...
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.
Filter::HotSpot * hotSpotAt(int line, int column) const
Returns the first hotspot which occurs at line, column or 0 if no hotspot was found.
void request_open_file(const QString &, int)
FilterObject * get_urlObject()
MArray< T > filter(MArray< T > &b, MArray< T > &a, MArray< T > &x, MArray< T > &si, int dim=0)
void removeFilter(Filter *filter)
Removes a filter from the chain.
Type of hotspot created by RegExpFilter.
static const QRegExp CompleteUrlRegExp
QStringList _capturedTexts
void setImage(const Character *const image, int lines, int columns, const QVector< LineProperty > &lineProperties)
Set the current terminal image to image.
HotSpot * hotSpotAt(int line, int column) const
Adds a new line of text to the filter and increments the line count.
Type
Represents an area of text which matched the pattern a particular filter has been looking for...
virtual RegExpFilter::HotSpot * newHotSpot(int startLine, int startColumn, int endLine, int endColumn, Type)
Called when a match for the regular expression is encountered.
HotSpot(int startLine, int startColumn, int endLine, int endColumn, Type t)
HotSpot(int startLine, int startColumn, int endLine, int endColumn, Filter::Type)
void setBuffer(const QString *buffer, const QList< int > *linePositions)
TODO: Document me.
static const QRegExp ParseErrorLinkRegExp
int startLine() const
Returns the line when the hotspot area starts.
int endColumn() const
Returns the column on endLine() where the hotspot area ends.
FilterObject * _urlObject
virtual void activate(QObject *object=nullptr)
Causes the an action associated with a hotspot to be triggered.
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.
virtual HotSpot * newHotSpot(int, int, int, int, Type)
Called when a match for the regular expression is encountered.
QMultiHash< int, HotSpot * > _hotspots
QList< Filter::HotSpot * > hotSpots() const
Returns a list of all the hotspots in all the chain's filters.
Hotspot type created by UrlFilter instances.
QList< Filter::HotSpot > hotSpotsAtLine(int line) const
Returns a list of all hotspots at the given line in all the chain's filters.