Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtGui.QTextFormat Class Reference

The QTextFormat class provides formatting information for a QTextDocument. More...

Inheritance diagram for QtGui.QTextFormat:
Collaboration diagram for QtGui.QTextFormat:

Public Types

enum  FormatType {
  BlockFormat = 1, CharFormat = 2, FrameFormat = 5, InvalidFormat = -1,
  ListFormat = 3, TableFormat = 4, UserFormat = 100
}
  More...
 
enum  ObjectTypes {
  ImageObject = 1, NoObject = 0, TableCellObject = 3, TableObject = 2,
  UserObject = 4096
}
  More...
 
enum  PageBreakFlag { PageBreak_AlwaysAfter = 16, PageBreak_AlwaysBefore = 1, PageBreak_Auto = 0 }
  More...
 
enum  Property {
  AnchorHref = 8241, AnchorName = 8242, BackgroundBrush = 2080, BackgroundImageUrl = 2083,
  BlockAlignment = 4112, BlockBottomMargin = 4145, BlockIndent = 4160, BlockLeftMargin = 4146,
  BlockNonBreakableLines = 4176, BlockRightMargin = 4147, BlockTopMargin = 4144, BlockTrailingHorizontalRulerWidth = 4192,
  CssFloat = 2048, FirstFontProperty = 8160, FontCapitalization = 8160, FontFamily = 8192,
  FontFixedPitch = 8200, FontHintingPreference = 8166, FontItalic = 8196, FontKerning = 8165,
  FontLetterSpacing = 8161, FontOverline = 8198, FontPixelSize = 8201, FontPointSize = 8193,
  FontSizeAdjustment = 8194, FontSizeIncrement = 8194, FontStrikeOut = 8199, FontStyleHint = 8163,
  FontStyleStrategy = 8164, FontUnderline = 8197, FontWeight = 8195, FontWordSpacing = 8162,
  ForegroundBrush = 2081, FrameBorder = 16384, FrameBorderBrush = 16393, FrameBorderStyle = 16400,
  FrameBottomMargin = 16390, FrameHeight = 16388, FrameLeftMargin = 16391, FrameMargin = 16385,
  FramePadding = 16386, FrameRightMargin = 16392, FrameTopMargin = 16389, FrameWidth = 16387,
  FullWidthSelection = 24576, ImageHeight = 20497, ImageName = 20480, ImageWidth = 20496,
  IsAnchor = 8240, LastFontProperty = 8201, LayoutDirection = 2049, LineHeight = 4168,
  LineHeightType = 4169, ListIndent = 12289, ListNumberPrefix = 12290, ListNumberSuffix = 12291,
  ListStyle = 12288, ObjectIndex = 0, ObjectType = 12032, OutlinePen = 2064,
  PageBreakPolicy = 28672, TabPositions = 4149, TableCellBottomPadding = 18451, TableCellColumnSpan = 18449,
  TableCellLeftPadding = 18452, TableCellPadding = 16643, TableCellRightPadding = 18453, TableCellRowSpan = 18448,
  TableCellSpacing = 16642, TableCellTopPadding = 18450, TableColumnWidthConstraints = 16641, TableColumns = 16640,
  TableHeaderRowCount = 16644, TextIndent = 4148, TextOutline = 8226, TextToolTip = 8228,
  TextUnderlineColor = 8208, TextUnderlineStyle = 8227, TextVerticalAlignment = 8225, UserProperty = 1048576
}
  More...
 

Public Member Functions

override bool Equals (object o)
 
override int GetHashCode ()
 
 QTextFormat ()
 
 
 QTextFormat (QTextFormat rhs)
 
 
 QTextFormat (int type)
 
 
virtual void CreateProxy ()
 
new bool BoolProperty (int propertyId)
 
 
new QBrush BrushProperty (int propertyId)
 
 
new void ClearBackground ()
 
 
new void ClearForeground ()
 
 
new void ClearProperty (int propertyId)
 
 
new QColor ColorProperty (int propertyId)
 
 
new double DoubleProperty (int propertyId)
 
 
new bool HasProperty (int propertyId)
 
 
new int IntProperty (int propertyId)
 
 
new bool IsBlockFormat ()
 
 
new bool IsCharFormat ()
 
 
new bool IsFrameFormat ()
 
 
new bool IsImageFormat ()
 
 
new bool IsListFormat ()
 
 
new bool IsTableCellFormat ()
 
 
new bool IsTableFormat ()
 
 
new bool IsValid ()
 
 
new QTextLength LengthProperty (int propertyId)
 
 
new
System.Collections.Generic.List
< QTextLength
LengthVectorProperty (int propertyId)
 
 
new void Merge (QTextFormat other)
 
 
new QPen PenProperty (int propertyId)
 
 
new
System.Collections.Generic.Dictionary
< System.Int32, System.Object > 
Properties ()
 
 
new object property (int propertyId)
 
 
new int PropertyCount ()
 
 
new void SetProperty (int propertyId, object value)
 
 
new void SetProperty (int propertyId, System.Collections.Generic.List< QTextLength > lengths)
 
 
new string StringProperty (int propertyId)
 
 
new QTextBlockFormat ToBlockFormat ()
 
 
new QTextCharFormat ToCharFormat ()
 
 
new QTextFrameFormat ToFrameFormat ()
 
 
new QTextImageFormat ToImageFormat ()
 
 
new QTextListFormat ToListFormat ()
 
 
new QTextTableCellFormat ToTableCellFormat ()
 
 
new QTextTableFormat ToTableFormat ()
 
 
new int Type ()
 
 
new void Dispose ()
 

Static Public Member Functions

static bool operator!= (QTextFormat arg1, QTextFormat arg2)
 
 
static bool operator== (QTextFormat arg1, QTextFormat arg2)
 
 

Protected Member Functions

 QTextFormat (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new QBrush Background [get, set]
 
 
new QBrush Foreground [get, set]
 
 
new Qt.LayoutDirection LayoutDirection [get, set]
 
 
new int ObjectIndex [get, set]
 
 
new int ObjectType [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
static new QMetaObject StaticMetaObject [get]
 

Detailed Description

The QTextFormat class provides formatting information for a QTextDocument.

A QTextFormat is a generic class used for describing the format of parts of a QTextDocument. The derived classes QTextCharFormat, QTextBlockFormat, QTextListFormat, and QTextTableFormat are usually more useful, and describe the formatting that is applied to specific parts of the document.

A format has a FormatType which specifies the kinds of text item it can format; e.g. a block of text, a list, a table, etc. A format also has various properties (some specific to particular format types), as described by the Property enum. Every property has a corresponding Property.

The format type is given by type(), and the format can be tested with isCharFormat(), isBlockFormat(), isListFormat(), isTableFormat(), isFrameFormat(), and isImageFormat(). If the type is determined, it can be retrieved with toCharFormat(), toBlockFormat(), toListFormat(), toTableFormat(), toFrameFormat(), and toImageFormat().

A format's properties can be set with the setProperty() functions, and retrieved with boolProperty(), intProperty(), doubleProperty(), and stringProperty() as appropriate. All the property IDs used in the format can be retrieved with allPropertyIds(). One format can be merged into another using merge().

A format's object index can be set with setObjectIndex(), and retrieved with objectIndex(). These methods can be used to associate the format with a QTextObject. It is used to represent lists, frames, and tables inside the document.

See also Rich Text Processing.

Member Enumeration Documentation

This enum describes the text item a QTextFormat object is formatting.

See also QTextCharFormat, QTextBlockFormat, QTextListFormat, QTextTableFormat, and type().

Enumerator:
BlockFormat 

The object formats a text block

CharFormat 

The object formats a single character

FrameFormat 

The object formats a frame

InvalidFormat 

An invalid format as created by the default constructor

ListFormat 

The object formats a list

TableFormat 

The object formats a table

UserFormat 

This enum describes what kind of QTextObject this format is associated with.

See also QTextObject, QTextTable, and QTextObject::format().

Enumerator:
ImageObject 
NoObject 
TableCellObject 
TableObject 
UserObject 

The first object that can be used for application-specific purposes.

This enum describes how page breaking is performed when printing. It maps to the corresponding css properties.

This enum was introduced or modified in Qt 4.2.

See also QTextBlockFormat::pageBreakPolicy(), QTextFrameFormat::pageBreakPolicy(), and PageBreakPolicy.

Enumerator:
PageBreak_AlwaysAfter 

A new page is always started after the paragraph/table

PageBreak_AlwaysBefore 

The page is always broken before the paragraph/table

PageBreak_Auto 

The page break is determined automatically depending on the available space on the current page

This enum describes the different properties a format can have.

Paragraph and character properties

Paragraph properties

Character properties

List properties

Table and frame properties

Table cell properties

Image properties

Selection properties

Page break properties

See also property() and setProperty().

Enumerator:
AnchorHref 
AnchorName 
BackgroundBrush 
BackgroundImageUrl 
BlockAlignment 
BlockBottomMargin 
BlockIndent 
BlockLeftMargin 
BlockNonBreakableLines 
BlockRightMargin 
BlockTopMargin 
BlockTrailingHorizontalRulerWidth 

The width of a horizontal ruler element.

CssFloat 

How a frame is located relative to the surrounding text

FirstFontProperty 
FontCapitalization 

Specifies the capitalization type that is to be applied to the text.

FontFamily 
FontFixedPitch 
FontHintingPreference 

Controls the use of hinting according to values of the QFont::HintingPreference enum.

FontItalic 
FontKerning 

Specifies whether the font has kerning turned on.

FontLetterSpacing 

Changes the default spacing between individual letters in the font. The value is specified in percentage, with 100 as the default value.

FontOverline 
FontPixelSize 
FontPointSize 
FontSizeAdjustment 

Specifies the change in size given to the fontsize already set using FontPointSize or FontPixelSize.

FontSizeIncrement 
FontStrikeOut 
FontStyleHint 

Corresponds to the QFont::StyleHint property

FontStyleStrategy 

Corresponds to the QFont::StyleStrategy property

FontUnderline 

This property has been deprecated. Use QTextFormat::TextUnderlineStyle instead.

FontWeight 
FontWordSpacing 

Changes the default spacing between individual words. A positive value increases the word spacing by the corresponding pixels; a negative value decreases the spacing.

ForegroundBrush 
FrameBorder 
FrameBorderBrush 
FrameBorderStyle 

See the BorderStyle enum.

FrameBottomMargin 
FrameHeight 
FrameLeftMargin 
FrameMargin 
FramePadding 
FrameRightMargin 
FrameTopMargin 
FrameWidth 
FullWidthSelection 

When set on the characterFormat of a selection, the whole width of the text will be shown selected.

ImageHeight 
ImageName 
ImageWidth 
IsAnchor 
LastFontProperty 
LayoutDirection 

The layout direction of the text in the document (Qt::LayoutDirection).

LineHeight 
LineHeightType 
ListIndent 

Specifies the amount of indentation used for a list.

ListNumberPrefix 

Defines the text which is prepended to item numbers in numeric lists.

ListNumberSuffix 

Defines the text which is appended to item numbers in numeric lists.

ListStyle 

Specifies the style used for the items in a list, described by values of the QTextListFormat::Style enum.

ObjectIndex 

The index of the formatted object. See objectIndex().

ObjectType 
OutlinePen 
PageBreakPolicy 

Specifies how pages are broken. See the PageBreakFlag enum.

TabPositions 

Specifies the tab positions. The tab positions are structs of QTextOption::Tab which are stored in a QList (internally, in a QList<QVariant>).

TableCellBottomPadding 
TableCellColumnSpan 
TableCellLeftPadding 
TableCellPadding 
TableCellRightPadding 
TableCellRowSpan 
TableCellSpacing 
TableCellTopPadding 
TableColumnWidthConstraints 
TableColumns 
TableHeaderRowCount 
TextIndent 
TextOutline 
TextToolTip 

Specifies the (optional) tool tip to be displayed for a fragment of text.

TextUnderlineColor 
TextUnderlineStyle 
TextVerticalAlignment 
UserProperty 

Constructor & Destructor Documentation

QtGui.QTextFormat.QTextFormat ( System.Type  dummy)
protected
QtGui.QTextFormat.QTextFormat ( )

Creates a new text format with an InvalidFormat.

See also FormatType.

QtGui.QTextFormat.QTextFormat ( QTextFormat  rhs)

Creates a new text format with the same attributes as the other text format.

QtGui.QTextFormat.QTextFormat ( int  type)

Creates a new text format of the given type.

See also FormatType.

Member Function Documentation

new bool QtGui.QTextFormat.BoolProperty ( int  propertyId)

Returns the value of the property specified by propertyId. If the property isn't of QTextFormat::Bool type, false is returned instead.

See also setProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), and Property.

new QBrush QtGui.QTextFormat.BrushProperty ( int  propertyId)

Returns the value of the property given by propertyId; if the property isn't of QVariant::Brush type, Qt::NoBrush is returned instead.

See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), and Property.

new void QtGui.QTextFormat.ClearBackground ( )

Clears the brush used to paint the document's background. The default brush will be used.

See also background(), setBackground(), and clearForeground().

new void QtGui.QTextFormat.ClearForeground ( )

Clears the brush used to paint the document's foreground. The default brush will be used.

See also foreground(), setForeground(), and clearBackground().

new void QtGui.QTextFormat.ClearProperty ( int  propertyId)

Clears the value of the property given by propertyId

See also Property.

new QColor QtGui.QTextFormat.ColorProperty ( int  propertyId)

Returns the value of the property given by propertyId; if the property isn't of QVariant::Color type, an invalid color is returned instead.

See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), and Property.

new void QtGui.QTextFormat.Dispose ( )
new double QtGui.QTextFormat.DoubleProperty ( int  propertyId)

Returns the value of the property specified by propertyId. If the property isn't of QVariant::Double or QMetaType::Float type, 0 is returned instead.

See also setProperty(), boolProperty(), intProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), and Property.

override bool QtGui.QTextFormat.Equals ( object  o)
override int QtGui.QTextFormat.GetHashCode ( )
new bool QtGui.QTextFormat.HasProperty ( int  propertyId)

Returns true if the text format has a property with the given propertyId; otherwise returns false.

See also properties() and Property.

new int QtGui.QTextFormat.IntProperty ( int  propertyId)

Returns the value of the property specified by propertyId. If the property is not of QTextFormat::Integer type, 0 is returned instead.

See also setProperty(), boolProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), and Property.

new bool QtGui.QTextFormat.IsBlockFormat ( )

Returns true if this text format is a BlockFormat; otherwise returns false.

new bool QtGui.QTextFormat.IsCharFormat ( )

Returns true if this text format is a CharFormat; otherwise returns false.

new bool QtGui.QTextFormat.IsFrameFormat ( )

Returns true if this text format is a FrameFormat; otherwise returns false.

new bool QtGui.QTextFormat.IsImageFormat ( )

Returns true if this text format is an image format; otherwise returns false.

new bool QtGui.QTextFormat.IsListFormat ( )

Returns true if this text format is a ListFormat; otherwise returns false.

new bool QtGui.QTextFormat.IsTableCellFormat ( )

Returns true if this text format is a TableCellFormat; otherwise returns false.

This function was introduced in Qt 4.4.

new bool QtGui.QTextFormat.IsTableFormat ( )

Returns true if this text format is a TableFormat; otherwise returns false.

new bool QtGui.QTextFormat.IsValid ( )

Returns true if the format is valid (i.e. is not InvalidFormat); otherwise returns false.

new QTextLength QtGui.QTextFormat.LengthProperty ( int  propertyId)

Returns the value of the property given by propertyId.

See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthVectorProperty(), and Property.

new System.Collections.Generic.List<QTextLength> QtGui.QTextFormat.LengthVectorProperty ( int  propertyId)

Returns the value of the property given by propertyId. If the property isn't of QTextFormat::LengthVector type, an empty length vector is returned instead.

See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), and Property.

new void QtGui.QTextFormat.Merge ( QTextFormat  other)

Merges the other format with this format; where there are conflicts the other format takes precedence.

static bool QtGui.QTextFormat.operator!= ( QTextFormat  arg1,
QTextFormat  arg2 
)
static

Returns true if this text format is different from the other text format.

static bool QtGui.QTextFormat.operator== ( QTextFormat  arg1,
QTextFormat  arg2 
)
static

Returns true if this text format is the same as the other text format.

new QPen QtGui.QTextFormat.PenProperty ( int  propertyId)

Returns the value of the property given by propertyId; if the property isn't of QVariant::Pen type, Qt::NoPen is returned instead.

See also setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), and Property.

new System.Collections.Generic.Dictionary<System.Int32,System.Object> QtGui.QTextFormat.Properties ( )

Returns a map with all properties of this text format.

new object QtGui.QTextFormat.property ( int  propertyId)

Returns the property specified by the given propertyId.

See also setProperty() and Property.

new int QtGui.QTextFormat.PropertyCount ( )

Returns the number of properties stored in the format.

This function was introduced in Qt 4.3.

new void QtGui.QTextFormat.SetProperty ( int  propertyId,
object  value 
)

Sets the property specified by the propertyId to the given value.

See also property() and Property.

new void QtGui.QTextFormat.SetProperty ( int  propertyId,
System.Collections.Generic.List< QTextLength lengths 
)

Sets the value of the property given by propertyId to value.

See also lengthVectorProperty() and Property.

new string QtGui.QTextFormat.StringProperty ( int  propertyId)

Returns the value of the property given by propertyId; if the property isn't of QVariant::String type, an empty string is returned instead.

See also setProperty(), boolProperty(), intProperty(), doubleProperty(), colorProperty(), lengthProperty(), lengthVectorProperty(), and Property.

new QTextBlockFormat QtGui.QTextFormat.ToBlockFormat ( )

Returns this format as a block format.

new QTextCharFormat QtGui.QTextFormat.ToCharFormat ( )

Returns this format as a character format.

new QTextFrameFormat QtGui.QTextFormat.ToFrameFormat ( )

Returns this format as a frame format.

new QTextImageFormat QtGui.QTextFormat.ToImageFormat ( )

Returns this format as an image format.

new QTextListFormat QtGui.QTextFormat.ToListFormat ( )

Returns this format as a list format.

new QTextTableCellFormat QtGui.QTextFormat.ToTableCellFormat ( )

Returns this format as a table cell format.

This function was introduced in Qt 4.4.

new QTextTableFormat QtGui.QTextFormat.ToTableFormat ( )

Returns this format as a table format.

new int QtGui.QTextFormat.Type ( )

Returns the type of this format.

See also FormatType.

Member Data Documentation

SmokeInvocation QtGui.QTextFormat.interceptor
protected

Property Documentation

new QBrush QtGui.QTextFormat.Background
getset

Returns the brush used to paint the document's background.

Sets the brush use to paint the document's background to the brush specified.

new QBrush QtGui.QTextFormat.Foreground
getset

Returns the brush used to render foreground details, such as text, frame outlines, and table borders.

Sets the foreground brush to the specified brush. The foreground brush is mostly used to render text.

new Qt.LayoutDirection QtGui.QTextFormat.LayoutDirection
getset

Returns the document's layout direction.

Sets the document's layout direction to the specified direction.

new int QtGui.QTextFormat.ObjectIndex
getset

Returns the index of the format object, or -1 if the format object is invalid.

Sets the format object's object index.

new int QtGui.QTextFormat.ObjectType
getset

Returns the text format's object type.

Sets the text format's object type to type.

virtual System.IntPtr QtGui.QTextFormat.SmokeObject
getset
new QMetaObject QtGui.QTextFormat.StaticMetaObject
staticget