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

The QTextCharFormat class provides formatting information for characters in a QTextDocument. More...

Inheritance diagram for QtGui.QTextCharFormat:
Collaboration diagram for QtGui.QTextCharFormat:

Public Types

enum  UnderlineStyle {
  DashDotDotLine = 5, DashDotLine = 4, DashUnderline = 2, DotLine = 3,
  NoUnderline = 0, SingleUnderline = 1, SpellCheckUnderline = 7, WaveUnderline = 6
}
  More...
 
enum  VerticalAlignment {
  AlignBaseline = 6, AlignBottom = 5, AlignMiddle = 3, AlignNormal = 0,
  AlignSubScript = 2, AlignSuperScript = 1, AlignTop = 4
}
  More...
 
- Public Types inherited from QtGui.QTextFormat
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

 QTextCharFormat ()
 
 
 QTextCharFormat (QTextCharFormat copy)
 
 
override void CreateProxy ()
 
new bool IsAnchor ()
 
 
new bool IsValid ()
 
 
new void SetAnchor (bool anchor)
 
 
new void SetFontStyleHint (QFont.StyleHint hint, QFont.StyleStrategy strategy=QFont.StyleStrategy.PreferDefault)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QTextFormat
override bool Equals (object o)
 
override int GetHashCode ()
 
 QTextFormat ()
 
 
 QTextFormat (QTextFormat rhs)
 
 
 QTextFormat (int type)
 
 
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 ()
 

Protected Member Functions

 QTextCharFormat (System.Type dummy)
 
 QTextCharFormat (QTextFormat fmt)
 
 
- Protected Member Functions inherited from QtGui.QTextFormat
 QTextFormat (System.Type dummy)
 

Properties

new string AnchorHref [get, set]
 
 
new string AnchorName [get, set]
 
 
new
System.Collections.Generic.List
< string > 
AnchorNames [get, set]
 
 
new QFont Font [get, set]
 
 
new QFont.Capitalization FontCapitalization [get, set]
 
 
new string FontFamily [get, set]
 
 
new bool FontFixedPitch [get, set]
 
 
new QFont.HintingPreference FontHintingPreference [get, set]
 
 
new bool FontItalic [get, set]
 
 
new bool FontKerning [get, set]
 
 
new double FontLetterSpacing [get, set]
 
 
new bool FontOverline [get, set]
 
 
new double FontPointSize [get, set]
 
 
new bool FontStrikeOut [get, set]
 
 
new QFont.StyleStrategy FontStyleStrategy [get, set]
 
 
new bool FontUnderline [get, set]
 
 
new int FontWeight [get, set]
 
 
new double FontWordSpacing [get, set]
 
 
new int TableCellColumnSpan [get, set]
 
new int TableCellRowSpan [get, set]
 
new QPen TextOutline [get, set]
 
 
new string ToolTip [get, set]
 
 
new QColor UnderlineColor [get, set]
 
 
new QTextCharFormat.UnderlineStyle underlineStyle [get, set]
 
 
new
QTextCharFormat.VerticalAlignment 
verticalAlignment [get, set]
 
 
new QFont.StyleHint FontStyleHint [get]
 
 
- Properties inherited from QtGui.QTextFormat
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]
 

Additional Inherited Members

- Static Public Member Functions inherited from QtGui.QTextFormat
static bool operator!= (QTextFormat arg1, QTextFormat arg2)
 
 
static bool operator== (QTextFormat arg1, QTextFormat arg2)
 
 
- Protected Attributes inherited from QtGui.QTextFormat
SmokeInvocation interceptor
 

Detailed Description

The QTextCharFormat class provides formatting information for characters in a QTextDocument.

The character format of text in a document specifies the visual properties of the text, as well as information about its role in a hypertext document.

The font used can be set by supplying a font to the setFont() function, and each aspect of its appearance can be adjusted to give the desired effect. setFontFamily() and setFontPointSize() define the font's family (e.g. Times) and printed size; setFontWeight() and setFontItalic() provide control over the style of the font. setFontUnderline(), setFontOverline(), setFontStrikeOut(), and setFontFixedPitch() provide additional effects for text.

The color is set with setForeground(). If the text is intended to be used as an anchor (for hyperlinks), this can be enabled with setAnchor(). The setAnchorHref() and setAnchorNames() functions are used to specify the information about the hyperlink's destination and the anchor's name.

See also QTextFormat, QTextBlockFormat, QTextTableFormat, and QTextListFormat.

Member Enumeration Documentation

This enum describes the different ways drawing underlined text.

See also Qt::PenStyle.

Enumerator:
DashDotDotLine 

Underlines draw drawn using Qt::DashDotDotLine.

DashDotLine 

Dashs and dots are drawn using Qt::DashDotLine.

DashUnderline 

Dashes are drawn using Qt::DashLine.

DotLine 

Dots are drawn using Qt::DotLine;

NoUnderline 

Text is draw without any underlining decoration.

SingleUnderline 

A line is drawn using Qt::SolidLine.

SpellCheckUnderline 

The underline is drawn depending on the QStyle::SH_SpellCeckUnderlineStyle style hint of the QApplication style. By default this is mapped to WaveUnderline, on Mac OS X it is mapped to DashDotLine.

WaveUnderline 

The text is underlined using a wave shaped line.

This enum describes the ways that adjacent characters can be vertically aligned.

Enumerator:
AlignBaseline 

The base lines of the characters are aligned.

AlignBottom 

The bottom edge of the object is vertically aligned with the base line.

AlignMiddle 

The center of the object is vertically aligned with the base line. Currently, this is only implemented for inline objects.

AlignNormal 

Adjacent characters are positioned in the standard way for text in the writing system in use.

AlignSubScript 

Characters are placed below the base line for normal text.

AlignSuperScript 

Characters are placed above the base line for normal text.

AlignTop 

The top edge of the object is vertically aligned with the base line.

Constructor & Destructor Documentation

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

Constructs a new character format object.

QtGui.QTextCharFormat.QTextCharFormat ( QTextFormat  fmt)
protected

Constructs a new character format object.

QtGui.QTextCharFormat.QTextCharFormat ( QTextCharFormat  copy)

Constructs a new character format object.

Member Function Documentation

override void QtGui.QTextCharFormat.CreateProxy ( )
virtual

Reimplemented from QtGui.QTextFormat.

Reimplemented in QtGui.QTextTableCellFormat, and QtGui.QTextImageFormat.

new void QtGui.QTextCharFormat.Dispose ( )
new bool QtGui.QTextCharFormat.IsAnchor ( )

Returns true if the text is formatted as an anchor; otherwise returns false.

See also setAnchor(), setAnchorHref(), and setAnchorNames().

new bool QtGui.QTextCharFormat.IsValid ( )

Returns true if this character format is valid; otherwise returns false.

new void QtGui.QTextCharFormat.SetAnchor ( bool  anchor)

If anchor is true, text with this format represents an anchor, and is formatted in the appropriate way; otherwise the text is formatted normally. (Anchors are hyperlinks which are often shown underlined and in a different color from plain text.)

The way the text is rendered is independent of whether or not the format has a valid anchor defined. Use setAnchorHref(), and optionally setAnchorNames() to create a hypertext link.

See also isAnchor().

new void QtGui.QTextCharFormat.SetFontStyleHint ( QFont.StyleHint  hint,
QFont.StyleStrategy  strategy = QFont.StyleStrategy.PreferDefault 
)

Sets the font style hint and strategy.

Qt does not support style hints on X11 since this information is not provided by the window system.

This function was introduced in Qt 4.5.

See also fontStyleHint(), setFont(), and QFont::setStyleHint().

Property Documentation

new string QtGui.QTextCharFormat.AnchorHref
getset

Returns the text format's hypertext link, or an empty string if none has been set.

Sets the hypertext link for the text format to the given value. This is typically a URL like "http://example.com/index.html&quot;.

The anchor will be displayed with the value as its display text; if you want to display different text call setAnchorNames().

To format the text as a hypertext link use setAnchor().

new string QtGui.QTextCharFormat.AnchorName
getset

This function is deprecated. Use anchorNames() instead.

Returns the anchor name associated with this text format, or an empty string if none has been set. If the anchor name is set, text with this format can be the destination of a hypertext link.

This function is deprecated. Use setAnchorNames() instead.

Sets the text format's anchor name. For the anchor to work as a hyperlink, the destination must be set with setAnchorHref() and the anchor must be enabled with setAnchor().

new System.Collections.Generic.List<string> QtGui.QTextCharFormat.AnchorNames
getset

Returns the anchor names associated with this text format, or an empty string list if none has been set. If the anchor names are set, text with this format can be the destination of a hypertext link.

This function was introduced in Qt 4.3.

Sets the text format's anchor names. For the anchor to work as a hyperlink, the destination must be set with setAnchorHref() and the anchor must be enabled with setAnchor().

This function was introduced in Qt 4.3.

new QFont QtGui.QTextCharFormat.Font
getset

Returns the font for this character format.

Sets the text format's font.

new QFont.Capitalization QtGui.QTextCharFormat.FontCapitalization
getset

Returns the current capitalization type of the font.

This function was introduced in Qt 4.4.

Sets the capitalization of the text that apppears in this font to capitalization.

A font's capitalization makes the text appear in the selected capitalization mode.

This function was introduced in Qt 4.4.

new string QtGui.QTextCharFormat.FontFamily
getset

Returns the text format's font family.

Sets the text format's font family.

new bool QtGui.QTextCharFormat.FontFixedPitch
getset

Returns true if the text format's font is fixed pitch; otherwise returns false.

If fixedPitch is true, sets the text format's font to be fixed pitch; otherwise a non-fixed pitch font is used.

new QFont.HintingPreference QtGui.QTextCharFormat.FontHintingPreference
getset

Returns the hinting preference set for this text format.

This function was introduced in Qt 4.8.

Sets the hinting preference of the text format's font to be hintingPreference.

This function was introduced in Qt 4.8.

new bool QtGui.QTextCharFormat.FontItalic
getset

Returns true if the text format's font is italic; otherwise returns false.

If italic is true, sets the text format's font to be italic; otherwise the font will be non-italic.

new bool QtGui.QTextCharFormat.FontKerning
getset

Returns true if the font kerning is enabled.

This function was introduced in Qt 4.5.

Enables kerning for this font if enable is true; otherwise disables it.

When kerning is enabled, glyph metrics do not add up anymore, even for Latin text. In other words, the assumption that width('a') + width('b') is equal to width("ab") is not neccesairly true.

This function was introduced in Qt 4.5.

new double QtGui.QTextCharFormat.FontLetterSpacing
getset

Returns the current letter spacing percentage.

This function was introduced in Qt 4.4.

Sets the letter spacing of this format to the given spacing, in percent. A value of 100 indicates default spacing; a value of 200 doubles the amount of space a letter takes.

This function was introduced in Qt 4.4.

new bool QtGui.QTextCharFormat.FontOverline
getset

Returns true if the text format's font is overlined; otherwise returns false.

If overline is true, sets the text format's font to be overlined; otherwise the font is displayed non-overlined.

new double QtGui.QTextCharFormat.FontPointSize
getset

Returns the font size used to display text in this format.

Sets the text format's font size.

new bool QtGui.QTextCharFormat.FontStrikeOut
getset

Returns true if the text format's font is struck out (has a horizontal line drawn through it); otherwise returns false.

If strikeOut is true, sets the text format's font with strike-out enabled (with a horizontal line through it); otherwise it is displayed without strikeout.

new QFont.StyleHint QtGui.QTextCharFormat.FontStyleHint
get

Returns the font style hint.

This function was introduced in Qt 4.5.

See also setFontStyleHint() and font().

new QFont.StyleStrategy QtGui.QTextCharFormat.FontStyleStrategy
getset

Returns the current font style strategy.

This function was introduced in Qt 4.5.

Sets the font style strategy.

This function was introduced in Qt 4.5.

new bool QtGui.QTextCharFormat.FontUnderline
getset

Returns true if the text format's font is underlined; otherwise returns false.

If underline is true, sets the text format's font to be underlined; otherwise it is displayed non-underlined.

new int QtGui.QTextCharFormat.FontWeight
getset

Returns the text format's font weight.

Sets the text format's font weight to weight.

new double QtGui.QTextCharFormat.FontWordSpacing
getset

Returns the current word spacing value.

This function was introduced in Qt 4.4.

Sets the word spacing of this format to the given spacing, in pixels.

This function was introduced in Qt 4.4.

new int QtGui.QTextCharFormat.TableCellColumnSpan
getset
new int QtGui.QTextCharFormat.TableCellRowSpan
getset
new QPen QtGui.QTextCharFormat.TextOutline
getset

Returns the pen used to draw the outlines of characters in this format.

Sets the pen used to draw the outlines of characters to the given pen.

new string QtGui.QTextCharFormat.ToolTip
getset

Returns the tool tip that is displayed for a fragment of text.

This function was introduced in Qt 4.3.

Sets the tool tip for a fragment of text to the given text.

This function was introduced in Qt 4.3.

new QColor QtGui.QTextCharFormat.UnderlineColor
getset

Returns the color used to underline the characters with this format.

Sets the underline color used for the characters with this format to the color specified.

new QTextCharFormat.UnderlineStyle QtGui.QTextCharFormat.underlineStyle
getset

Returns the style of underlining the text.

This function was introduced in Qt 4.2.

Sets the style of underlining the text to style.

This function was introduced in Qt 4.2.

new QTextCharFormat.VerticalAlignment QtGui.QTextCharFormat.verticalAlignment
getset

Returns the vertical alignment used for characters with this format.

Sets the vertical alignment used for the characters with this format to the alignment specified.