source: trunk/doc/html/qstylesheet-h.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 8.3 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qstylesheet.h:1 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>qstylesheet.h Include File</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qstylesheet.h</h1>
33
34<p>This is the verbatim text of the qstylesheet.h include file. It is provided only for illustration; the copyright remains with Trolltech.
35<hr>
36<pre>
37/****************************************************************************
38** $Id: qstylesheet-h.html 2051 2007-02-21 10:04:20Z chehrlic $
39**
40** Definition of the QStyleSheet class
41**
42** Created : 990101
43**
44** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
45**
46** This file is part of the kernel module of the Qt GUI Toolkit.
47**
48** This file may be distributed under the terms of the Q Public License
49** as defined by Trolltech ASA of Norway and appearing in the file
50** LICENSE.QPL included in the packaging of this file.
51**
52** This file may be distributed and/or modified under the terms of the
53** GNU General Public License version 2 as published by the Free Software
54** Foundation and appearing in the file LICENSE.GPL included in the
55** packaging of this file.
56**
57** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
58** licenses may use this file in accordance with the Qt Commercial License
59** Agreement provided with the Software.
60**
61** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
62** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
63**
64** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
65** information about Qt Commercial License Agreements.
66** See http://www.trolltech.com/qpl/ for QPL licensing information.
67** See http://www.trolltech.com/gpl/ for GPL licensing information.
68**
69** Contact info@trolltech.com if any conditions of this licensing are
70** not clear to you.
71**
72**********************************************************************/
73
74#ifndef QSTYLESHEET_H
75#define QSTYLESHEET_H
76
77#ifndef QT_H
78#include "qstring.h"
79#include "qvaluelist.h"
80#include "qptrvector.h"
81#include "qdict.h"
82#include "qobject.h"
83#endif // QT_H
84
85#ifndef QT_NO_RICHTEXT
86
87class QStyleSheet;
88class QTextDocument;
89template&lt;class Key, class T&gt; class QMap;
90class QStyleSheetItemData;
91
92class Q_EXPORT QStyleSheetItem : public Qt
93{
94public:
95 QStyleSheetItem( QStyleSheet* parent, const QString&amp; name );
96 QStyleSheetItem( const QStyleSheetItem &amp; );
97 ~QStyleSheetItem();
98
99 QStyleSheetItem&amp; operator=( const QStyleSheetItem&amp; other );
100
101 QString name() const;
102
103 QStyleSheet* styleSheet();
104 const QStyleSheet* styleSheet() const;
105
106 enum AdditionalStyleValues { Undefined = - 1};
107
108 enum DisplayMode {
109 DisplayBlock,
110 DisplayInline,
111 DisplayListItem,
112 DisplayNone
113#ifndef Q_QDOC
114 , DisplayModeUndefined = -1
115#endif
116 };
117
118 DisplayMode displayMode() const;
119 void setDisplayMode(DisplayMode m);
120
121 int alignment() const;
122 void setAlignment( int f);
123
124 enum VerticalAlignment {
125 VAlignBaseline,
126 VAlignSub,
127 VAlignSuper
128 };
129
130 VerticalAlignment verticalAlignment() const;
131 void setVerticalAlignment( VerticalAlignment valign );
132
133 int fontWeight() const;
134 void setFontWeight(int w);
135
136 int logicalFontSize() const;
137 void setLogicalFontSize(int s);
138
139 int logicalFontSizeStep() const;
140 void setLogicalFontSizeStep( int s );
141
142 int fontSize() const;
143 void setFontSize(int s);
144
145 QString fontFamily() const;
146 void setFontFamily( const QString&amp; );
147
148 int numberOfColumns() const;
149 void setNumberOfColumns(int ncols);
150
151 QColor color() const;
152 void setColor( const QColor &amp;);
153
154 bool fontItalic() const;
155 void setFontItalic( bool );
156 bool definesFontItalic() const;
157
158 bool fontUnderline() const;
159 void setFontUnderline( bool );
160 bool definesFontUnderline() const;
161
162 bool fontStrikeOut() const;
163 void setFontStrikeOut( bool );
164 bool definesFontStrikeOut() const;
165
166 bool isAnchor() const;
167 void setAnchor(bool anc);
168
169 enum WhiteSpaceMode {
170 WhiteSpaceNormal,
171 WhiteSpacePre,
172 WhiteSpaceNoWrap
173#ifndef Q_QDOC
174 , WhiteSpaceModeUndefined = -1
175#endif
176 };
177 WhiteSpaceMode whiteSpaceMode() const;
178 void setWhiteSpaceMode(WhiteSpaceMode m);
179
180 enum Margin {
181 MarginLeft,
182 MarginRight,
183 MarginTop,
184 MarginBottom,
185 MarginFirstLine,
186 MarginAll,
187 MarginVertical,
188 MarginHorizontal
189#ifndef Q_QDOC
190 , MarginUndefined = -1
191#endif
192 };
193
194 int margin( Margin m) const;
195 void setMargin( Margin, int);
196
197 enum ListStyle {
198 ListDisc,
199 ListCircle,
200 ListSquare,
201 ListDecimal,
202 ListLowerAlpha,
203 ListUpperAlpha
204#ifndef Q_QDOC
205 , ListStyleUndefined = -1
206#endif
207 };
208
209 ListStyle listStyle() const;
210 void setListStyle( ListStyle );
211
212 QString contexts() const;
213 void setContexts( const QString&amp; );
214 bool allowedInContext( const QStyleSheetItem* ) const;
215
216 bool selfNesting() const;
217 void setSelfNesting( bool );
218
219 void setLineSpacing( int ls );
220 int lineSpacing() const;
221
222private:
223 void init();
224 QStyleSheetItemData* d;
225};
226
227
228#if defined(Q_TEMPLATEDLL)
229// MOC_SKIP_BEGIN
230Q_TEMPLATE_EXTERN template class Q_EXPORT QDict&lt;QStyleSheetItem&gt;;
231Q_TEMPLATE_EXTERN template class Q_EXPORT QValueList&lt; QPtrVector&lt;QStyleSheetItem&gt; &gt;;
232Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrVector&lt;QStyleSheetItem&gt;;
233Q_TEMPLATE_EXTERN template class Q_EXPORT QValueList&lt;QStyleSheetItem::ListStyle&gt;;
234// MOC_SKIP_END
235#endif
236
237#ifndef QT_NO_TEXTCUSTOMITEM
238class QTextCustomItem;
239#endif
240
241class Q_EXPORT QStyleSheet : public QObject
242{
243 Q_OBJECT
244public:
245 QStyleSheet( QObject *parent=0, const char *name=0 );
246 virtual ~QStyleSheet();
247
248 static QStyleSheet* defaultSheet();
249 static void setDefaultSheet( QStyleSheet* );
250
251
252 QStyleSheetItem* item( const QString&amp; name);
253 const QStyleSheetItem* item( const QString&amp; name) const;
254
255 void insert( QStyleSheetItem* item);
256
257#ifndef QT_NO_TEXTCUSTOMITEM
258 virtual QTextCustomItem* tag( const QString&amp; name,
259 const QMap&lt;QString, QString&gt; &amp;attr,
260 const QString&amp; context,
261 const QMimeSourceFactory&amp; factory,
262 bool emptyTag, QTextDocument *doc ) const;
263#endif
264 static QString escape( const QString&amp; );
265 static QString convertFromPlainText( const QString&amp;,
266 QStyleSheetItem::WhiteSpaceMode mode = QStyleSheetItem::WhiteSpacePre );
267 static bool mightBeRichText( const QString&amp; );
268
269 virtual void scaleFont( QFont&amp; font, int logicalSize ) const;
270
271 virtual void error( const QString&amp; ) const;
272
273private:
274 void init();
275 QDict&lt;QStyleSheetItem&gt; styles;
276 QStyleSheetItem* nullstyle;
277private: // Disabled copy constructor and operator=
278#if defined(Q_DISABLE_COPY)
279 QStyleSheet( const QStyleSheet &amp; );
280 QStyleSheet &amp;operator=( const QStyleSheet &amp; );
281#endif
282};
283
284#endif // QT_NO_RICHTEXT
285
286#endif // QSTYLESHEET_H
287</pre>
288<!-- eof -->
289<p><address><hr><div align=center>
290<table width=100% cellspacing=0 border=0><tr>
291<td>Copyright &copy; 2007
292<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
293<td align=right><div align=right>Qt 3.3.8</div>
294</table></div></address></body>
295</html>
Note: See TracBrowser for help on using the repository browser.