// qplaintextedit.sip generated by MetaSIP on Fri Apr 16 11:32:08 2010
//
// This file is part of the QtGui Python extension module.
//
// Copyright (c) 2010 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt.
// 
// This file may be used under the terms of the GNU General Public
// License versions 2.0 or 3.0 as published by the Free Software
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
// included in the packaging of this file.  Alternatively you may (at
// your option) use any later version of the GNU General Public
// License if such license has been publicly approved by Riverbank
// Computing Limited (or its successors, if any) and the KDE Free Qt
// Foundation. In addition, as a special exception, Riverbank gives you
// certain additional rights. These rights are described in the Riverbank
// GPL Exception version 1.1, which can be found in the file
// GPL_EXCEPTION.txt in this package.
// 
// Please review the following information to ensure GNU General
// Public Licensing requirements will be met:
// http://trolltech.com/products/qt/licenses/licensing/opensource/. If
// you are unsure which license is appropriate for your use, please
// review the following information:
// http://trolltech.com/products/qt/licenses/licensing/licensingoverview
// or contact the sales department at sales@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


%If (Qt_4_4_0 -)

class QPlainTextEdit : QAbstractScrollArea
{

%TypeHeaderCode
#include <qplaintextedit.h>
%End

public:
    enum LineWrapMode
    {
        NoWrap,
        WidgetWidth,
    };

    explicit QPlainTextEdit(QWidget *parent /TransferThis/ = 0);
    QPlainTextEdit(const QString &, QWidget *parent /TransferThis/ = 0);
    virtual ~QPlainTextEdit();
    void setDocument(QTextDocument *);
    QTextDocument *document() const;
    void setTextCursor(const QTextCursor &);
    QTextCursor textCursor() const;
    bool isReadOnly() const;
    void setReadOnly(bool);
    void setTextInteractionFlags(Qt::TextInteractionFlags);
    Qt::TextInteractionFlags textInteractionFlags() const;
    void mergeCurrentCharFormat(const QTextCharFormat &);
    void setCurrentCharFormat(const QTextCharFormat &);
    QTextCharFormat currentCharFormat() const;
    bool tabChangesFocus() const;
    void setTabChangesFocus(bool);
    void setDocumentTitle(const QString &);
    QString documentTitle() const;
    bool isUndoRedoEnabled() const;
    void setUndoRedoEnabled(bool);
    void setMaximumBlockCount(int);
    int maximumBlockCount() const;
    QPlainTextEdit::LineWrapMode lineWrapMode() const;
    void setLineWrapMode(QPlainTextEdit::LineWrapMode);
    QTextOption::WrapMode wordWrapMode() const;
    void setWordWrapMode(QTextOption::WrapMode);
    void setBackgroundVisible(bool);
    bool backgroundVisible() const;
    void setCenterOnScroll(bool);
    bool centerOnScroll() const;
    bool find(const QString &, QFlags<QTextDocument::FindFlag> options = 0);
    QString toPlainText() const;
    void ensureCursorVisible();
    virtual QVariant loadResource(int, const QUrl &);
    QMenu *createStandardContextMenu() /Factory/;
    QTextCursor cursorForPosition(const QPoint &) const;
    QRect cursorRect(const QTextCursor &) const;
    QRect cursorRect() const;
    bool overwriteMode() const;
    void setOverwriteMode(bool);
    int tabStopWidth() const;
    void setTabStopWidth(int);
    int cursorWidth() const;
    void setCursorWidth(int);
    void setExtraSelections(const QList<QTextEdit::ExtraSelection> &);
    QList<QTextEdit::ExtraSelection> extraSelections() const;
    void moveCursor(QTextCursor::MoveOperation, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor);
    bool canPaste() const;
%If (PyQt_Printer)
    void print(QPrinter *) const /PyName=print_/;
%End
%If (Py_v3 || PyQt_Printer)
    void print(QPrinter *printer) const;
%End
    int blockCount() const;

public slots:
    void setPlainText(const QString &);
    void cut();
    void copy();
    void paste();
    void undo();
    void redo();
    void clear();
    void selectAll();
    void insertPlainText(const QString &);
    void appendPlainText(const QString &);
    void appendHtml(const QString &);
    void centerCursor();

signals:
    void textChanged();
    void undoAvailable(bool);
    void redoAvailable(bool);
    void copyAvailable(bool);
    void selectionChanged();
    void cursorPositionChanged();
    void updateRequest(const QRect &, int);
    void blockCountChanged(int);
    void modificationChanged(bool);

protected:
    virtual bool event(QEvent *);
    virtual void timerEvent(QTimerEvent *);
    virtual void keyPressEvent(QKeyEvent *);
    virtual void keyReleaseEvent(QKeyEvent *);
    virtual void resizeEvent(QResizeEvent *);
    virtual void paintEvent(QPaintEvent *);
    virtual void mousePressEvent(QMouseEvent *);
    virtual void mouseMoveEvent(QMouseEvent *);
    virtual void mouseReleaseEvent(QMouseEvent *);
    virtual void mouseDoubleClickEvent(QMouseEvent *);
    virtual bool focusNextPrevChild(bool);
    virtual void contextMenuEvent(QContextMenuEvent *);
    virtual void dragEnterEvent(QDragEnterEvent *);
    virtual void dragLeaveEvent(QDragLeaveEvent *);
    virtual void dragMoveEvent(QDragMoveEvent *);
    virtual void dropEvent(QDropEvent *);
    virtual void focusInEvent(QFocusEvent *);
    virtual void focusOutEvent(QFocusEvent *);
    virtual void showEvent(QShowEvent *);
    virtual void changeEvent(QEvent *);
    virtual void wheelEvent(QWheelEvent *);
    virtual void inputMethodEvent(QInputMethodEvent *);
    virtual QVariant inputMethodQuery(Qt::InputMethodQuery) const;
    virtual QMimeData *createMimeDataFromSelection() const /Factory/;
    virtual bool canInsertFromMimeData(const QMimeData *) const;
    virtual void insertFromMimeData(const QMimeData *);
    virtual void scrollContentsBy(int, int);
    QTextBlock firstVisibleBlock() const;
    QPointF contentOffset() const;
    QRectF blockBoundingRect(const QTextBlock &) const;
    QRectF blockBoundingGeometry(const QTextBlock &) const;
    QAbstractTextDocumentLayout::PaintContext getPaintContext() const;

private:
    QPlainTextEdit(const QPlainTextEdit &);
};

%End
%If (Qt_4_4_0 -)

class QPlainTextDocumentLayout : QAbstractTextDocumentLayout
{

%TypeHeaderCode
#include <qplaintextedit.h>
%End

public:
    QPlainTextDocumentLayout(QTextDocument *);
    virtual ~QPlainTextDocumentLayout();
    virtual void draw(QPainter *, const QAbstractTextDocumentLayout::PaintContext &);
    virtual int hitTest(const QPointF &, Qt::HitTestAccuracy) const;
    virtual int pageCount() const;
    virtual QSizeF documentSize() const;
    virtual QRectF frameBoundingRect(QTextFrame *) const;
    virtual QRectF blockBoundingRect(const QTextBlock &) const;
    void ensureBlockLayout(const QTextBlock &) const;
    void setCursorWidth(int);
    int cursorWidth() const;
    void requestUpdate();

protected:
    virtual void documentChanged(int, int, int);
};

%End
