// qtextformat.sip generated by MetaSIP on Fri Feb 10 10:37:53 2012 // // This file is part of the QtGui Python extension module. // // Copyright (c) 2011 Riverbank Computing Limited // // 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. // // If you are unsure which license is appropriate for your use, please // 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. %ModuleCode #include %End class QTextLength { %TypeHeaderCode #include %End public: enum Type { VariableLength, FixedLength, PercentageLength, }; QTextLength(); QTextLength::Type type() const; QTextLength(QTextLength::Type atype, qreal avalue); qreal value(qreal maximumLength) const; qreal rawValue() const; bool operator==(const QTextLength &other) const; bool operator!=(const QTextLength &other) const; QTextLength(const QVariant &variant) /NoDerived/; %MethodCode sipCpp = new QTextLength(qVariantValue(*a0)); %End }; QDataStream &operator<<(QDataStream &, const QTextLength & /Constrained/); QDataStream &operator>>(QDataStream &, QTextLength & /Constrained/); class QTextFormat { %TypeHeaderCode #include %End public: enum FormatType { InvalidFormat, BlockFormat, CharFormat, ListFormat, TableFormat, FrameFormat, UserFormat, }; enum ObjectTypes { NoObject, ImageObject, TableObject, %If (Qt_4_4_0 -) TableCellObject, %End UserObject, }; %If (Qt_4_2_0 -) enum PageBreakFlag { PageBreak_Auto, PageBreak_AlwaysBefore, PageBreak_AlwaysAfter, }; %End %If (Qt_4_2_0 -) typedef QFlags PageBreakFlags; %End enum Property { ObjectIndex, CssFloat, LayoutDirection, OutlinePen, BackgroundBrush, ForegroundBrush, BlockAlignment, BlockTopMargin, BlockBottomMargin, BlockLeftMargin, BlockRightMargin, TextIndent, BlockIndent, BlockNonBreakableLines, BlockTrailingHorizontalRulerWidth, FontFamily, FontPointSize, FontSizeAdjustment, FontSizeIncrement, FontWeight, FontItalic, FontUnderline, FontOverline, FontStrikeOut, FontFixedPitch, FontPixelSize, TextUnderlineColor, TextVerticalAlignment, TextOutline, IsAnchor, AnchorHref, AnchorName, ObjectType, ListStyle, ListIndent, FrameBorder, FrameMargin, FramePadding, FrameWidth, FrameHeight, TableColumns, TableColumnWidthConstraints, TableCellSpacing, TableCellPadding, TableCellRowSpan, TableCellColumnSpan, ImageName, ImageWidth, ImageHeight, %If (Qt_4_2_0 -) TextUnderlineStyle, %End %If (Qt_4_2_0 -) TableHeaderRowCount, %End %If (Qt_4_2_0 -) FullWidthSelection, %End %If (Qt_4_2_0 -) PageBreakPolicy, %End %If (Qt_4_3_0 -) TextToolTip, %End %If (Qt_4_3_0 -) FrameTopMargin, %End %If (Qt_4_3_0 -) FrameBottomMargin, %End %If (Qt_4_3_0 -) FrameLeftMargin, %End %If (Qt_4_3_0 -) FrameRightMargin, %End %If (Qt_4_3_0 -) FrameBorderBrush, %End %If (Qt_4_3_0 -) FrameBorderStyle, %End %If (Qt_4_4_0 -) BackgroundImageUrl, %End %If (Qt_4_4_0 -) TabPositions, %End %If (Qt_4_4_0 -) FirstFontProperty, %End %If (Qt_4_4_0 -) FontCapitalization, %End %If (Qt_4_4_0 -) FontLetterSpacing, %End %If (Qt_4_4_0 -) FontWordSpacing, %End %If (Qt_4_4_0 -) LastFontProperty, %End %If (Qt_4_4_0 -) TableCellTopPadding, %End %If (Qt_4_4_0 -) TableCellBottomPadding, %End %If (Qt_4_4_0 -) TableCellLeftPadding, %End %If (Qt_4_4_0 -) TableCellRightPadding, %End %If (Qt_4_5_0 -) FontStyleHint, %End %If (Qt_4_5_0 -) FontStyleStrategy, %End %If (Qt_4_5_0 -) FontKerning, %End %If (Qt_4_8_0 -) LineHeight, %End %If (Qt_4_8_0 -) LineHeightType, %End %If (Qt_4_8_0 -) FontHintingPreference, %End %If (Qt_4_8_0 -) ListNumberPrefix, %End %If (Qt_4_8_0 -) ListNumberSuffix, %End UserProperty, }; QTextFormat(); explicit QTextFormat(int type); QTextFormat(const QTextFormat &rhs); ~QTextFormat(); void merge(const QTextFormat &other); bool isValid() const; int type() const; int objectIndex() const; void setObjectIndex(int object); QVariant property(int propertyId) const; void setProperty(int propertyId, const QVariant &value); void clearProperty(int propertyId); bool hasProperty(int propertyId) const; bool boolProperty(int propertyId) const; int intProperty(int propertyId) const; qreal doubleProperty(int propertyId) const; QString stringProperty(int propertyId) const; QColor colorProperty(int propertyId) const; QPen penProperty(int propertyId) const; QBrush brushProperty(int propertyId) const; QTextLength lengthProperty(int propertyId) const; QVector lengthVectorProperty(int propertyId) const; void setProperty(int propertyId, const QVector &lengths); QMap properties() const; int objectType() const; bool isCharFormat() const; bool isBlockFormat() const; bool isListFormat() const; bool isFrameFormat() const; bool isImageFormat() const; bool isTableFormat() const; QTextBlockFormat toBlockFormat() const; QTextCharFormat toCharFormat() const; QTextListFormat toListFormat() const; QTextTableFormat toTableFormat() const; QTextFrameFormat toFrameFormat() const; QTextImageFormat toImageFormat() const; bool operator==(const QTextFormat &rhs) const; bool operator!=(const QTextFormat &rhs) const; QTextFormat(const QVariant &variant) /NoDerived/; %MethodCode sipCpp = new QTextFormat(qVariantValue(*a0)); %End void setLayoutDirection(Qt::LayoutDirection direction); Qt::LayoutDirection layoutDirection() const; void setBackground(const QBrush &brush); QBrush background() const; void clearBackground(); void setForeground(const QBrush &brush); QBrush foreground() const; void clearForeground(); void setObjectType(int atype); %If (Qt_4_3_0 -) int propertyCount() const; %End %If (Qt_4_4_0 -) bool isTableCellFormat() const; %End %If (Qt_4_4_0 -) QTextTableCellFormat toTableCellFormat() const; %End }; QDataStream &operator<<(QDataStream &, const QTextFormat & /Constrained/); QDataStream &operator>>(QDataStream &, QTextFormat & /Constrained/); class QTextCharFormat : QTextFormat { %TypeHeaderCode #include %End public: enum VerticalAlignment { AlignNormal, AlignSuperScript, AlignSubScript, %If (Qt_4_3_0 -) AlignMiddle, %End %If (Qt_4_3_0 -) AlignTop, %End %If (Qt_4_3_0 -) AlignBottom, %End %If (Qt_4_8_0 -) AlignBaseline, %End }; QTextCharFormat(); bool isValid() const; void setFont(const QFont &font); QFont font() const; void setFontFamily(const QString &family); QString fontFamily() const; void setFontPointSize(qreal size); qreal fontPointSize() const; void setFontWeight(int weight); int fontWeight() const; void setFontItalic(bool italic); bool fontItalic() const; void setFontUnderline(bool underline); bool fontUnderline() const; void setFontOverline(bool overline); bool fontOverline() const; void setFontStrikeOut(bool strikeOut); bool fontStrikeOut() const; void setUnderlineColor(const QColor &color); QColor underlineColor() const; void setFontFixedPitch(bool fixedPitch); bool fontFixedPitch() const; void setVerticalAlignment(QTextCharFormat::VerticalAlignment alignment); QTextCharFormat::VerticalAlignment verticalAlignment() const; void setAnchor(bool anchor); bool isAnchor() const; void setAnchorHref(const QString &value); QString anchorHref() const; void setAnchorName(const QString &name); QString anchorName() const; int tableCellRowSpan() const; int tableCellColumnSpan() const; void setTableCellRowSpan(int atableCellRowSpan); void setTableCellColumnSpan(int atableCellColumnSpan); void setTextOutline(const QPen &pen); QPen textOutline() const; %If (Qt_4_2_0 -) enum UnderlineStyle { NoUnderline, SingleUnderline, DashUnderline, DotLine, DashDotLine, DashDotDotLine, WaveUnderline, SpellCheckUnderline, }; %End %If (Qt_4_2_0 -) void setUnderlineStyle(QTextCharFormat::UnderlineStyle style); %End %If (Qt_4_2_0 -) QTextCharFormat::UnderlineStyle underlineStyle() const; %End %If (Qt_4_3_0 -) void setToolTip(const QString &tip); %End %If (Qt_4_3_0 -) QString toolTip() const; %End %If (Qt_4_3_0 -) void setAnchorNames(const QStringList &names); %End %If (Qt_4_3_0 -) QStringList anchorNames() const; %End %If (Qt_4_4_0 -) void setFontCapitalization(QFont::Capitalization capitalization); %End %If (Qt_4_4_0 -) QFont::Capitalization fontCapitalization() const; %End %If (Qt_4_4_0 -) void setFontLetterSpacing(qreal spacing); %End %If (Qt_4_4_0 -) qreal fontLetterSpacing() const; %End %If (Qt_4_4_0 -) void setFontWordSpacing(qreal spacing); %End %If (Qt_4_4_0 -) qreal fontWordSpacing() const; %End %If (Qt_4_5_0 -) void setFontStyleHint(QFont::StyleHint hint, QFont::StyleStrategy strategy = QFont::PreferDefault); %End %If (Qt_4_5_0 -) void setFontStyleStrategy(QFont::StyleStrategy strategy); %End %If (Qt_4_5_0 -) QFont::StyleHint fontStyleHint() const; %End %If (Qt_4_5_0 -) QFont::StyleStrategy fontStyleStrategy() const; %End %If (Qt_4_5_0 -) void setFontKerning(bool enable); %End %If (Qt_4_5_0 -) bool fontKerning() const; %End %If (Qt_4_8_0 -) void setFontHintingPreference(QFont::HintingPreference hintingPreference); %End %If (Qt_4_8_0 -) QFont::HintingPreference fontHintingPreference() const; %End }; class QTextBlockFormat : QTextFormat { %TypeHeaderCode #include %End public: QTextBlockFormat(); bool isValid() const; Qt::Alignment alignment() const; void setTopMargin(qreal margin); qreal topMargin() const; void setBottomMargin(qreal margin); qreal bottomMargin() const; void setLeftMargin(qreal margin); qreal leftMargin() const; void setRightMargin(qreal margin); qreal rightMargin() const; void setTextIndent(qreal margin); qreal textIndent() const; int indent() const; void setNonBreakableLines(bool b); bool nonBreakableLines() const; void setAlignment(Qt::Alignment aalignment); void setIndent(int aindent); %If (Qt_4_2_0 -) void setPageBreakPolicy(QFlags flags); %End %If (Qt_4_2_0 -) QFlags pageBreakPolicy() const; %End %If (Qt_4_4_0 -) void setTabPositions(const QList &tabs); %End %If (Qt_4_4_0 -) QList tabPositions() const; %End %If (Qt_4_8_0 -) enum LineHeightTypes { SingleHeight, ProportionalHeight, FixedHeight, MinimumHeight, LineDistanceHeight, }; %End %If (Qt_4_8_0 -) void setLineHeight(qreal height, int heightType); %End %If (Qt_4_8_0 -) qreal lineHeight(qreal scriptLineHeight, qreal scaling) const [qreal (qreal scriptLineHeight, qreal scaling = 1.0e+0)]; %End %If (Qt_4_8_0 -) qreal lineHeight() const; %End %If (Qt_4_8_0 -) int lineHeightType() const; %End }; class QTextListFormat : QTextFormat { %TypeHeaderCode #include %End public: QTextListFormat(); bool isValid() const; enum Style { ListDisc, ListCircle, ListSquare, ListDecimal, ListLowerAlpha, ListUpperAlpha, %If (Qt_4_6_0 -) ListLowerRoman, %End %If (Qt_4_6_0 -) ListUpperRoman, %End }; QTextListFormat::Style style() const; int indent() const; void setStyle(QTextListFormat::Style astyle); void setIndent(int aindent); %If (Qt_4_8_0 -) QString numberPrefix() const; %End %If (Qt_4_8_0 -) QString numberSuffix() const; %End %If (Qt_4_8_0 -) void setNumberPrefix(const QString &np); %End %If (Qt_4_8_0 -) void setNumberSuffix(const QString &ns); %End }; class QTextImageFormat : QTextCharFormat { %TypeHeaderCode #include %End public: QTextImageFormat(); bool isValid() const; QString name() const; qreal width() const; qreal height() const; void setName(const QString &aname); void setWidth(qreal awidth); void setHeight(qreal aheight); }; class QTextFrameFormat : QTextFormat { %TypeHeaderCode #include %End public: QTextFrameFormat(); bool isValid() const; enum Position { InFlow, FloatLeft, FloatRight, }; void setPosition(QTextFrameFormat::Position f); QTextFrameFormat::Position position() const; qreal border() const; qreal margin() const; qreal padding() const; void setWidth(const QTextLength &length); QTextLength width() const; QTextLength height() const; void setBorder(qreal aborder); void setMargin(qreal amargin); void setPadding(qreal apadding); void setWidth(qreal awidth); void setHeight(qreal aheight); void setHeight(const QTextLength &aheight); %If (Qt_4_2_0 -) void setPageBreakPolicy(QFlags flags); %End %If (Qt_4_2_0 -) QFlags pageBreakPolicy() const; %End %If (Qt_4_3_0 -) enum BorderStyle { BorderStyle_None, BorderStyle_Dotted, BorderStyle_Dashed, BorderStyle_Solid, BorderStyle_Double, BorderStyle_DotDash, BorderStyle_DotDotDash, BorderStyle_Groove, BorderStyle_Ridge, BorderStyle_Inset, BorderStyle_Outset, }; %End %If (Qt_4_3_0 -) void setBorderBrush(const QBrush &brush); %End %If (Qt_4_3_0 -) QBrush borderBrush() const; %End %If (Qt_4_3_0 -) void setBorderStyle(QTextFrameFormat::BorderStyle style); %End %If (Qt_4_3_0 -) QTextFrameFormat::BorderStyle borderStyle() const; %End %If (Qt_4_3_0 -) qreal topMargin() const; %End %If (Qt_4_3_0 -) qreal bottomMargin() const; %End %If (Qt_4_3_0 -) qreal leftMargin() const; %End %If (Qt_4_3_0 -) qreal rightMargin() const; %End %If (Qt_4_3_0 -) void setTopMargin(qreal amargin); %End %If (Qt_4_3_0 -) void setBottomMargin(qreal amargin); %End %If (Qt_4_3_0 -) void setLeftMargin(qreal amargin); %End %If (Qt_4_3_0 -) void setRightMargin(qreal amargin); %End }; class QTextTableFormat : QTextFrameFormat { %TypeHeaderCode #include %End public: QTextTableFormat(); bool isValid() const; int columns() const; void setColumnWidthConstraints(const QVector &constraints); QVector columnWidthConstraints() const; void clearColumnWidthConstraints(); qreal cellSpacing() const; void setCellSpacing(qreal spacing); qreal cellPadding() const; Qt::Alignment alignment() const; void setColumns(int acolumns); void setCellPadding(qreal apadding); void setAlignment(Qt::Alignment aalignment); %If (Qt_4_2_0 -) void setHeaderRowCount(int count); %End %If (Qt_4_2_0 -) int headerRowCount() const; %End }; %If (Qt_4_2_0 -) QFlags operator|(QTextFormat::PageBreakFlag f1, QFlags f2); %End %If (Qt_4_4_0 -) class QTextTableCellFormat : QTextCharFormat { %TypeHeaderCode #include %End public: QTextTableCellFormat(); bool isValid() const; void setTopPadding(qreal padding); qreal topPadding() const; void setBottomPadding(qreal padding); qreal bottomPadding() const; void setLeftPadding(qreal padding); qreal leftPadding() const; void setRightPadding(qreal padding); qreal rightPadding() const; void setPadding(qreal padding); }; %End