You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqstylesheetitem.3qt

485 lines
19 KiB

'\" t
.TH TQStyleSheetItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQStyleSheetItem \- Encapsulation of a set of text styles
.SH SYNOPSIS
\fC#include <tqstylesheet.h>\fR
.PP
Inherits Qt.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQStyleSheetItem\fR ( TQStyleSheet * parent, const TQString & name )"
.br
.ti -1c
.BI "\fBTQStyleSheetItem\fR ( const TQStyleSheetItem & other )"
.br
.ti -1c
.BI "\fB~TQStyleSheetItem\fR ()"
.br
.ti -1c
.BI "TQStyleSheetItem & \fBoperator=\fR ( const TQStyleSheetItem & other )"
.br
.ti -1c
.BI "TQString \fBname\fR () const"
.br
.ti -1c
.BI "TQStyleSheet * \fBstyleSheet\fR ()"
.br
.ti -1c
.BI "const TQStyleSheet * \fBstyleSheet\fR () const"
.br
.ti -1c
.BI "enum \fBDisplayMode\fR { DisplayBlock, DisplayInline, DisplayListItem, DisplayNone }"
.br
.ti -1c
.BI "DisplayMode \fBdisplayMode\fR () const"
.br
.ti -1c
.BI "void \fBsetDisplayMode\fR ( DisplayMode m )"
.br
.ti -1c
.BI "int \fBalignment\fR () const"
.br
.ti -1c
.BI "void \fBsetAlignment\fR ( int f )"
.br
.ti -1c
.BI "enum \fBVerticalAlignment\fR { VAlignBaseline, VAlignSub, VAlignSuper }"
.br
.ti -1c
.BI "VerticalAlignment \fBverticalAlignment\fR () const"
.br
.ti -1c
.BI "void \fBsetVerticalAlignment\fR ( VerticalAlignment valign )"
.br
.ti -1c
.BI "int \fBfontWeight\fR () const"
.br
.ti -1c
.BI "void \fBsetFontWeight\fR ( int w )"
.br
.ti -1c
.BI "int \fBlogicalFontSize\fR () const"
.br
.ti -1c
.BI "void \fBsetLogicalFontSize\fR ( int s )"
.br
.ti -1c
.BI "int \fBlogicalFontSizeStep\fR () const"
.br
.ti -1c
.BI "void \fBsetLogicalFontSizeStep\fR ( int s )"
.br
.ti -1c
.BI "int \fBfontSize\fR () const"
.br
.ti -1c
.BI "void \fBsetFontSize\fR ( int s )"
.br
.ti -1c
.BI "TQString \fBfontFamily\fR () const"
.br
.ti -1c
.BI "void \fBsetFontFamily\fR ( const TQString & fam )"
.br
.ti -1c
.BI "int numberOfColumns () const \fI(obsolete)\fR"
.br
.ti -1c
.BI "void setNumberOfColumns ( int ncols ) \fI(obsolete)\fR"
.br
.ti -1c
.BI "TQColor \fBcolor\fR () const"
.br
.ti -1c
.BI "void \fBsetColor\fR ( const TQColor & c )"
.br
.ti -1c
.BI "bool \fBfontItalic\fR () const"
.br
.ti -1c
.BI "void \fBsetFontItalic\fR ( bool italic )"
.br
.ti -1c
.BI "bool \fBdefinesFontItalic\fR () const"
.br
.ti -1c
.BI "bool \fBfontUnderline\fR () const"
.br
.ti -1c
.BI "void \fBsetFontUnderline\fR ( bool underline )"
.br
.ti -1c
.BI "bool \fBdefinesFontUnderline\fR () const"
.br
.ti -1c
.BI "bool \fBfontStrikeOut\fR () const"
.br
.ti -1c
.BI "void \fBsetFontStrikeOut\fR ( bool strikeOut )"
.br
.ti -1c
.BI "bool \fBdefinesFontStrikeOut\fR () const"
.br
.ti -1c
.BI "bool \fBisAnchor\fR () const"
.br
.ti -1c
.BI "void \fBsetAnchor\fR ( bool anc )"
.br
.ti -1c
.BI "enum \fBWhiteSpaceMode\fR { WhiteSpaceNormal, WhiteSpacePre, WhiteSpaceNoWrap }"
.br
.ti -1c
.BI "WhiteSpaceMode \fBwhiteSpaceMode\fR () const"
.br
.ti -1c
.BI "void \fBsetWhiteSpaceMode\fR ( WhiteSpaceMode m )"
.br
.ti -1c
.BI "enum \fBMargin\fR { MarginLeft, MarginRight, MarginTop, MarginBottom, MarginFirstLine, MarginAll, MarginVertical, MarginHorizontal }"
.br
.ti -1c
.BI "int \fBmargin\fR ( Margin m ) const"
.br
.ti -1c
.BI "void \fBsetMargin\fR ( Margin m, int v )"
.br
.ti -1c
.BI "enum \fBListStyle\fR { ListDisc, ListCircle, ListSquare, ListDecimal, ListLowerAlpha, ListUpperAlpha }"
.br
.ti -1c
.BI "ListStyle \fBlistStyle\fR () const"
.br
.ti -1c
.BI "void \fBsetListStyle\fR ( ListStyle s )"
.br
.ti -1c
.BI "TQString \fBcontexts\fR () const"
.br
.ti -1c
.BI "void \fBsetContexts\fR ( const TQString & c )"
.br
.ti -1c
.BI "bool \fBallowedInContext\fR ( const TQStyleSheetItem * s ) const"
.br
.ti -1c
.BI "bool \fBselfNesting\fR () const"
.br
.ti -1c
.BI "void \fBsetSelfNesting\fR ( bool nesting )"
.br
.ti -1c
.BI "int lineSpacing () const \fI(obsolete)\fR"
.br
.in -1c
.SH DESCRIPTION
The TQStyleSheetItem class provides an encapsulation of a set of text styles.
.PP
A style sheet item consists of a name and a set of attributes that specifiy its font, color, etc. When used in a style sheet (see styleSheet()), items define the name() of a rich text tag and the display property changes associated with it.
.PP
The display mode attribute indicates whether the item is a block, an inline element or a list element; see setDisplayMode(). The treatment of whitespace is controlled by the white space mode; see setWhiteSpaceMode(). An item's margins are set with setMargin(), In the case of list items, the list style is set with setListStyle(). An item may be a hypertext link anchor; see setAnchor(). Other attributes are set with setAlignment(), setVerticalAlignment(), setFontFamily(), setFontSize(), setFontWeight(), setFontItalic(), setFontUnderline(), setFontStrikeOut and setColor().
.PP
See also Text Related Classes.
.SS "Member Type Documentation"
.SH "TQStyleSheetItem::DisplayMode"
This enum type defines the way adjacent elements are displayed.
.TP
\fCTQStyleSheetItem::DisplayBlock\fR - elements are displayed as a rectangular block (e.g. \fC<p>...</p>\fR).
.TP
\fCTQStyleSheetItem::DisplayInline\fR - elements are displayed in a horizontally flowing sequence (e.g. \fC<em>...</em>\fR).
.TP
\fCTQStyleSheetItem::DisplayListItem\fR - elements are displayed in a vertical sequence (e.g. \fC<li>...</li>\fR).
.TP
\fCTQStyleSheetItem::DisplayNone\fR - elements are not displayed at all.
.SH "TQStyleSheetItem::ListStyle"
This enum type defines how the items in a list are prefixed when displayed.
.TP
\fCTQStyleSheetItem::ListDisc\fR - a filled circle (i.e. a bullet)
.TP
\fCTQStyleSheetItem::ListCircle\fR - an unfilled circle
.TP
\fCTQStyleSheetItem::ListSquare\fR - a filled square
.TP
\fCTQStyleSheetItem::ListDecimal\fR - an integer in base 10: \fI1\fR, \fI2\fR, \fI3\fR, ...
.TP
\fCTQStyleSheetItem::ListLowerAlpha\fR - a lowercase letter: \fIa\fR, \fIb\fR, \fIc\fR, ...
.TP
\fCTQStyleSheetItem::ListUpperAlpha\fR - an uppercase letter: \fIA\fR, \fIB\fR, \fIC\fR, ...
.SH "TQStyleSheetItem::Margin"
.TP
\fCTQStyleSheetItem::MarginLeft\fR - left margin
.TP
\fCTQStyleSheetItem::MarginRight\fR - right margin
.TP
\fCTQStyleSheetItem::MarginTop\fR - top margin
.TP
\fCTQStyleSheetItem::MarginBottom\fR - bottom margin
.TP
\fCTQStyleSheetItem::MarginAll\fR - all margins (left, right, top and bottom)
.TP
\fCTQStyleSheetItem::MarginVertical\fR - top and bottom margins
.TP
\fCTQStyleSheetItem::MarginHorizontal\fR - left and right margins
.TP
\fCTQStyleSheetItem::MarginFirstLine\fR - margin (indentation) of the first line of a paragarph (in addition to the MarginLeft of the paragraph)
.SH "TQStyleSheetItem::VerticalAlignment"
This enum type defines the way elements are aligned vertically. This is only supported for text elements.
.TP
\fCTQStyleSheetItem::VAlignBaseline\fR - align the baseline of the element (or the bottom, if the element doesn't have a baseline) with the baseline of the parent
.TP
\fCTQStyleSheetItem::VAlignSub\fR - subscript the element
.TP
\fCTQStyleSheetItem::VAlignSuper\fR - superscript the element
.SH "TQStyleSheetItem::WhiteSpaceMode"
This enum defines the ways in which TQStyleSheet can treat whitespace.
.TP
\fCTQStyleSheetItem::WhiteSpaceNormal\fR - any sequence of whitespace (including line-breaks) is equivalent to a single space.
.TP
\fCTQStyleSheetItem::WhiteSpacePre\fR - whitespace must be output exactly as given in the input.
.TP
\fCTQStyleSheetItem::WhiteSpaceNoWrap\fR - multiple spaces are collapsed as with WhiteSpaceNormal, but no automatic line-breaks occur. To break lines manually, use the \fC<br>\fR tag.
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQStyleSheetItem::TQStyleSheetItem ( TQStyleSheet * parent, const TQString & name )"
Constructs a new style called \fIname\fR for the stylesheet \fIparent\fR.
.PP
All properties in TQStyleSheetItem are initially in the "do not change" state, except display mode, which defaults to DisplayInline.
.SH "TQStyleSheetItem::TQStyleSheetItem ( const TQStyleSheetItem & other )"
Copy constructor. Constructs a copy of \fIother\fR that is not bound to any style sheet.
.SH "TQStyleSheetItem::~TQStyleSheetItem ()"
Destroys the style. Note that TQStyleSheetItem objects become owned by TQStyleSheet when they are created.
.SH "int TQStyleSheetItem::alignment () const"
Returns the alignment of this style. Possible values are AlignAuto, AlignLeft, AlignRight, AlignCenter or AlignJustify.
.PP
See also setAlignment() and TQt::AlignmentFlags.
.SH "bool TQStyleSheetItem::allowedInContext ( const TQStyleSheetItem * s ) const"
Returns TRUE if this style can be nested into an element of style \fIs\fR; otherwise returns FALSE.
.PP
See also contexts() and setContexts().
.SH "TQColor TQStyleSheetItem::color () const"
Returns the text color of this style or an invalid color if no color has been set.
.PP
See also setColor() and TQColor::isValid().
.SH "TQString TQStyleSheetItem::contexts () const"
Returns a space-separated list of names of styles that may contain elements of this style. If nothing has been set, contexts() returns an empty string, which indicates that this style can be nested everywhere.
.PP
See also setContexts().
.SH "bool TQStyleSheetItem::definesFontItalic () const"
Returns TRUE if the style defines a font shape; otherwise returns FALSE. A style does not define any shape until setFontItalic() is called.
.PP
See also setFontItalic() and fontItalic().
.SH "bool TQStyleSheetItem::definesFontStrikeOut () const"
Returns TRUE if the style defines a setting for the strikeOut property of the font; otherwise returns FALSE. A style does not define this until setFontStrikeOut() is called.
.PP
See also setFontStrikeOut() and fontStrikeOut().
.SH "bool TQStyleSheetItem::definesFontUnderline () const"
Returns TRUE if the style defines a setting for the underline property of the font; otherwise returns FALSE. A style does not define this until setFontUnderline() is called.
.PP
See also setFontUnderline() and fontUnderline().
.SH "DisplayMode TQStyleSheetItem::displayMode () const"
Returns the display mode of the style.
.PP
See also setDisplayMode().
.SH "TQString TQStyleSheetItem::fontFamily () const"
Returns the font family setting of the style. This is either a valid font family or TQString::null if no family has been set.
.PP
See also setFontFamily(), QFont::family(), and QFont::setFamily().
.SH "bool TQStyleSheetItem::fontItalic () const"
Returns TRUE if the style sets an italic font; otherwise returns FALSE.
.PP
See also setFontItalic() and definesFontItalic().
.SH "int TQStyleSheetItem::fontSize () const"
Returns the font size setting of the style. This is either a valid point size or TQStyleSheetItem::Undefined.
.PP
See also setFontSize(), QFont::pointSize(), and QFont::setPointSize().
.SH "bool TQStyleSheetItem::fontStrikeOut () const"
Returns TRUE if the style sets a strike out font; otherwise returns FALSE.
.PP
See also setFontStrikeOut() and definesFontStrikeOut().
.SH "bool TQStyleSheetItem::fontUnderline () const"
Returns TRUE if the style sets an underlined font; otherwise returns FALSE.
.PP
See also setFontUnderline() and definesFontUnderline().
.SH "int TQStyleSheetItem::fontWeight () const"
Returns the font weight setting of the style. This is either a valid QFont::Weight or the value TQStyleSheetItem::Undefined.
.PP
See also setFontWeight() and QFont.
.SH "bool TQStyleSheetItem::isAnchor () const"
Returns whether this style is an anchor.
.PP
See also setAnchor().
.SH "int TQStyleSheetItem::lineSpacing () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Returns the linespacing
.SH "ListStyle TQStyleSheetItem::listStyle () const"
Returns the list style of the style.
.PP
See also setListStyle() and ListStyle.
.SH "int TQStyleSheetItem::logicalFontSize () const"
Returns the logical font size setting of the style. This is either a valid size between 1 and 7 or TQStyleSheetItem::Undefined.
.PP
See also setLogicalFontSize(), setLogicalFontSizeStep(), QFont::pointSize(), and QFont::setPointSize().
.SH "int TQStyleSheetItem::logicalFontSizeStep () const"
Returns the logical font size step of this style.
.PP
The default is 0. Tags such as \fCbig\fR define \fC+1\fR; \fCsmall\fR defines \fC-1\fR.
.PP
See also setLogicalFontSizeStep().
.SH "int TQStyleSheetItem::margin ( Margin m ) const"
Returns the width of margin \fIm\fR in pixels.
.PP
The margin, \fIm\fR, can be MarginLeft, MarginRight, MarginTop, MarginBottom, or MarginFirstLine.
.PP
See also setMargin() and Margin.
.SH "TQString TQStyleSheetItem::name () const"
Returns the name of the style item.
.SH "int TQStyleSheetItem::numberOfColumns () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Returns the number of columns for this style.
.PP
See also setNumberOfColumns(), displayMode(), and setDisplayMode().
.SH "TQStyleSheetItem & TQStyleSheetItem::operator= ( const TQStyleSheetItem & other )"
Assignment. Assings a copy of \fIother\fR that is not bound to any style sheet. Unbounds first from previous style sheet.
.SH "bool TQStyleSheetItem::selfNesting () const"
Returns TRUE if this style has self-nesting enabled; otherwise returns FALSE.
.PP
See also setSelfNesting().
.SH "void TQStyleSheetItem::setAlignment ( int f )"
Sets the alignment to \fIf\fR. This only makes sense for styles with a display mode of DisplayBlock. Possible values are AlignAuto, AlignLeft, AlignRight, AlignCenter or AlignJustify.
.PP
See also alignment(), displayMode(), and TQt::AlignmentFlags.
.SH "void TQStyleSheetItem::setAnchor ( bool anc )"
If \fIanc\fR is TRUE, sets this style to be an anchor (hypertext link); otherwise sets it to not be an anchor. Elements in this style link to other documents or anchors.
.PP
See also isAnchor().
.SH "void TQStyleSheetItem::setColor ( const TQColor & c )"
Sets the text color of this style to \fIc\fR.
.PP
See also color().
.SH "void TQStyleSheetItem::setContexts ( const TQString & c )"
Sets a space-separated list of names of styles that may contain elements of this style. If \fIc\fR is empty, the style can be nested everywhere.
.PP
See also contexts().
.SH "void TQStyleSheetItem::setDisplayMode ( DisplayMode m )"
Sets the display mode of the style to \fIm\fR.
.PP
See also displayMode().
.SH "void TQStyleSheetItem::setFontFamily ( const TQString & fam )"
Sets the font family setting of the style to \fIfam\fR.
.PP
See also fontFamily(), QFont::family(), and QFont::setFamily().
.SH "void TQStyleSheetItem::setFontItalic ( bool italic )"
If \fIitalic\fR is TRUE sets italic for the style; otherwise sets upright.
.PP
See also fontItalic() and definesFontItalic().
.SH "void TQStyleSheetItem::setFontSize ( int s )"
Sets the font size setting of the style to \fIs\fR points.
.PP
See also fontSize(), QFont::pointSize(), and QFont::setPointSize().
.SH "void TQStyleSheetItem::setFontStrikeOut ( bool strikeOut )"
If \fIstrikeOut\fR is TRUE, sets strike out for the style; otherwise sets no strike out.
.PP
See also fontStrikeOut() and definesFontStrikeOut().
.SH "void TQStyleSheetItem::setFontUnderline ( bool underline )"
If \fIunderline\fR is TRUE, sets underline for the style; otherwise sets no underline.
.PP
See also fontUnderline() and definesFontUnderline().
.SH "void TQStyleSheetItem::setFontWeight ( int w )"
Sets the font weight setting of the style to \fIw\fR. Valid values are those defined by QFont::Weight.
.PP
See also QFont and fontWeight().
.SH "void TQStyleSheetItem::setListStyle ( ListStyle s )"
Sets the list style of the style to \fIs\fR.
.PP
This is used by nested elements that have a display mode of DisplayListItem.
.PP
See also listStyle(), DisplayMode, and ListStyle.
.SH "void TQStyleSheetItem::setLogicalFontSize ( int s )"
Sets the logical font size setting of the style to \fIs\fR. Valid logical sizes are 1 to 7.
.PP
See also logicalFontSize(), QFont::pointSize(), and QFont::setPointSize().
.SH "void TQStyleSheetItem::setLogicalFontSizeStep ( int s )"
Sets the logical font size step of this style to \fIs\fR.
.PP
See also logicalFontSizeStep().
.SH "void TQStyleSheetItem::setMargin ( Margin m, int v )"
Sets the width of margin \fIm\fR to \fIv\fR pixels.
.PP
The margin, \fIm\fR, can be MarginLeft, MarginRight, MarginTop, MarginBottom, MarginFirstLine, MarginAll, MarginVertical or MarginHorizontal. The value \fIv\fR must be >= 0.
.PP
See also margin().
.SH "void TQStyleSheetItem::setNumberOfColumns ( int ncols )"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Sets the number of columns for this style. Elements in the style are divided into columns.
.PP
This makes sense only if the style uses a block display mode (see TQStyleSheetItem::DisplayMode).
.PP
See also numberOfColumns().
.SH "void TQStyleSheetItem::setSelfNesting ( bool nesting )"
Sets the self-nesting property for this style to \fInesting\fR.
.PP
In order to support "dirty" HTML, paragraphs \fC<p>\fR and list items \fC<li>\fR are not self-nesting. This means that starting a new paragraph or list item automatically closes the previous one.
.PP
See also selfNesting().
.SH "void TQStyleSheetItem::setVerticalAlignment ( VerticalAlignment valign )"
Sets the vertical alignment to \fIvalign\fR. Possible values are VAlignBaseline, VAlignSub or VAlignSuper.
.PP
The vertical alignment property is not inherited.
.PP
See also verticalAlignment().
.SH "void TQStyleSheetItem::setWhiteSpaceMode ( WhiteSpaceMode m )"
Sets the whitespace mode to \fIm\fR.
.PP
See also WhiteSpaceMode.
.SH "TQStyleSheet * TQStyleSheetItem::styleSheet ()"
Returns the style sheet this item is in.
.SH "const TQStyleSheet * TQStyleSheetItem::styleSheet () const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the style sheet this item is in.
.SH "VerticalAlignment TQStyleSheetItem::verticalAlignment () const"
Returns the vertical alignment of the style. Possible values are VAlignBaseline, VAlignSub or VAlignSuper.
.PP
See also setVerticalAlignment().
.SH "WhiteSpaceMode TQStyleSheetItem::whiteSpaceMode () const"
Returns the whitespace mode.
.PP
See also setWhiteSpaceMode() and WhiteSpaceMode.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqstylesheetitem.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqstylesheetitem.3qt) and the Qt
version (3.3.8).