// Copyright 2011 Simon Edwards <simon@simonzone.com>

//                 Generated by twine2

// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
// (at your option) any later version.

// This program 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 Library General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

namespace KTextEditor
{
class MovingRange /Abstract/
{
%TypeHeaderCode
#include <ktexteditor/movingrange.h>
%End

public:
    enum InsertBehavior
    {
        DoNotExpand,
        ExpandLeft,
        ExpandRight
    };
    typedef QFlags<KTextEditor::MovingRange::InsertBehavior> InsertBehaviors;
    enum EmptyBehavior
    {
        AllowEmpty,
        InvalidateIfEmpty
    };
    virtual void            setInsertBehaviors (KTextEditor::MovingRange::InsertBehaviors insertBehaviors)=0;
    virtual KTextEditor::MovingRange::InsertBehaviors  insertBehaviors () const=0;
    virtual void            setEmptyBehavior (KTextEditor::MovingRange::EmptyBehavior emptyBehavior)=0;
    virtual KTextEditor::MovingRange::EmptyBehavior  emptyBehavior () const=0;
    virtual KTextEditor::Document*  document () const=0;
    virtual void            setRange (const KTextEditor::Range& range)=0;

//ig    virtual const KTextEditor::MovingCursor&  start () const=0;
//force
    KTextEditor::MovingCursor*  start ();
%MethodCode
    // Returning a ref of this class is problematic.
    const KTextEditor::MovingCursor& cursor = sipCpp->start();
    sipRes = const_cast<KTextEditor::MovingCursor *>(&cursor);
%End

//end
//ig    virtual const KTextEditor::MovingCursor&  end () const=0;
//force
    KTextEditor::MovingCursor*  end ();
%MethodCode
    // Returning a ref of this class is problematic.
    const KTextEditor::MovingCursor& cursor = sipCpp->end();
    sipRes = const_cast<KTextEditor::MovingCursor *>(&cursor);
%End
//end
    virtual KTextEditor::View*  view () const=0;
    virtual void            setView (KTextEditor::View* view)=0;
    virtual KTextEditor::Attribute::Ptr  attribute () const=0;
    virtual void            setAttribute (KTextEditor::Attribute::Ptr attribute)=0;
    virtual bool            attributeOnlyForViews () const=0;
    virtual void            setAttributeOnlyForViews (bool onlyForViews)=0;
    virtual KTextEditor::MovingRangeFeedback*  feedback () const=0;
    virtual void            setFeedback (KTextEditor::MovingRangeFeedback* feedback)=0;
    virtual qreal           zDepth () const=0;
    virtual void            setZDepth (qreal zDepth)=0;
    virtual ~MovingRange ();
protected:
                            MovingRange ();
private:
                            MovingRange (const KTextEditor::MovingRange&);
public:
    void                    setRange (const KTextEditor::Cursor& start, const KTextEditor::Cursor& end);
    const KTextEditor::Range  toRange () const;
//ig    const Range             operator const Range () const;
//ig    QDebug                  operator << (QDebug s, const KTextEditor::MovingRange* range);
//ig    QDebug                  operator << (QDebug s, const KTextEditor::MovingRange& range);
    bool                    isEmpty () const;
    bool                    contains (const KTextEditor::Range& range) const;
    bool                    contains (const KTextEditor::Cursor& cursor) const;
    bool                    containsLine (int line) const;
    bool                    containsColumn (int column) const;
    bool                    overlaps (const KTextEditor::Range& range) const;
    bool                    overlapsLine (int line) const;
    bool                    overlapsColumn (int column) const;
    bool                    onSingleLine () const;
};
};
