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