// qtextlayout.sip generated by MetaSIP on Fri Sep 28 17:07:47 2007 // // This file is part of the QtGui Python extension module. // // Copyright (c) 2007 // Phil Thompson // // This file is part of PyQt. // // This copy of PyQt is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License version 2 as published by // the Free Software Foundation and appearing in the file LICENSE included in the // packaging of this file. // // PyQt is supplied 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 // PyQt; see the file LICENSE. If not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class QTextInlineObject { %TypeHeaderCode #include %End public: bool isValid() const; QRectF rect() const; qreal width() const; qreal ascent() const; qreal descent() const; qreal height() const; Qt::LayoutDirection textDirection() const; void setWidth(qreal w); void setAscent(qreal a); void setDescent(qreal d); int textPosition() const; int formatIndex() const; QTextFormat format() const; }; class QTextLayout { %TypeHeaderCode #include %End public: QTextLayout(); QTextLayout(const QString &text); QTextLayout(const QString &text, const QFont &font, QPaintDevice *paintdevice = 0); QTextLayout(const QTextBlock &b); ~QTextLayout(); void setFont(const QFont &f); QFont font() const; void setText(const QString &string); QString text() const; void setTextOption(const QTextOption &option); QTextOption textOption() const; void setPreeditArea(int position, const QString &text); int preeditAreaPosition() const; QString preeditAreaText() const; struct FormatRange { %TypeHeaderCode #include %End int start; int length; QTextCharFormat format; }; void setAdditionalFormats(const QList &overrides); QList additionalFormats() const; void clearAdditionalFormats(); void setCacheEnabled(bool enable); bool cacheEnabled() const; void beginLayout(); void endLayout(); QTextLine createLine(); int lineCount() const; QTextLine lineAt(int i) const; QTextLine lineForTextPosition(int pos) const; enum CursorMode { SkipCharacters, SkipWords, }; bool isValidCursorPosition(int pos) const; int nextCursorPosition(int oldPos, QTextLayout::CursorMode mode = QTextLayout::SkipCharacters) const; int previousCursorPosition(int oldPos, QTextLayout::CursorMode mode = QTextLayout::SkipCharacters) const; void draw(QPainter *p, const QPointF &pos, const QVector &selections = QVector(), const QRectF &clip = QRectF()) const; void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition) const; %If (Qt_4_2_0 -) void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition, int width) const; %End QPointF position() const; void setPosition(const QPointF &p); QRectF boundingRect() const; qreal minimumWidth() const; qreal maximumWidth() const; private: QTextLayout(const QTextLayout &); }; class QTextLine { %TypeHeaderCode #include %End public: QTextLine(); bool isValid() const; QRectF rect() const; qreal x() const; qreal y() const; qreal width() const; qreal ascent() const; qreal descent() const; qreal height() const; qreal naturalTextWidth() const; QRectF naturalTextRect() const; enum Edge { Leading, Trailing, }; enum CursorPosition { CursorBetweenCharacters, CursorOnCharacter, }; qreal cursorToX(int *cursorPos /In,Out/, QTextLine::Edge edge = QTextLine::Leading) const; int xToCursor(qreal x, QTextLine::CursorPosition = QTextLine::CursorBetweenCharacters) const; void setLineWidth(qreal width); void setNumColumns(int columns); %If (Qt_4_3_0 -) void setNumColumns(int columns, qreal alignmentWidth); %End void setPosition(const QPointF &pos); int textStart() const; int textLength() const; int lineNumber() const; void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = 0) const; %If (Qt_4_2_0 -) QPointF position() const; %End };