• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

  • kate
  • part
katesupercursor.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #include "katesupercursor.h"
20 #include "katesupercursor.moc"
21 
22 #include "katedocument.h"
23 
24 #include <kdebug.h>
25 
26 #include <tqobjectlist.h>
27 
28 KateSuperCursor::KateSuperCursor(KateDocument* doc, bool privateC, const KateTextCursor& cursor, TQObject* parent, const char* name)
29  : TQObject(parent, name)
30  , KateDocCursor(cursor.line(), cursor.col(), doc)
31  , Kate::Cursor ()
32  , m_doc (doc)
33 {
34  m_moveOnInsert = false;
35  m_lineRemoved = false;
36  m_privateCursor = privateC;
37 
38  m_doc->addSuperCursor (this, privateC);
39 }
40 
41 KateSuperCursor::KateSuperCursor(KateDocument* doc, bool privateC, int lineNum, int col, TQObject* parent, const char* name)
42  : TQObject(parent, name)
43  , KateDocCursor(lineNum, col, doc)
44  , Kate::Cursor ()
45  , m_doc (doc)
46 {
47  m_moveOnInsert = false;
48  m_lineRemoved = false;
49  m_privateCursor = privateC;
50 
51  m_doc->addSuperCursor (this, privateC);
52 }
53 
54 KateSuperCursor::~KateSuperCursor ()
55 {
56  m_doc->removeSuperCursor (this, m_privateCursor);
57 }
58 
59 void KateSuperCursor::position(uint *pline, uint *pcol) const
60 {
61  KateDocCursor::position(pline, pcol);
62 }
63 
64 bool KateSuperCursor::setPosition(uint line, uint col)
65 {
66  if (line == uint(-2) && col == uint(-2)) { delete this; return true; }
67  return KateDocCursor::setPosition(line, col);
68 }
69 
70 bool KateSuperCursor::insertText(const TQString& s)
71 {
72  return KateDocCursor::insertText(s);
73 }
74 
75 bool KateSuperCursor::removeText(uint nbChar)
76 {
77  return KateDocCursor::removeText(nbChar);
78 }
79 
80 TQChar KateSuperCursor::currentChar() const
81 {
82  return KateDocCursor::currentChar();
83 }
84 
85 bool KateSuperCursor::atStartOfLine() const
86 {
87  return col() == 0;
88 }
89 
90 bool KateSuperCursor::atEndOfLine() const
91 {
92  return col() >= (int)m_doc->kateTextLine(line())->length();
93 }
94 
95 bool KateSuperCursor::moveOnInsert() const
96 {
97  return m_moveOnInsert;
98 }
99 
100 void KateSuperCursor::setMoveOnInsert(bool moveOnInsert)
101 {
102  m_moveOnInsert = moveOnInsert;
103 }
104 
105 void KateSuperCursor::setLine(int lineNum)
106 {
107  int tempLine = line(), tempcol = col();
108  KateDocCursor::setLine(lineNum);
109 
110  if (tempLine != line() || tempcol != col())
111  emit positionDirectlyChanged();
112 }
113 
114 void KateSuperCursor::setCol(int colNum)
115 {
116  KateDocCursor::setCol(colNum);
117 }
118 
119 void KateSuperCursor::setPos(const KateTextCursor& pos)
120 {
121  KateDocCursor::setPos(pos);
122 }
123 
124 void KateSuperCursor::setPos(int lineNum, int colNum)
125 {
126  KateDocCursor::setPos(lineNum, colNum);
127 }
128 
129 void KateSuperCursor::editTextInserted(uint line, uint col, uint len)
130 {
131  if (m_line == int(line))
132  {
133  if ((m_col > int(col)) || (m_moveOnInsert && (m_col == int(col))))
134  {
135  bool insertedAt = m_col == int(col);
136 
137  m_col += len;
138 
139  if (insertedAt)
140  emit charInsertedAt();
141 
142  emit positionChanged();
143  return;
144  }
145  }
146 
147  emit positionUnChanged();
148 }
149 
150 void KateSuperCursor::editTextRemoved(uint line, uint col, uint len)
151 {
152  if (m_line == int(line))
153  {
154  if (m_col > int(col))
155  {
156  if (m_col > int(col + len))
157  {
158  m_col -= len;
159  }
160  else
161  {
162  bool prevCharDeleted = m_col == int(col + len);
163 
164  m_col = col;
165 
166  if (prevCharDeleted)
167  emit charDeletedBefore();
168  else
169  emit positionDeleted();
170  }
171 
172  emit positionChanged();
173  return;
174 
175  }
176  else if (m_col == int(col))
177  {
178  emit charDeletedAfter();
179  }
180  }
181 
182  emit positionUnChanged();
183 }
184 
185 void KateSuperCursor::editLineWrapped(uint line, uint col, bool newLine)
186 {
187  if (newLine)
188  {
189  if (m_line > int(line) || (m_line == int(line) && m_col >= int(col)))
190  {
191  if(m_line == int(line))
192  m_col -= col;
193  m_line++;
194 
195  emit positionChanged();
196  return;
197  }
198  }
199  else if ( (m_line == int(line)) && (m_col > int(col)) || (m_moveOnInsert && (m_col == int(col))) )
200  {
201  m_line++;
202  m_col -= col;
203 
204  emit positionChanged();
205  return;
206  }
207 
208  emit positionUnChanged();
209 }
210 
211 void KateSuperCursor::editLineUnWrapped(uint line, uint col, bool removeLine, uint length)
212 {
213  if (removeLine && (m_line > int(line+1)))
214  {
215  m_line--;
216 
217  emit positionChanged();
218  return;
219  }
220  else if ( (m_line == int(line+1)) && (removeLine || (m_col < int(length))) )
221  {
222  m_line = line;
223  m_col += col;
224 
225  emit positionChanged();
226  return;
227  }
228  else if ( (m_line == int(line+1)) && (m_col >= int(length)) )
229  {
230  m_col -= length;
231 
232  emit positionChanged();
233  return;
234  }
235 
236  emit positionUnChanged();
237 }
238 
239 void KateSuperCursor::editLineInserted (uint line)
240 {
241  if (m_line >= int(line))
242  {
243  m_line++;
244 
245  emit positionChanged();
246  return;
247  }
248 
249  emit positionUnChanged();
250 }
251 
252 void KateSuperCursor::editLineRemoved(uint line)
253 {
254  if (m_line > int(line))
255  {
256  m_line--;
257 
258  emit positionChanged();
259  return;
260  }
261  else if (m_line == int(line))
262  {
263  m_line = (line <= m_doc->lastLine()) ? line : (line - 1);
264  m_col = 0;
265 
266  emit positionDeleted();
267 
268  emit positionChanged();
269  return;
270  }
271 
272  emit positionUnChanged();
273 }
274 
275 KateSuperCursor::operator TQString()
276 {
277  return TQString("[%1,%1]").arg(line()).arg(col());
278 }
279 
280 KateSuperRange::KateSuperRange(KateSuperCursor* start, KateSuperCursor* end, TQObject* parent, const char* name)
281  : TQObject(parent, name)
282  , m_start(start)
283  , m_end(end)
284  , m_evaluate(false)
285  , m_startChanged(false)
286  , m_endChanged(false)
287  , m_deleteCursors(false)
288  , m_allowZeroLength(false)
289 {
290  init();
291 }
292 
293 KateSuperRange::KateSuperRange(KateDocument* doc, const KateRange& range, TQObject* parent, const char* name)
294  : TQObject(parent, name)
295  , m_start(new KateSuperCursor(doc, true, range.start()))
296  , m_end(new KateSuperCursor(doc, true, range.end()))
297  , m_evaluate(false)
298  , m_startChanged(false)
299  , m_endChanged(false)
300  , m_deleteCursors(true)
301  , m_allowZeroLength(false)
302 {
303  init();
304 }
305 
306 KateSuperRange::KateSuperRange(KateDocument* doc, const KateTextCursor& start, const KateTextCursor& end, TQObject* parent, const char* name)
307  : TQObject(parent, name)
308  , m_start(new KateSuperCursor(doc, true, start))
309  , m_end(new KateSuperCursor(doc, true, end))
310  , m_evaluate(false)
311  , m_startChanged(false)
312  , m_endChanged(false)
313  , m_deleteCursors(true)
314  , m_allowZeroLength(false)
315 {
316  init();
317 }
318 
319 void KateSuperRange::init()
320 {
321  Q_ASSERT(isValid());
322  if (!isValid())
323  kdDebug(13020) << superStart() << " " << superEnd() << endl;
324 
325  insertChild(m_start);
326  insertChild(m_end);
327 
328  setBehaviour(DoNotExpand);
329 
330  // Not necessarily the best implementation
331  connect(m_start, TQT_SIGNAL(positionDirectlyChanged()), TQT_SIGNAL(contentsChanged()));
332  connect(m_end, TQT_SIGNAL(positionDirectlyChanged()), TQT_SIGNAL(contentsChanged()));
333 
334  connect(m_start, TQT_SIGNAL(positionChanged()), TQT_SLOT(slotEvaluateChanged()));
335  connect(m_end, TQT_SIGNAL(positionChanged()), TQT_SLOT(slotEvaluateChanged()));
336  connect(m_start, TQT_SIGNAL(positionUnChanged()), TQT_SLOT(slotEvaluateUnChanged()));
337  connect(m_end, TQT_SIGNAL(positionUnChanged()), TQT_SLOT(slotEvaluateUnChanged()));
338  connect(m_start, TQT_SIGNAL(positionDeleted()), TQT_SIGNAL(boundaryDeleted()));
339  connect(m_end, TQT_SIGNAL(positionDeleted()), TQT_SIGNAL(boundaryDeleted()));
340 }
341 
342 KateSuperRange::~KateSuperRange()
343 {
344  if (m_deleteCursors)
345  {
346  //insertChild(m_start);
347  //insertChild(m_end);
348  delete m_start;
349  delete m_end;
350  }
351 }
352 
353 KateTextCursor& KateSuperRange::start()
354 {
355  return *m_start;
356 }
357 
358 const KateTextCursor& KateSuperRange::start() const
359 {
360  return *m_start;
361 }
362 
363 KateTextCursor& KateSuperRange::end()
364 {
365  return *m_end;
366 }
367 
368 const KateTextCursor& KateSuperRange::end() const
369 {
370  return *m_end;
371 }
372 
373 KateSuperCursor& KateSuperRange::superStart()
374 {
375  return *m_start;
376 }
377 
378 const KateSuperCursor& KateSuperRange::superStart() const
379 {
380  return *m_start;
381 }
382 
383 KateSuperCursor& KateSuperRange::superEnd()
384 {
385  return *m_end;
386 }
387 
388 const KateSuperCursor& KateSuperRange::superEnd() const
389 {
390  return *m_end;
391 }
392 
393 int KateSuperRange::behaviour() const
394 {
395  return (m_start->moveOnInsert() ? DoNotExpand : ExpandLeft) | (m_end->moveOnInsert() ? ExpandRight : DoNotExpand);
396 }
397 
398 void KateSuperRange::setBehaviour(int behaviour)
399 {
400  m_start->setMoveOnInsert(behaviour & ExpandLeft);
401  m_end->setMoveOnInsert(!(behaviour & ExpandRight));
402 }
403 
404 bool KateSuperRange::isValid() const
405 {
406  return superStart() <= superEnd();
407 }
408 
409 bool KateSuperRange::owns(const KateTextCursor& cursor) const
410 {
411  if (!includes(cursor)) return false;
412 
413  if (!childrenListObject().isEmpty())
414  for (TQObjectListIt it(childrenListObject()); *it; ++it)
415  if ((*it)->inherits("KateSuperRange"))
416  if (static_cast<KateSuperRange*>(*it)->owns(cursor))
417  return false;
418 
419  return true;
420 }
421 
422 bool KateSuperRange::includes(const KateTextCursor& cursor) const
423 {
424  return isValid() && cursor >= superStart() && cursor < superEnd();
425 }
426 
427 bool KateSuperRange::includes(uint lineNum) const
428 {
429  return isValid() && (int)lineNum >= superStart().line() && (int)lineNum <= superEnd().line();
430 }
431 
432 bool KateSuperRange::includesWholeLine(uint lineNum) const
433 {
434  return isValid() && ((int)lineNum > superStart().line() || ((int)lineNum == superStart().line() && superStart().atStartOfLine())) && ((int)lineNum < superEnd().line() || ((int)lineNum == superEnd().line() && superEnd().atEndOfLine()));
435 }
436 
437 bool KateSuperRange::boundaryAt(const KateTextCursor& cursor) const
438 {
439  return isValid() && (cursor == superStart() || cursor == superEnd());
440 }
441 
442 bool KateSuperRange::boundaryOn(uint lineNum) const
443 {
444  return isValid() && (superStart().line() == (int)lineNum || superEnd().line() == (int)lineNum);
445 }
446 
447 void KateSuperRange::slotEvaluateChanged()
448 {
449  if (sender() == static_cast<TQObject*>(m_start)) {
450  if (m_evaluate) {
451  if (!m_endChanged) {
452  // Only one was changed
453  evaluateEliminated();
454 
455  } else {
456  // Both were changed
457  evaluatePositionChanged();
458  m_endChanged = false;
459  }
460 
461  } else {
462  m_startChanged = true;
463  }
464 
465  } else {
466  if (m_evaluate) {
467  if (!m_startChanged) {
468  // Only one was changed
469  evaluateEliminated();
470 
471  } else {
472  // Both were changed
473  evaluatePositionChanged();
474  m_startChanged = false;
475  }
476 
477  } else {
478  m_endChanged = true;
479  }
480  }
481 
482  m_evaluate = !m_evaluate;
483 }
484 
485 void KateSuperRange::slotEvaluateUnChanged()
486 {
487  if (sender() == static_cast<TQObject*>(m_start)) {
488  if (m_evaluate) {
489  if (m_endChanged) {
490  // Only one changed
491  evaluateEliminated();
492  m_endChanged = false;
493 
494  } else {
495  // Neither changed
496  emit positionUnChanged();
497  }
498  }
499 
500  } else {
501  if (m_evaluate) {
502  if (m_startChanged) {
503  // Only one changed
504  evaluateEliminated();
505  m_startChanged = false;
506 
507  } else {
508  // Neither changed
509  emit positionUnChanged();
510  }
511  }
512  }
513 
514  m_evaluate = !m_evaluate;
515 }
516 
517 void KateSuperRange::slotTagRange()
518 {
519  emit tagRange(this);
520 }
521 
522 void KateSuperRange::evaluateEliminated()
523 {
524  if (superStart() == superEnd()) {
525  if (!m_allowZeroLength) emit eliminated();
526  }
527  else
528  emit contentsChanged();
529 }
530 
531 void KateSuperRange::evaluatePositionChanged()
532 {
533  if (superStart() == superEnd())
534  emit eliminated();
535  else
536  emit positionChanged();
537 }
538 
539 int KateSuperCursorList::compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2)
540 {
541  if (*(static_cast<KateSuperCursor*>(item1)) == *(static_cast<KateSuperCursor*>(item2)))
542  return 0;
543 
544  return *(static_cast<KateSuperCursor*>(item1)) < *(static_cast<KateSuperCursor*>(item2)) ? -1 : 1;
545 }
546 
547 KateSuperRangeList::KateSuperRangeList(bool autoManage, TQObject* parent, const char* name)
548  : TQObject(parent, name)
549  , m_autoManage(autoManage)
550  , m_connect(true)
551  , m_trackingBoundaries(false)
552 {
553  setAutoManage(autoManage);
554 }
555 
556 KateSuperRangeList::KateSuperRangeList(const TQPtrList<KateSuperRange>& rangeList, TQObject* parent, const char* name)
557  : TQObject(parent, name)
558  , m_autoManage(false)
559  , m_connect(false)
560  , m_trackingBoundaries(false)
561 {
562  appendList(rangeList);
563 }
564 
565 void KateSuperRangeList::appendList(const TQPtrList<KateSuperRange>& rangeList)
566 {
567  for (TQPtrListIterator<KateSuperRange> it = rangeList; *it; ++it)
568  append(*it);
569 }
570 
571 void KateSuperRangeList::clear()
572 {
573  for (KateSuperRange* range = first(); range; range = next())
574  emit rangeEliminated(range);
575 
576  TQPtrList<KateSuperRange>::clear();
577 }
578 
579 void KateSuperRangeList::connectAll()
580 {
581  if (!m_connect) {
582  m_connect = true;
583  for (KateSuperRange* range = first(); range; range = next()) {
584  connect(range, TQT_SIGNAL(destroyed(TQObject*)), TQT_SLOT(slotDeleted(TQObject*)));
585  connect(range, TQT_SIGNAL(eliminated()), TQT_SLOT(slotEliminated()));
586  }
587  }
588 }
589 
590 bool KateSuperRangeList::autoManage() const
591 {
592  return m_autoManage;
593 }
594 
595 void KateSuperRangeList::setAutoManage(bool autoManage)
596 {
597  m_autoManage = autoManage;
598  setAutoDelete(m_autoManage);
599 }
600 
601 TQPtrList<KateSuperRange> KateSuperRangeList::rangesIncluding(const KateTextCursor& cursor)
602 {
603  sort();
604 
605  TQPtrList<KateSuperRange> ret;
606 
607  for (KateSuperRange* r = first(); r; r = next())
608  if (r->includes(cursor))
609  ret.append(r);
610 
611  return ret;
612 }
613 
614 TQPtrList<KateSuperRange> KateSuperRangeList::rangesIncluding(uint line)
615 {
616  sort();
617 
618  TQPtrList<KateSuperRange> ret;
619 
620  for (KateSuperRange* r = first(); r; r = next())
621  if (r->includes(line))
622  ret.append(r);
623 
624  return ret;
625 }
626 
627 bool KateSuperRangeList::rangesInclude(const KateTextCursor& cursor)
628 {
629  for (KateSuperRange* r = first(); r; r = next())
630  if (r->includes(cursor))
631  return true;
632 
633  return false;
634 }
635 
636 void KateSuperRangeList::slotEliminated()
637 {
638  if (sender()) {
639  KateSuperRange* range = static_cast<KateSuperRange*>(const_cast<TQObject*>(TQT_TQOBJECT_CONST(sender())));
640  emit rangeEliminated(range);
641 
642  if (m_trackingBoundaries) {
643  m_columnBoundaries.removeRef(range->m_start);
644  m_columnBoundaries.removeRef(range->m_end);
645  }
646 
647  if (m_autoManage)
648  removeRef(range);
649 
650  if (!count())
651  emit listEmpty();
652  }
653 }
654 
655 void KateSuperRangeList::slotDeleted(TQObject* range)
656 {
657  //kdDebug(13020)<<"KateSuperRangeList::slotDeleted"<<endl;
658  KateSuperRange* r = static_cast<KateSuperRange*>(range);
659 
660  if (m_trackingBoundaries) {
661  m_columnBoundaries.removeRef(r->m_start);
662  m_columnBoundaries.removeRef(r->m_end);
663  }
664 
665  int index = findRef(r);
666  if (index != -1)
667  take(index);
668  //else kdDebug(13020)<<"Range not found in list"<<endl;
669 
670  if (!count())
671  emit listEmpty();
672 }
673 
674 KateSuperCursor* KateSuperRangeList::firstBoundary(const KateTextCursor* start)
675 {
676  if (!m_trackingBoundaries) {
677  m_trackingBoundaries = true;
678 
679  for (KateSuperRange* r = first(); r; r = next()) {
680  m_columnBoundaries.append(&(r->superStart()));
681  m_columnBoundaries.append(&(r->superEnd()));
682  }
683  }
684 
685  m_columnBoundaries.sort();
686 
687  if (start)
688  // OPTIMISE: TQMap with TQPtrList for each line? (==> sorting issues :( )
689  for (KateSuperCursor* c = m_columnBoundaries.first(); c; c = m_columnBoundaries.next())
690  if (*start <= *c)
691  break;
692 
693  return m_columnBoundaries.current();
694 }
695 
696 KateSuperCursor* KateSuperRangeList::nextBoundary()
697 {
698  KateSuperCursor* current = m_columnBoundaries.current();
699 
700  // make sure the new cursor is after the current cursor; multiple cursors with the same position can be in the list.
701  if (current)
702  while (m_columnBoundaries.next())
703  if (*(m_columnBoundaries.current()) != *current)
704  break;
705 
706  return m_columnBoundaries.current();
707 }
708 
709 KateSuperCursor* KateSuperRangeList::currentBoundary()
710 {
711  return m_columnBoundaries.current();
712 }
713 
714 int KateSuperRangeList::compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2)
715 {
716  if (static_cast<KateSuperRange*>(item1)->superStart() == static_cast<KateSuperRange*>(item2)->superStart()) {
717  if (static_cast<KateSuperRange*>(item1)->superEnd() == static_cast<KateSuperRange*>(item2)->superEnd()) {
718  return 0;
719  } else {
720  return static_cast<KateSuperRange*>(item1)->superEnd() < static_cast<KateSuperRange*>(item2)->superEnd() ? -1 : 1;
721  }
722  }
723 
724  return static_cast<KateSuperRange*>(item1)->superStart() < static_cast<KateSuperRange*>(item2)->superStart() ? -1 : 1;
725 }
726 
727 TQPtrCollection::Item KateSuperRangeList::newItem(TQPtrCollection::Item d)
728 {
729  if (m_connect) {
730  connect(static_cast<KateSuperRange*>(d), TQT_SIGNAL(destroyed(TQObject*)), TQT_SLOT(slotDeleted(TQObject*)));
731  connect(static_cast<KateSuperRange*>(d), TQT_SIGNAL(eliminated()), TQT_SLOT(slotEliminated()));
732  connect(static_cast<KateSuperRange*>(d), TQT_SIGNAL(tagRange(KateSuperRange*)), TQT_SIGNAL(tagRange(KateSuperRange*)));
733 
734  // HACK HACK
735  static_cast<KateSuperRange*>(d)->slotTagRange();
736  }
737 
738  if (m_trackingBoundaries) {
739  m_columnBoundaries.append(&(static_cast<KateSuperRange*>(d)->superStart()));
740  m_columnBoundaries.append(&(static_cast<KateSuperRange*>(d)->superEnd()));
741  }
742 
743  return TQPtrList<KateSuperRange>::newItem(d);
744 }
KateTextCursor
Simple cursor class with no document pointer.
Definition: katecursor.h:33
KateDocCursor
Cursor class with a pointer to its document.
Definition: katecursor.h:92
TDEStdAccel::next
const TDEShortcut & next()
KateSuperRange
Represents a range of text, from the start() to the end().
Definition: katesupercursor.h:168
KateSuperCursor::moveOnInsert
bool moveOnInsert() const
Returns how this cursor behaves when text is inserted at the cursor.
Definition: katesupercursor.cpp:95
KateSuperCursor::KateSuperCursor
KateSuperCursor(KateDocument *doc, bool privateC, const KateTextCursor &cursor, TQObject *parent=0L, const char *name=0L)
bool privateC says: if private, than don't show to apps using the cursorinterface in the list...
Definition: katesupercursor.cpp:28
KateSuperRange::isValid
virtual bool isValid() const
Start and end must be valid and start <= end.
Definition: katesupercursor.cpp:404
KateSuperRange::ExpandRight
Expand to encapsulate new characters to the right of the range.
Definition: katesupercursor.h:182
KateSuperRange::behaviour
int behaviour() const
Returns how this range reacts to characters inserted immediately outside the range.
Definition: katesupercursor.cpp:393
kdDebug
kdbgstream kdDebug(int area=0)
KateSuperCursor::charDeletedBefore
void charDeletedBefore()
The character immediately before the cursor was deleted.
KateSuperRange::includes
bool includes(const KateTextCursor &cursor) const
Returns true if the range includes cursor 's character.
Definition: katesupercursor.cpp:422
KateSuperRange::boundaryAt
bool boundaryAt(const KateTextCursor &cursor) const
Returns whether cursor is the site of a boundary of this range.
Definition: katesupercursor.cpp:437
KateSuperRange::DoNotExpand
Don't expand to encapsulate new characters in either direction. This is the default.
Definition: katesupercursor.h:178
KateSuperRange::boundaryOn
bool boundaryOn(uint lineNum) const
Returns whether there is a boundary of this range on line.
Definition: katesupercursor.cpp:442
KateSuperRange::boundaryDeleted
void boundaryDeleted()
Either cursor's surrounding characters were both deleted.
KateSuperCursor::positionUnChanged
void positionUnChanged()
Athough an edit took place, the cursor's position was unchanged.
KateSuperCursor::positionChanged
void positionChanged()
The cursor's position was changed.
KateSuperRange::contentsChanged
void contentsChanged()
The contents of the range changed.
KateSuperCursor::atEndOfLine
bool atEndOfLine() const
Definition: katesupercursor.cpp:90
KateSuperCursor::atStartOfLine
bool atStartOfLine() const
Definition: katesupercursor.cpp:85
KateSuperRange::superEnd
KateSuperCursor & superEnd()
Returns the super end cursor.
Definition: katesupercursor.cpp:383
KateSuperRange::positionUnChanged
void positionUnChanged()
The range's position was unchanged.
KateSuperCursor::positionDirectlyChanged
void positionDirectlyChanged()
The cursor's position was directly changed by the program.
KateSuperCursor::charDeletedAfter
void charDeletedAfter()
The character immediately after the cursor was deleted.
KateSuperRange::positionChanged
void positionChanged()
More interesting signals that aren't worth implementing here: firstCharDeleted: start()::charDeleted(...
KateSuperRange::owns
bool owns(const KateTextCursor &cursor) const
This is for use where the ranges are used in a heirachy, ie.
Definition: katesupercursor.cpp:409
KateSuperCursor
Possible additional features:
Definition: katesupercursor.h:45
KateSuperCursor::charInsertedAt
void charInsertedAt()
A character was inserted immediately before the cursor.
KateSuperRange::ExpandLeft
Expand to encapsulate new characters to the left of the range.
Definition: katesupercursor.h:180
KateSuperRange::includesWholeLine
bool includesWholeLine(uint lineNum) const
Returns true if the range totally encompasses line.
Definition: katesupercursor.cpp:432
KateSuperCursor::positionDeleted
void positionDeleted()
The cursor's surrounding characters were both deleted simultaneously.
endl
kndbgstream & endl(kndbgstream &s)
KateSuperRange::superStart
KateSuperCursor & superStart()
Returns the super start cursor.
Definition: katesupercursor.cpp:373
Kate
Kate namespace All classes in this namespace must stay BC during one major release series (e...
Definition: document.h:50
KateSuperRange::tagRange
void tagRange(KateSuperRange *range)
Indicates the region needs re-drawing.
KateSuperCursor::setMoveOnInsert
void setMoveOnInsert(bool moveOnInsert)
Change the behavior of the cursor when text is inserted at the cursor.
Definition: katesupercursor.cpp:100
KateSuperRange::KateSuperRange
KateSuperRange(KateSuperCursor *start, KateSuperCursor *end, TQObject *parent=0L, const char *name=0L)
Constructor.
Definition: katesupercursor.cpp:280
KateSuperRange::eliminated
void eliminated()
The range now contains no characters (ie.
KateSuperRange::setBehaviour
void setBehaviour(int behaviour)
Determine how the range should react to characters inserted immediately outside the range...
Definition: katesupercursor.cpp:398

kate

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

kate

Skip menu "kate"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.8.8
This website is maintained by Timothy Pearson.