2
// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
3
// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
7
// PyKDE4 module ktexteditor version KDE 3.92.0
10
// This file is part of PyKDE4.
12
// PyKDE4 is free software; you can redistribute it and/or modify
13
// it under the terms of the GNU Lesser General Public License as
14
// published by the Free Software Foundation; either version 2.1 of
15
// the License, or (at your option) any later version.
17
// PyKDE4 is distributed in the hope that it will be useful,
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
// GNU General Public License for more details.
22
// You should have received a copy of the GNU General Public License
23
// along with this program. If not, see <http://www.gnu.org/licenses/>.
28
class SmartRange : KTextEditor::Range
31
#include <smartrange.h>
44
typedef QFlags<KTextEditor::SmartRange::InsertBehavior> InsertBehaviors;
45
virtual bool isSmartRange () const;
46
virtual KTextEditor::SmartRange* toSmartRange () const;
47
virtual void setRange (const KTextEditor::Range&);
48
KTextEditor::SmartCursor& smartStart ();
49
KTextEditor::SmartCursor& smartEnd ();
50
virtual bool confineToRange (const KTextEditor::Range&);
51
virtual bool expandToRange (const KTextEditor::Range&);
52
KTextEditor::Document* document () const;
53
virtual QStringList text (bool = 0) const;
54
virtual bool replaceText (const QStringList&, bool = 0);
55
virtual bool removeText (bool = 0);
56
KTextEditor::SmartRange::InsertBehaviors insertBehavior () const;
57
void setInsertBehavior (KTextEditor::SmartRange::InsertBehaviors);
58
KTextEditor::SmartRange* parentRange () const;
59
virtual void setParentRange (KTextEditor::SmartRange*);
60
bool hasParent (KTextEditor::SmartRange*) const;
62
KTextEditor::SmartRange* topParentRange () const;
63
const QList<KTextEditor::SmartRange*>& childRanges () const;
64
void clearChildRanges ();
65
void deleteChildRanges ();
66
void clearAndDeleteChildRanges ();
67
KTextEditor::SmartRange* childBefore (const KTextEditor::SmartRange*) const;
68
KTextEditor::SmartRange* childAfter (const KTextEditor::SmartRange*) const;
69
KTextEditor::SmartRange* mostSpecificRange (const KTextEditor::Range&) const;
70
KTextEditor::SmartRange* firstRangeContaining (const KTextEditor::Cursor&) const;
71
KTextEditor::SmartRange* deepestRangeContaining (const KTextEditor::Cursor&, QStack<KTextEditor::SmartRange*>* = 0, QStack<KTextEditor::SmartRange*>* = 0) const;
72
KTextEditor::Attribute::Ptr attribute () const;
73
void setAttribute (KTextEditor::Attribute::Ptr);
74
void associateAction (KAction*);
75
void dissociateAction (KAction*);
76
const QList<KAction*>& associatedActions () const;
77
void clearAssociatedActions ();
78
KTextEditor::SmartRangeNotifier* primaryNotifier ();
79
const QList<KTextEditor::SmartRangeNotifier*> notifiers () const;
80
void addNotifier (KTextEditor::SmartRangeNotifier*);
81
void removeNotifier (KTextEditor::SmartRangeNotifier*);
82
void deletePrimaryNotifier ();
83
const QList<KTextEditor::SmartRangeWatcher*>& watchers () const;
84
void addWatcher (KTextEditor::SmartRangeWatcher*);
85
void removeWatcher (KTextEditor::SmartRangeWatcher*);
88
SmartRange (KTextEditor::SmartCursor*, KTextEditor::SmartCursor*, KTextEditor::SmartRange* = 0, KTextEditor::SmartRange::InsertBehaviors = KTextEditor::SmartRange::DoNotExpand );
89
virtual void rangeChanged (KTextEditor::Cursor*, const KTextEditor::Range&);
90
virtual void checkFeedback ();
91
virtual KTextEditor::SmartRangeNotifier* createNotifier () = 0;
94
SmartRange (const KTextEditor::SmartRange&);
96
}; // class SmartRange
98
}; // namespace KTextEditor