• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • kde-4.14
  • applications
  • konsole
  • src
Filter.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301 USA.
18 */
19 
20 // Own
21 #include "Filter.h"
22 
23 // Qt
24 #include <QAction>
25 #include <QApplication>
26 #include <QtGui/QClipboard>
27 #include <QtCore/QString>
28 #include <QtCore/QTextStream>
29 
30 // KDE
31 #include <KLocalizedString>
32 #include <KRun>
33 
34 // Konsole
35 #include "TerminalCharacterDecoder.h"
36 #include "konsole_wcwidth.h"
37 
38 using namespace Konsole;
39 
40 FilterChain::~FilterChain()
41 {
42  QMutableListIterator<Filter*> iter(*this);
43 
44  while (iter.hasNext()) {
45  Filter* filter = iter.next();
46  iter.remove();
47  delete filter;
48  }
49 }
50 
51 void FilterChain::addFilter(Filter* filter)
52 {
53  append(filter);
54 }
55 void FilterChain::removeFilter(Filter* filter)
56 {
57  removeAll(filter);
58 }
59 void FilterChain::reset()
60 {
61  QListIterator<Filter*> iter(*this);
62  while (iter.hasNext())
63  iter.next()->reset();
64 }
65 void FilterChain::setBuffer(const QString* buffer , const QList<int>* linePositions)
66 {
67  QListIterator<Filter*> iter(*this);
68  while (iter.hasNext())
69  iter.next()->setBuffer(buffer, linePositions);
70 }
71 void FilterChain::process()
72 {
73  QListIterator<Filter*> iter(*this);
74  while (iter.hasNext())
75  iter.next()->process();
76 }
77 void FilterChain::clear()
78 {
79  QList<Filter*>::clear();
80 }
81 Filter::HotSpot* FilterChain::hotSpotAt(int line , int column) const
82 {
83  QListIterator<Filter*> iter(*this);
84  while (iter.hasNext()) {
85  Filter* filter = iter.next();
86  Filter::HotSpot* spot = filter->hotSpotAt(line, column);
87  if (spot != 0) {
88  return spot;
89  }
90  }
91 
92  return 0;
93 }
94 
95 QList<Filter::HotSpot*> FilterChain::hotSpots() const
96 {
97  QList<Filter::HotSpot*> list;
98  QListIterator<Filter*> iter(*this);
99  while (iter.hasNext()) {
100  Filter* filter = iter.next();
101  list << filter->hotSpots();
102  }
103  return list;
104 }
105 
106 TerminalImageFilterChain::TerminalImageFilterChain()
107  : _buffer(0)
108  , _linePositions(0)
109 {
110 }
111 
112 TerminalImageFilterChain::~TerminalImageFilterChain()
113 {
114  delete _buffer;
115  delete _linePositions;
116 }
117 
118 void TerminalImageFilterChain::setImage(const Character* const image , int lines , int columns, const QVector<LineProperty>& lineProperties)
119 {
120  if (empty())
121  return;
122 
123  // reset all filters and hotspots
124  reset();
125 
126  PlainTextDecoder decoder;
127  decoder.setTrailingWhitespace(false);
128 
129  // setup new shared buffers for the filters to process on
130  QString* newBuffer = new QString();
131  QList<int>* newLinePositions = new QList<int>();
132  setBuffer(newBuffer , newLinePositions);
133 
134  // free the old buffers
135  delete _buffer;
136  delete _linePositions;
137 
138  _buffer = newBuffer;
139  _linePositions = newLinePositions;
140 
141  QTextStream lineStream(_buffer);
142  decoder.begin(&lineStream);
143 
144  for (int i = 0 ; i < lines ; i++) {
145  _linePositions->append(_buffer->length());
146  decoder.decodeLine(image + i * columns, columns, LINE_DEFAULT);
147 
148  // pretend that each line ends with a newline character.
149  // this prevents a link that occurs at the end of one line
150  // being treated as part of a link that occurs at the start of the next line
151  //
152  // the downside is that links which are spread over more than one line are not
153  // highlighted.
154  //
155  // TODO - Use the "line wrapped" attribute associated with lines in a
156  // terminal image to avoid adding this imaginary character for wrapped
157  // lines
158  if (!(lineProperties.value(i, LINE_DEFAULT) & LINE_WRAPPED))
159  lineStream << QChar('\n');
160  }
161  decoder.end();
162 }
163 
164 Filter::Filter() :
165  _linePositions(0),
166  _buffer(0)
167 {
168 }
169 
170 Filter::~Filter()
171 {
172  QListIterator<HotSpot*> iter(_hotspotList);
173  while (iter.hasNext()) {
174  delete iter.next();
175  }
176 }
177 void Filter::reset()
178 {
179  _hotspots.clear();
180  _hotspotList.clear();
181 }
182 
183 void Filter::setBuffer(const QString* buffer , const QList<int>* linePositions)
184 {
185  _buffer = buffer;
186  _linePositions = linePositions;
187 }
188 
189 void Filter::getLineColumn(int position , int& startLine , int& startColumn)
190 {
191  Q_ASSERT(_linePositions);
192  Q_ASSERT(_buffer);
193 
194  for (int i = 0 ; i < _linePositions->count() ; i++) {
195  int nextLine = 0;
196 
197  if (i == _linePositions->count() - 1)
198  nextLine = _buffer->length() + 1;
199  else
200  nextLine = _linePositions->value(i + 1);
201 
202  if (_linePositions->value(i) <= position && position < nextLine) {
203  startLine = i;
204  startColumn = string_width(buffer()->mid(_linePositions->value(i), position - _linePositions->value(i)));
205  return;
206  }
207  }
208 }
209 
210 /*void Filter::addLine(const QString& text)
211 {
212  _linePositions << _buffer.length();
213  _buffer.append(text);
214 }*/
215 
216 const QString* Filter::buffer()
217 {
218  return _buffer;
219 }
220 Filter::HotSpot::~HotSpot()
221 {
222 }
223 void Filter::addHotSpot(HotSpot* spot)
224 {
225  _hotspotList << spot;
226 
227  for (int line = spot->startLine() ; line <= spot->endLine() ; line++) {
228  _hotspots.insert(line, spot);
229  }
230 }
231 QList<Filter::HotSpot*> Filter::hotSpots() const
232 {
233  return _hotspotList;
234 }
235 QList<Filter::HotSpot*> Filter::hotSpotsAtLine(int line) const
236 {
237  return _hotspots.values(line);
238 }
239 
240 Filter::HotSpot* Filter::hotSpotAt(int line , int column) const
241 {
242  QList<HotSpot*> hotspots = _hotspots.values(line);
243 
244  foreach(HotSpot* spot, hotspots) {
245  if (spot->startLine() == line && spot->startColumn() > column)
246  continue;
247  if (spot->endLine() == line && spot->endColumn() < column)
248  continue;
249 
250  return spot;
251  }
252 
253  return 0;
254 }
255 
256 Filter::HotSpot::HotSpot(int startLine , int startColumn , int endLine , int endColumn)
257  : _startLine(startLine)
258  , _startColumn(startColumn)
259  , _endLine(endLine)
260  , _endColumn(endColumn)
261  , _type(NotSpecified)
262 {
263 }
264 QList<QAction*> Filter::HotSpot::actions()
265 {
266  return QList<QAction*>();
267 }
268 int Filter::HotSpot::startLine() const
269 {
270  return _startLine;
271 }
272 int Filter::HotSpot::endLine() const
273 {
274  return _endLine;
275 }
276 int Filter::HotSpot::startColumn() const
277 {
278  return _startColumn;
279 }
280 int Filter::HotSpot::endColumn() const
281 {
282  return _endColumn;
283 }
284 Filter::HotSpot::Type Filter::HotSpot::type() const
285 {
286  return _type;
287 }
288 void Filter::HotSpot::setType(Type type)
289 {
290  _type = type;
291 }
292 
293 RegExpFilter::RegExpFilter()
294 {
295 }
296 
297 RegExpFilter::HotSpot::HotSpot(int startLine, int startColumn, int endLine, int endColumn)
298  : Filter::HotSpot(startLine, startColumn, endLine, endColumn)
299 {
300  setType(Marker);
301 }
302 
303 void RegExpFilter::HotSpot::activate(QObject*)
304 {
305 }
306 
307 void RegExpFilter::HotSpot::setCapturedTexts(const QStringList& texts)
308 {
309  _capturedTexts = texts;
310 }
311 QStringList RegExpFilter::HotSpot::capturedTexts() const
312 {
313  return _capturedTexts;
314 }
315 
316 void RegExpFilter::setRegExp(const QRegExp& regExp)
317 {
318  _searchText = regExp;
319 }
320 QRegExp RegExpFilter::regExp() const
321 {
322  return _searchText;
323 }
324 /*void RegExpFilter::reset(int)
325 {
326  _buffer = QString();
327 }*/
328 void RegExpFilter::process()
329 {
330  int pos = 0;
331  const QString* text = buffer();
332 
333  Q_ASSERT(text);
334 
335  // ignore any regular expressions which match an empty string.
336  // otherwise the while loop below will run indefinitely
337  static const QString emptyString("");
338  if (_searchText.exactMatch(emptyString))
339  return;
340 
341  while (pos >= 0) {
342  pos = _searchText.indexIn(*text, pos);
343 
344  if (pos >= 0) {
345  int startLine = 0;
346  int endLine = 0;
347  int startColumn = 0;
348  int endColumn = 0;
349 
350  getLineColumn(pos, startLine, startColumn);
351  getLineColumn(pos + _searchText.matchedLength(), endLine, endColumn);
352 
353  RegExpFilter::HotSpot* spot = newHotSpot(startLine, startColumn,
354  endLine, endColumn);
355  spot->setCapturedTexts(_searchText.capturedTexts());
356 
357  addHotSpot(spot);
358  pos += _searchText.matchedLength();
359 
360  // if matchedLength == 0, the program will get stuck in an infinite loop
361  if (_searchText.matchedLength() == 0)
362  pos = -1;
363  }
364  }
365 }
366 
367 RegExpFilter::HotSpot* RegExpFilter::newHotSpot(int startLine, int startColumn,
368  int endLine, int endColumn)
369 {
370  return new RegExpFilter::HotSpot(startLine, startColumn,
371  endLine, endColumn);
372 }
373 RegExpFilter::HotSpot* UrlFilter::newHotSpot(int startLine, int startColumn, int endLine,
374  int endColumn)
375 {
376  return new UrlFilter::HotSpot(startLine, startColumn,
377  endLine, endColumn);
378 }
379 UrlFilter::HotSpot::HotSpot(int startLine, int startColumn, int endLine, int endColumn)
380  : RegExpFilter::HotSpot(startLine, startColumn, endLine, endColumn)
381  , _urlObject(new FilterObject(this))
382 {
383  setType(Link);
384 }
385 
386 UrlFilter::HotSpot::UrlType UrlFilter::HotSpot::urlType() const
387 {
388  const QString url = capturedTexts().first();
389 
390  if (FullUrlRegExp.exactMatch(url))
391  return StandardUrl;
392  else if (EmailAddressRegExp.exactMatch(url))
393  return Email;
394  else
395  return Unknown;
396 }
397 
398 void UrlFilter::HotSpot::activate(QObject* object)
399 {
400  QString url = capturedTexts().first();
401 
402  const UrlType kind = urlType();
403 
404  const QString& actionName = object ? object->objectName() : QString();
405 
406  if (actionName == "copy-action") {
407  QApplication::clipboard()->setText(url);
408  return;
409  }
410 
411  if (!object || actionName == "open-action") {
412  if (kind == StandardUrl) {
413  // if the URL path does not include the protocol ( eg. "www.kde.org" ) then
414  // prepend http:// ( eg. "www.kde.org" --> "http://www.kde.org" )
415  if (!url.contains("://")) {
416  url.prepend("http://");
417  }
418  } else if (kind == Email) {
419  url.prepend("mailto:");
420  }
421 
422  new KRun(url, QApplication::activeWindow());
423  }
424 }
425 
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
428 // pieces of text.
429 // Please be careful when altering them.
430 
431 //regexp matches:
432 // full url:
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<>'\"\\]\\)\\:]");
435 // email address:
436 // [word chars, dots or dashes]@[word chars, dots or dashes].[word chars]
437 const QRegExp UrlFilter::EmailAddressRegExp("\\b(\\w|\\.|-)+@(\\w|\\.|-)+\\.\\w+\\b");
438 
439 // matches full url or email address
440 const QRegExp UrlFilter::CompleteUrlRegExp('(' + FullUrlRegExp.pattern() + '|' +
441  EmailAddressRegExp.pattern() + ')');
442 
443 UrlFilter::UrlFilter()
444 {
445  setRegExp(CompleteUrlRegExp);
446 }
447 UrlFilter::HotSpot::~HotSpot()
448 {
449  delete _urlObject;
450 }
451 void FilterObject::activated()
452 {
453  _filter->activate(sender());
454 }
455 QList<QAction*> UrlFilter::HotSpot::actions()
456 {
457  QAction* openAction = new QAction(_urlObject);
458  QAction* copyAction = new QAction(_urlObject);
459 
460  const UrlType kind = urlType();
461  Q_ASSERT(kind == StandardUrl || kind == Email);
462 
463  if (kind == StandardUrl) {
464  openAction->setText(i18n("Open Link"));
465  copyAction->setText(i18n("Copy Link Address"));
466  } else if (kind == Email) {
467  openAction->setText(i18n("Send Email To..."));
468  copyAction->setText(i18n("Copy Email Address"));
469  }
470 
471  // object names are set here so that the hotspot performs the
472  // correct action when activated() is called with the triggered
473  // action passed as a parameter.
474  openAction->setObjectName(QLatin1String("open-action"));
475  copyAction->setObjectName(QLatin1String("copy-action"));
476 
477  QObject::connect(openAction , SIGNAL(triggered()) , _urlObject , SLOT(activated()));
478  QObject::connect(copyAction , SIGNAL(triggered()) , _urlObject , SLOT(activated()));
479 
480  QList<QAction*> actions;
481  actions << openAction;
482  actions << copyAction;
483 
484  return actions;
485 }
486 
487 #include "Filter.moc"
QAction::setText
void setText(const QString &text)
QList::clear
void clear()
Konsole::PlainTextDecoder::end
virtual void end()
End decoding.
Definition: TerminalCharacterDecoder.cpp:55
Konsole::Filter::hotSpotAt
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
QListIterator::next
const T & next()
Konsole::FilterChain::~FilterChain
virtual ~FilterChain()
Definition: Filter.cpp:40
Konsole::Filter::HotSpot::Type
Type
Definition: Filter.h:80
Konsole::FilterChain::reset
void reset()
Resets each filter in the chain.
Definition: Filter.cpp:59
Konsole::Filter::HotSpot
Represents an area of text which matched the pattern a particular filter has been looking for...
Definition: Filter.h:70
Konsole::FilterChain::hotSpotAt
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
Konsole::Filter::addHotSpot
void addHotSpot(HotSpot *)
Adds a new hotspot to the list.
Definition: Filter.cpp:223
Konsole::UrlFilter::newHotSpot
virtual RegExpFilter::HotSpot * newHotSpot(int, int, int, int)
Called when a match for the regular expression is encountered.
Definition: Filter.cpp:373
QChar
QString::prepend
QString & prepend(QChar ch)
Konsole::RegExpFilter::HotSpot::setCapturedTexts
void setCapturedTexts(const QStringList &texts)
Sets the captured texts associated with this hotspot.
Definition: Filter.cpp:307
Konsole::UrlFilter::UrlFilter
UrlFilter()
Definition: Filter.cpp:443
Konsole::FilterChain::removeFilter
void removeFilter(Filter *filter)
Removes a filter from the chain.
Definition: Filter.cpp:55
Konsole::Filter::Filter
Filter()
Constructs a new filter.
Definition: Filter.cpp:164
Konsole::LINE_WRAPPED
const int LINE_WRAPPED
Definition: Character.h:34
Konsole::Filter::getLineColumn
void getLineColumn(int position, int &startLine, int &startColumn)
Converts a character position within buffer() to a line and column.
Definition: Filter.cpp:189
Konsole::Filter::HotSpot::setType
void setType(Type type)
Sets the type of a hotspot.
Definition: Filter.cpp:288
Konsole::Filter::HotSpot::startLine
int startLine() const
Returns the line when the hotspot area starts.
Definition: Filter.cpp:268
Konsole::Filter::~Filter
virtual ~Filter()
Definition: Filter.cpp:170
Konsole::RegExpFilter::HotSpot::activate
virtual void activate(QObject *object=0)
Causes the action associated with a hotspot to be triggered.
Definition: Filter.cpp:303
Konsole::PlainTextDecoder::decodeLine
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
Konsole::Filter::HotSpot::endLine
int endLine() const
Returns the line where the hotspot area ends.
Definition: Filter.cpp:272
Filter.h
QTextStream
Konsole::Filter::buffer
const QString * buffer()
Returns the internal buffer.
Definition: Filter.cpp:216
QVector::value
T value(int i) const
Konsole::TerminalImageFilterChain::~TerminalImageFilterChain
virtual ~TerminalImageFilterChain()
Definition: Filter.cpp:112
QList::value
T value(int i) const
Konsole::PlainTextDecoder
A terminal character decoder which produces plain text, ignoring colors and other appearance-related ...
Definition: TerminalCharacterDecoder.h:72
QRegExp::matchedLength
int matchedLength() const
Konsole::Character
A single character in the terminal which consists of a unicode character value, foreground and backgr...
Definition: Character.h:77
QRegExp::indexIn
int indexIn(const QString &str, int offset, CaretMode caretMode) const
konsole_wcwidth.h
QRegExp
Konsole::RegExpFilter::newHotSpot
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
QApplication::activeWindow
QWidget * activeWindow()
QList::count
int count(const T &value) const
QList< Filter * >::append
void append(const T &value)
Konsole::Filter::HotSpot::Marker
Definition: Filter.h:86
QList< Filter * >::empty
bool empty() const
Konsole::PlainTextDecoder::setTrailingWhitespace
void setTrailingWhitespace(bool enable)
Set whether trailing whitespace at the end of lines should be included in the output.
Definition: TerminalCharacterDecoder.cpp:41
QApplication::clipboard
QClipboard * clipboard()
QObject
QRegExp::capturedTexts
QStringList capturedTexts() const
Konsole::FilterChain::addFilter
void addFilter(Filter *filter)
Adds a new filter to the chain.
Definition: Filter.cpp:51
QObject::setObjectName
void setObjectName(const QString &name)
QList< Filter * >::removeAll
int removeAll(const T &value)
Konsole::RegExpFilter::process
virtual void process()
Reimplemented to search the filter's text buffer for text matching regExp()
Definition: Filter.cpp:328
Konsole::UrlFilter::HotSpot::~HotSpot
virtual ~HotSpot()
Definition: Filter.cpp:447
Konsole::FilterObject
Definition: Filter.h:284
Konsole::Filter::setBuffer
void setBuffer(const QString *buffer, const QList< int > *linePositions)
TODO: Document me.
Definition: Filter.cpp:183
Konsole::Filter::hotSpotsAtLine
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
Konsole::TerminalImageFilterChain::TerminalImageFilterChain
TerminalImageFilterChain()
Definition: Filter.cpp:106
QMutableListIterator::remove
void remove()
Konsole::UrlFilter::HotSpot
Hotspot type created by UrlFilter instances.
Definition: Filter.h:246
QString
QList< int >
QStringList
Konsole::FilterChain::setBuffer
void setBuffer(const QString *buffer, const QList< int > *linePositions)
Sets the buffer for each filter in the chain to process.
Definition: Filter.cpp:65
Konsole::Filter::hotSpots
QList< HotSpot * > hotSpots() const
Returns the list of hotspots identified by the filter.
Definition: Filter.cpp:231
Konsole::RegExpFilter::setRegExp
void setRegExp(const QRegExp &text)
Sets the regular expression which the filter searches for in blocks of text.
Definition: Filter.cpp:316
Konsole::RegExpFilter
A filter which searches for sections of text matching a regular expression and creates a new RegExpFi...
Definition: Filter.h:182
QString::contains
bool contains(QChar ch, Qt::CaseSensitivity cs) const
Konsole::Filter::HotSpot::type
Type type() const
Returns the type of the hotspot.
Definition: Filter.cpp:284
QMutableListIterator::hasNext
bool hasNext() const
Konsole::Filter::HotSpot::actions
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
Konsole::RegExpFilter::RegExpFilter
RegExpFilter()
Constructs a new regular expression filter.
Definition: Filter.cpp:293
Konsole::FilterChain::clear
void clear()
Removes all filters from the chain.
Definition: Filter.cpp:77
Konsole::Filter
A filter processes blocks of text looking for certain patterns (such as URLs or keywords from a list)...
Definition: Filter.h:55
Konsole::UrlFilter::HotSpot::activate
virtual void activate(QObject *object=0)
Open a web browser at the current URL.
Definition: Filter.cpp:398
Konsole::PlainTextDecoder::begin
virtual void begin(QTextStream *output)
Begin decoding characters.
Definition: TerminalCharacterDecoder.cpp:49
TerminalCharacterDecoder.h
Konsole::LINE_DEFAULT
const int LINE_DEFAULT
Definition: Character.h:33
QVector< LineProperty >
QLatin1String
QMutableListIterator::next
T & next()
QMutableListIterator
Konsole::Filter::HotSpot::Link
Definition: Filter.h:84
QAction
Konsole::Filter::HotSpot::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: Filter.cpp:256
Konsole::RegExpFilter::HotSpot::HotSpot
HotSpot(int startLine, int startColumn, int endLine, int endColumn)
Definition: Filter.cpp:297
Konsole::RegExpFilter::regExp
QRegExp regExp() const
Returns the regular expression which the filter searches for in blocks of text.
Definition: Filter.cpp:320
QString::length
int length() const
Konsole::Filter::HotSpot::endColumn
int endColumn() const
Returns the column on endLine() where the hotspot area ends.
Definition: Filter.cpp:280
Konsole::TerminalImageFilterChain::setImage
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
Konsole::Filter::reset
void reset()
Empties the filters internal buffer and resets the line count back to 0.
Definition: Filter.cpp:177
QClipboard::setText
void setText(const QString &text, Mode mode)
QListIterator
Konsole::RegExpFilter::HotSpot
Type of hotspot created by RegExpFilter.
Definition: Filter.h:189
Konsole::RegExpFilter::HotSpot::capturedTexts
QStringList capturedTexts() const
Returns the texts found by the filter when matching the filter's regular expression.
Definition: Filter.cpp:311
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Konsole::UrlFilter::HotSpot::actions
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
QRegExp::exactMatch
bool exactMatch(const QString &str) const
Konsole::Filter::HotSpot::~HotSpot
virtual ~HotSpot()
Definition: Filter.cpp:220
Konsole::UrlFilter::HotSpot::HotSpot
HotSpot(int startLine, int startColumn, int endLine, int endColumn)
Definition: Filter.cpp:379
Konsole::Filter::HotSpot::startColumn
int startColumn() const
Returns the column on startLine() where the hotspot area starts.
Definition: Filter.cpp:276
string_width
int string_width(const QString &text)
Definition: konsole_wcwidth.cpp:217
Konsole::FilterChain::process
void process()
Processes each filter in the chain.
Definition: Filter.cpp:71
Konsole::FilterChain::hotSpots
QList< Filter::HotSpot * > hotSpots() const
Returns a list of all the hotspots in all the chain's filters.
Definition: Filter.cpp:95
QListIterator::hasNext
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

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal