//
//     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

