//
//     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 View : QWidget, KXMLGUIClient
{
%TypeHeaderCode
#include <ktexteditor/view.h>

#include <ktexteditor/codecompletioninterface.h>
#include <ktexteditor/sessionconfiginterface.h>
#include <ktexteditor/texthintinterface.h>
%End


public:
                         View (QWidget* /TransferThis/);

public:
    virtual KTextEditor::Document* document () const = 0;
    bool                 isActiveView () const;

public:
    virtual QString      viewMode () const = 0;

    enum EditMode
    {
        EditInsert, 
        EditOverwrite
    };

    virtual KTextEditor::View::EditMode viewEditMode () const = 0;

signals:
    void                 focusIn (KTextEditor::View*);
    void                 focusOut (KTextEditor::View*);
    void                 viewModeChanged (KTextEditor::View*);
    void                 viewEditModeChanged (KTextEditor::View*, KTextEditor::View::EditMode);
    void                 informationMessage (KTextEditor::View*, const QString&);
    void                 textInserted (KTextEditor::View*, const KTextEditor::Cursor&, const QString&);

public:
    virtual void         setContextMenu (QMenu*)  = 0;
    virtual QMenu*       contextMenu () const = 0;
    virtual QMenu*       defaultContextMenu (QMenu* = 0) const = 0;

signals:
    void                 contextMenuAboutToShow (KTextEditor::View*, QMenu*);

public:
    virtual bool         setCursorPosition (KTextEditor::Cursor)  = 0;
    virtual KTextEditor::Cursor cursorPosition () const = 0;
    virtual KTextEditor::Cursor cursorPositionVirtual () const = 0;
    virtual QPoint       cursorToCoordinate (const KTextEditor::Cursor&) const = 0;
    virtual QPoint       cursorPositionCoordinates () const = 0;

signals:
    void                 cursorPositionChanged (KTextEditor::View*, const KTextEditor::Cursor&);
    void                 verticalScrollPositionChanged (KTextEditor::View*, const KTextEditor::Cursor&);
    void                 horizontalScrollPositionChanged (KTextEditor::View*);

public:
    virtual bool         mouseTrackingEnabled () const = 0;
    virtual bool         setMouseTrackingEnabled (bool)  = 0;

signals:
    void                 mousePositionChanged (KTextEditor::View*, const KTextEditor::Cursor&);

public:
    virtual bool         setSelection (const KTextEditor::Range&)  = 0;
    virtual bool         setSelection (const KTextEditor::Cursor&, int, bool = 1);
    virtual bool         selection () const = 0;
    virtual const KTextEditor::Range& selectionRange () const = 0;
    virtual QString      selectionText () const = 0;
    virtual bool         removeSelection ()  = 0;
    virtual bool         removeSelectionText ()  = 0;

public:
    virtual bool         setBlockSelection (bool)  = 0;
    virtual bool         blockSelection () const = 0;

signals:
    void                 selectionChanged (KTextEditor::View*);

public:
    virtual bool         insertText (const QString&);
    
    
    KTextEditor::CodeCompletionInterface *codeCompletionInterface();
%MethodCode
    Py_BEGIN_ALLOW_THREADS
    sipRes = dynamic_cast<KTextEditor::CodeCompletionInterface*>(sipCpp);
    Py_END_ALLOW_THREADS
%End
    
    KTextEditor::SessionConfigInterface *sessionConfigInterface();
%MethodCode
    Py_BEGIN_ALLOW_THREADS
    sipRes = dynamic_cast<KTextEditor::SessionConfigInterface*>(sipCpp);
    Py_END_ALLOW_THREADS
%End
    
    KTextEditor::TextHintInterface *textHintInterface();
%MethodCode
    Py_BEGIN_ALLOW_THREADS
    sipRes = dynamic_cast<KTextEditor::TextHintInterface*>(sipCpp);
    Py_END_ALLOW_THREADS
%End

};  // class View

};  // namespace KTextEditor

