0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the QtGui of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
15 |
**
|
|
16 |
** GNU Lesser General Public License Usage
|
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
18 |
** General Public License version 2.1 as published by the Free Software
|
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
20 |
** packaging of this file. Please review the following information to
|
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
23 |
**
|
|
24 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
27 |
**
|
|
28 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
** $QT_END_LICENSE$
|
|
39 |
**
|
|
40 |
****************************************************************************/
|
|
41 |
|
|
42 |
#ifndef QS60STYLE_P_H
|
|
43 |
#define QS60STYLE_P_H
|
|
44 |
|
|
45 |
#include "qs60style.h"
|
|
46 |
#include "qcommonstyle_p.h"
|
|
47 |
#include <QtCore/qhash.h>
|
|
48 |
|
|
49 |
//
|
|
50 |
// W A R N I N G
|
|
51 |
// -------------
|
|
52 |
//
|
|
53 |
// This file is not part of the Qt API. It exists purely as an
|
|
54 |
// implementation detail. This header file may change from version to
|
|
55 |
// version without notice, or even be removed.
|
|
56 |
//
|
|
57 |
// We mean it.
|
|
58 |
//
|
|
59 |
|
|
60 |
QT_BEGIN_NAMESPACE
|
|
61 |
|
|
62 |
const int MAX_NON_CUSTOM_PIXELMETRICS = 92;
|
|
63 |
const int CUSTOMVALUESCOUNT = 4;
|
|
64 |
enum {
|
|
65 |
PM_Custom_FrameCornerWidth = MAX_NON_CUSTOM_PIXELMETRICS,
|
|
66 |
PM_Custom_FrameCornerHeight,
|
|
67 |
PM_Custom_BoldLineWidth,
|
|
68 |
PM_Custom_ThinLineWidth
|
|
69 |
};
|
|
70 |
const int MAX_PIXELMETRICS = MAX_NON_CUSTOM_PIXELMETRICS + CUSTOMVALUESCOUNT;
|
|
71 |
|
|
72 |
typedef struct {
|
|
73 |
unsigned short height;
|
|
74 |
unsigned short width;
|
|
75 |
int major_version;
|
|
76 |
int minor_version;
|
|
77 |
bool mirroring; // TODO: (nice to have) Use Qt::LayoutDirection
|
|
78 |
const char* layoutName;
|
|
79 |
} layoutHeader;
|
|
80 |
|
|
81 |
#ifdef Q_OS_SYMBIAN
|
|
82 |
NONSHARABLE_CLASS (QS60StyleEnums)
|
|
83 |
#else
|
|
84 |
class QS60StyleEnums
|
|
85 |
#endif
|
|
86 |
: public QObject
|
|
87 |
{
|
|
88 |
#ifndef Q_WS_S60
|
|
89 |
Q_OBJECT
|
|
90 |
Q_ENUMS(FontCategories)
|
|
91 |
Q_ENUMS(SkinParts)
|
|
92 |
Q_ENUMS(ColorLists)
|
|
93 |
#endif // !Q_WS_S60
|
|
94 |
|
|
95 |
public:
|
|
96 |
// S60 look-and-feel font categories
|
|
97 |
enum FontCategories {
|
|
98 |
FC_Undefined,
|
|
99 |
FC_Primary,
|
|
100 |
FC_Secondary,
|
|
101 |
FC_Title,
|
|
102 |
FC_PrimarySmall,
|
|
103 |
FC_Digital
|
|
104 |
};
|
|
105 |
|
|
106 |
enum SkinParts {
|
|
107 |
SP_QgnGrafBarWait,
|
|
108 |
SP_QgnGrafBarFrameCenter,
|
|
109 |
SP_QgnGrafBarFrameSideL,
|
|
110 |
SP_QgnGrafBarFrameSideR,
|
|
111 |
SP_QgnGrafBarProgress,
|
|
112 |
SP_QgnGrafScrollArrowDown,
|
|
113 |
SP_QgnGrafScrollArrowLeft,
|
|
114 |
SP_QgnGrafScrollArrowRight,
|
|
115 |
SP_QgnGrafScrollArrowUp,
|
|
116 |
SP_QgnGrafTabActiveL,
|
|
117 |
SP_QgnGrafTabActiveM,
|
|
118 |
SP_QgnGrafTabActiveR,
|
|
119 |
SP_QgnGrafTabPassiveL,
|
|
120 |
SP_QgnGrafTabPassiveM,
|
|
121 |
SP_QgnGrafTabPassiveR,
|
|
122 |
SP_QgnIndiCheckboxOff,
|
|
123 |
SP_QgnIndiCheckboxOn,
|
|
124 |
SP_QgnIndiHlColSuper, // Available in S60 release 3.2 and later.
|
|
125 |
SP_QgnIndiHlExpSuper, // Available in S60 release 3.2 and later.
|
|
126 |
SP_QgnIndiHlLineBranch, // Available in S60 release 3.2 and later.
|
|
127 |
SP_QgnIndiHlLineEnd, // Available in S60 release 3.2 and later.
|
|
128 |
SP_QgnIndiHlLineStraight, // Available in S60 release 3.2 and later.
|
|
129 |
SP_QgnIndiMarkedAdd,
|
|
130 |
SP_QgnIndiNaviArrowLeft,
|
|
131 |
SP_QgnIndiNaviArrowRight,
|
|
132 |
SP_QgnIndiRadiobuttOff,
|
|
133 |
SP_QgnIndiRadiobuttOn,
|
|
134 |
SP_QgnIndiSliderEdit,
|
|
135 |
SP_QgnIndiSubMenu,
|
|
136 |
SP_QgnNoteErased,
|
|
137 |
SP_QgnNoteError,
|
|
138 |
SP_QgnNoteInfo,
|
|
139 |
SP_QgnNoteOk,
|
|
140 |
SP_QgnNoteQuery,
|
|
141 |
SP_QgnNoteWarning,
|
|
142 |
SP_QgnPropFileSmall,
|
|
143 |
SP_QgnPropFolderCurrent,
|
|
144 |
SP_QgnPropFolderSmall,
|
|
145 |
SP_QgnPropFolderSmallNew,
|
|
146 |
SP_QgnPropPhoneMemcLarge,
|
|
147 |
SP_QsnCpScrollHandleBottomPressed, //ScrollBar handle, pressed state
|
|
148 |
SP_QsnCpScrollHandleMiddlePressed,
|
|
149 |
SP_QsnCpScrollHandleTopPressed,
|
|
150 |
SP_QsnBgScreen,
|
|
151 |
SP_QsnCpScrollBgBottom,
|
|
152 |
SP_QsnCpScrollBgMiddle,
|
|
153 |
SP_QsnCpScrollBgTop,
|
|
154 |
SP_QsnCpScrollHandleBottom,
|
|
155 |
SP_QsnCpScrollHandleMiddle,
|
|
156 |
SP_QsnCpScrollHandleTop,
|
|
157 |
SP_QsnFrButtonTbCornerTl, // Button, normal state
|
|
158 |
SP_QsnFrButtonTbCornerTr,
|
|
159 |
SP_QsnFrButtonTbCornerBl,
|
|
160 |
SP_QsnFrButtonTbCornerBr,
|
|
161 |
SP_QsnFrButtonTbSideT,
|
|
162 |
SP_QsnFrButtonTbSideB,
|
|
163 |
SP_QsnFrButtonTbSideL,
|
|
164 |
SP_QsnFrButtonTbSideR,
|
|
165 |
SP_QsnFrButtonTbCenter,
|
|
166 |
SP_QsnFrButtonTbCornerTlPressed, // Button, pressed state
|
|
167 |
SP_QsnFrButtonTbCornerTrPressed,
|
|
168 |
SP_QsnFrButtonTbCornerBlPressed,
|
|
169 |
SP_QsnFrButtonTbCornerBrPressed,
|
|
170 |
SP_QsnFrButtonTbSideTPressed,
|
|
171 |
SP_QsnFrButtonTbSideBPressed,
|
|
172 |
SP_QsnFrButtonTbSideLPressed,
|
|
173 |
SP_QsnFrButtonTbSideRPressed,
|
|
174 |
SP_QsnFrButtonTbCenterPressed,
|
|
175 |
SP_QsnFrCaleCornerTl, // calendar grid item
|
|
176 |
SP_QsnFrCaleCornerTr,
|
|
177 |
SP_QsnFrCaleCornerBl,
|
|
178 |
SP_QsnFrCaleCornerBr,
|
|
179 |
SP_QsnFrCaleGSideT,
|
|
180 |
SP_QsnFrCaleGSideB,
|
|
181 |
SP_QsnFrCaleGSideL,
|
|
182 |
SP_QsnFrCaleGSideR,
|
|
183 |
SP_QsnFrCaleCenter,
|
|
184 |
SP_QsnFrCaleHeadingCornerTl, // calendar grid header
|
|
185 |
SP_QsnFrCaleHeadingCornerTr,
|
|
186 |
SP_QsnFrCaleHeadingCornerBl,
|
|
187 |
SP_QsnFrCaleHeadingCornerBr,
|
|
188 |
SP_QsnFrCaleHeadingSideT,
|
|
189 |
SP_QsnFrCaleHeadingSideB,
|
|
190 |
SP_QsnFrCaleHeadingSideL,
|
|
191 |
SP_QsnFrCaleHeadingSideR,
|
|
192 |
SP_QsnFrCaleHeadingCenter,
|
|
193 |
SP_QsnFrInputCornerTl, // Text input field
|
|
194 |
SP_QsnFrInputCornerTr,
|
|
195 |
SP_QsnFrInputCornerBl,
|
|
196 |
SP_QsnFrInputCornerBr,
|
|
197 |
SP_QsnFrInputSideT,
|
|
198 |
SP_QsnFrInputSideB,
|
|
199 |
SP_QsnFrInputSideL,
|
|
200 |
SP_QsnFrInputSideR,
|
|
201 |
SP_QsnFrInputCenter,
|
|
202 |
SP_QsnFrListCornerTl, // List background
|
|
203 |
SP_QsnFrListCornerTr,
|
|
204 |
SP_QsnFrListCornerBl,
|
|
205 |
SP_QsnFrListCornerBr,
|
|
206 |
SP_QsnFrListSideT,
|
|
207 |
SP_QsnFrListSideB,
|
|
208 |
SP_QsnFrListSideL,
|
|
209 |
SP_QsnFrListSideR,
|
|
210 |
SP_QsnFrListCenter,
|
|
211 |
SP_QsnFrPopupCornerTl, // Option menu background
|
|
212 |
SP_QsnFrPopupCornerTr,
|
|
213 |
SP_QsnFrPopupCornerBl,
|
|
214 |
SP_QsnFrPopupCornerBr,
|
|
215 |
SP_QsnFrPopupSideT,
|
|
216 |
SP_QsnFrPopupSideB,
|
|
217 |
SP_QsnFrPopupSideL,
|
|
218 |
SP_QsnFrPopupSideR,
|
|
219 |
SP_QsnFrPopupCenter,
|
|
220 |
SP_QsnFrPopupPreviewCornerTl, // tool tip background
|
|
221 |
SP_QsnFrPopupPreviewCornerTr,
|
|
222 |
SP_QsnFrPopupPreviewCornerBl,
|
|
223 |
SP_QsnFrPopupPreviewCornerBr,
|
|
224 |
SP_QsnFrPopupPreviewSideT,
|
|
225 |
SP_QsnFrPopupPreviewSideB,
|
|
226 |
SP_QsnFrPopupPreviewSideL,
|
|
227 |
SP_QsnFrPopupPreviewSideR,
|
|
228 |
SP_QsnFrPopupPreviewCenter,
|
|
229 |
SP_QsnFrSetOptCornerTl, // Settings list
|
|
230 |
SP_QsnFrSetOptCornerTr,
|
|
231 |
SP_QsnFrSetOptCornerBl,
|
|
232 |
SP_QsnFrSetOptCornerBr,
|
|
233 |
SP_QsnFrSetOptSideT,
|
|
234 |
SP_QsnFrSetOptSideB,
|
|
235 |
SP_QsnFrSetOptSideL,
|
|
236 |
SP_QsnFrSetOptSideR,
|
|
237 |
SP_QsnFrSetOptCenter,
|
|
238 |
SP_QsnFrPopupSubCornerTl, // Toolbar background
|
|
239 |
SP_QsnFrPopupSubCornerTr,
|
|
240 |
SP_QsnFrPopupSubCornerBl,
|
|
241 |
SP_QsnFrPopupSubCornerBr,
|
|
242 |
SP_QsnFrPopupSubSideT,
|
|
243 |
SP_QsnFrPopupSubSideB,
|
|
244 |
SP_QsnFrPopupSubSideL,
|
|
245 |
SP_QsnFrPopupSubSideR,
|
|
246 |
SP_QsnFrPopupSubCenter,
|
|
247 |
SP_QsnFrSctrlButtonCornerTl, // Toolbar button
|
|
248 |
SP_QsnFrSctrlButtonCornerTr,
|
|
249 |
SP_QsnFrSctrlButtonCornerBl,
|
|
250 |
SP_QsnFrSctrlButtonCornerBr,
|
|
251 |
SP_QsnFrSctrlButtonSideT,
|
|
252 |
SP_QsnFrSctrlButtonSideB,
|
|
253 |
SP_QsnFrSctrlButtonSideL,
|
|
254 |
SP_QsnFrSctrlButtonSideR,
|
|
255 |
SP_QsnFrSctrlButtonCenter,
|
|
256 |
SP_QsnFrSctrlButtonCornerTlPressed, // Toolbar button, pressed
|
|
257 |
SP_QsnFrSctrlButtonCornerTrPressed,
|
|
258 |
SP_QsnFrSctrlButtonCornerBlPressed,
|
|
259 |
SP_QsnFrSctrlButtonCornerBrPressed,
|
|
260 |
SP_QsnFrSctrlButtonSideTPressed,
|
|
261 |
SP_QsnFrSctrlButtonSideBPressed,
|
|
262 |
SP_QsnFrSctrlButtonSideLPressed,
|
|
263 |
SP_QsnFrSctrlButtonSideRPressed,
|
|
264 |
SP_QsnFrSctrlButtonCenterPressed,
|
|
265 |
SP_QsnFrButtonCornerTlInactive, // Inactive button
|
|
266 |
SP_QsnFrButtonCornerTrInactive,
|
|
267 |
SP_QsnFrButtonCornerBlInactive,
|
|
268 |
SP_QsnFrButtonCornerBrInactive,
|
|
269 |
SP_QsnFrButtonSideTInactive,
|
|
270 |
SP_QsnFrButtonSideBInactive,
|
|
271 |
SP_QsnFrButtonSideLInactive,
|
|
272 |
SP_QsnFrButtonSideRInactive,
|
|
273 |
SP_QsnFrButtonCenterInactive,
|
|
274 |
SP_QsnFrNotepadCornerTl,
|
|
275 |
SP_QsnFrNotepadCornerTr,
|
|
276 |
SP_QsnFrNotepadCornerBl,
|
|
277 |
SP_QsnFrNotepadCornerBr,
|
|
278 |
SP_QsnFrNotepadSideT,
|
|
279 |
SP_QsnFrNotepadSideB,
|
|
280 |
SP_QsnFrNotepadSideL,
|
|
281 |
SP_QsnFrNotepadSideR,
|
|
282 |
SP_QsnFrNotepadCenter
|
|
283 |
};
|
|
284 |
|
|
285 |
enum ColorLists {
|
|
286 |
CL_QsnHighlightColors,
|
|
287 |
CL_QsnIconColors,
|
|
288 |
CL_QsnLineColors,
|
|
289 |
CL_QsnOtherColors,
|
|
290 |
CL_QsnParentColors,
|
|
291 |
CL_QsnTextColors
|
|
292 |
};
|
|
293 |
};
|
|
294 |
|
|
295 |
class QFocusFrame;
|
|
296 |
|
|
297 |
// Private class
|
|
298 |
#ifdef Q_OS_SYMBIAN
|
|
299 |
NONSHARABLE_CLASS (QS60StylePrivate)
|
|
300 |
#else
|
|
301 |
class QS60StylePrivate
|
|
302 |
#endif
|
|
303 |
: public QCommonStylePrivate
|
|
304 |
{
|
|
305 |
Q_DECLARE_PUBLIC(QS60Style)
|
|
306 |
|
|
307 |
public:
|
|
308 |
QS60StylePrivate();
|
|
309 |
~QS60StylePrivate();
|
|
310 |
|
|
311 |
enum SkinElements {
|
|
312 |
SE_ButtonNormal,
|
|
313 |
SE_ButtonPressed,
|
|
314 |
SE_FrameLineEdit,
|
|
315 |
SE_ProgressBarGrooveHorizontal,
|
|
316 |
SE_ProgressBarIndicatorHorizontal,
|
|
317 |
SE_ProgressBarGrooveVertical,
|
|
318 |
SE_ProgressBarIndicatorVertical,
|
|
319 |
SE_ScrollBarGrooveHorizontal,
|
|
320 |
SE_ScrollBarGrooveVertical,
|
|
321 |
SE_ScrollBarHandleHorizontal,
|
|
322 |
SE_ScrollBarHandleVertical,
|
|
323 |
SE_SliderHandleHorizontal,
|
|
324 |
SE_SliderHandleVertical,
|
|
325 |
SE_TabBarTabEastActive,
|
|
326 |
SE_TabBarTabEastInactive,
|
|
327 |
SE_TabBarTabNorthActive,
|
|
328 |
SE_TabBarTabNorthInactive,
|
|
329 |
SE_TabBarTabSouthActive,
|
|
330 |
SE_TabBarTabSouthInactive,
|
|
331 |
SE_TabBarTabWestActive,
|
|
332 |
SE_TabBarTabWestInactive,
|
|
333 |
SE_ListHighlight,
|
|
334 |
SE_OptionsMenu,
|
|
335 |
SE_SettingsList,
|
|
336 |
SE_TableItem,
|
|
337 |
SE_TableHeaderItem,
|
|
338 |
SE_ToolTip, //own graphic available on 3.2+ releases,
|
|
339 |
SE_ToolBar,
|
|
340 |
SE_ToolBarButton,
|
|
341 |
SE_ToolBarButtonPressed,
|
|
342 |
SE_PanelBackground,
|
|
343 |
SE_ScrollBarHandlePressedHorizontal, //only for 5.0+
|
|
344 |
SE_ScrollBarHandlePressedVertical,
|
|
345 |
SE_ButtonInactive,
|
|
346 |
SE_Editor,
|
|
347 |
};
|
|
348 |
|
|
349 |
enum SkinFrameElements {
|
|
350 |
SF_ButtonNormal,
|
|
351 |
SF_ButtonPressed,
|
|
352 |
SF_FrameLineEdit,
|
|
353 |
SF_ListHighlight,
|
|
354 |
SF_OptionsMenu,
|
|
355 |
SF_SettingsList,
|
|
356 |
SF_TableItem,
|
|
357 |
SF_TableHeaderItem,
|
|
358 |
SF_ToolTip,
|
|
359 |
SF_ToolBar,
|
|
360 |
SF_ToolBarButton,
|
|
361 |
SF_ToolBarButtonPressed,
|
|
362 |
SF_PanelBackground,
|
|
363 |
SF_ButtonInactive,
|
|
364 |
SF_Editor,
|
|
365 |
};
|
|
366 |
|
|
367 |
enum SkinElementFlag {
|
|
368 |
SF_PointNorth = 0x0001, // North = the default
|
|
369 |
SF_PointEast = 0x0002,
|
|
370 |
SF_PointSouth = 0x0004,
|
|
371 |
SF_PointWest = 0x0008,
|
|
372 |
|
|
373 |
SF_StateEnabled = 0x0010, // Enabled = the default
|
|
374 |
SF_StateDisabled = 0x0020,
|
|
375 |
SF_ColorSkinned = 0x0040,
|
|
376 |
};
|
|
377 |
|
|
378 |
enum CacheClearReason {
|
|
379 |
CC_UndefinedChange = 0,
|
|
380 |
CC_LayoutChange,
|
|
381 |
CC_ThemeChange
|
|
382 |
};
|
|
383 |
|
|
384 |
Q_DECLARE_FLAGS(SkinElementFlags, SkinElementFlag)
|
|
385 |
|
|
386 |
// draws skin element
|
|
387 |
static void drawSkinElement(SkinElements element, QPainter *painter,
|
|
388 |
const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
389 |
// draws a specific skin part
|
|
390 |
static void drawSkinPart(QS60StyleEnums::SkinParts part, QPainter *painter,
|
|
391 |
const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
392 |
// sets style property
|
|
393 |
void setStyleProperty(const char *name, const QVariant &value);
|
|
394 |
// sets specific style property
|
|
395 |
void setStyleProperty_specific(const char *name, const QVariant &value);
|
|
396 |
// gets style property
|
|
397 |
QVariant styleProperty(const char *name) const;
|
|
398 |
// gets specific style property
|
|
399 |
QVariant styleProperty_specific(const char *name) const;
|
|
400 |
// gets pixel metrics value
|
|
401 |
static short pixelMetric(int metric);
|
|
402 |
// gets color. 'index' is NOT 0-based.
|
|
403 |
// It corresponds to the enum key 1-based numbers of TAknsQsnXYZColorsIndex, not the values.
|
|
404 |
static QColor s60Color(QS60StyleEnums::ColorLists list,
|
|
405 |
int index, const QStyleOption *option);
|
|
406 |
// gets state specific color
|
|
407 |
static QColor stateColor(const QColor &color, const QStyleOption *option);
|
|
408 |
// gets lighter color than base color
|
|
409 |
static QColor lighterColor(const QColor &baseColor);
|
|
410 |
//deduces if the given widget should have separately themeable background
|
|
411 |
static bool drawsOwnThemeBackground(const QWidget *widget);
|
|
412 |
|
|
413 |
QFont s60Font(QS60StyleEnums::FontCategories fontCategory,
|
|
414 |
int pointSize = -1) const;
|
|
415 |
// clears all style caches (fonts, colors, pixmaps)
|
|
416 |
void clearCaches(CacheClearReason reason = CC_UndefinedChange);
|
|
417 |
|
|
418 |
// themed main background oprations
|
|
419 |
void setBackgroundTexture(QApplication *application) const;
|
|
420 |
static void deleteBackground();
|
|
421 |
|
|
422 |
static bool isTouchSupported();
|
|
423 |
static bool isToolBarBackground();
|
|
424 |
|
|
425 |
// calculates average color based on button skin graphics (minus borders).
|
|
426 |
QColor colorFromFrameGraphics(SkinFrameElements frame) const;
|
|
427 |
|
|
428 |
//set theme palette for application
|
|
429 |
void setThemePalette(QApplication *application) const;
|
|
430 |
//set theme palette for style option
|
|
431 |
void setThemePalette(QStyleOption *option) const;
|
|
432 |
//access to theme palette
|
|
433 |
static QPalette* themePalette();
|
|
434 |
|
|
435 |
static const layoutHeader m_layoutHeaders[];
|
|
436 |
static const short data[][MAX_PIXELMETRICS];
|
|
437 |
|
|
438 |
void setCurrentLayout(int layoutIndex);
|
|
439 |
void setActiveLayout();
|
|
440 |
// Pointer
|
|
441 |
static short const *m_pmPointer;
|
|
442 |
// number of layouts supported by the style
|
|
443 |
static const int m_numberOfLayouts;
|
|
444 |
|
|
445 |
mutable QHash<QPair<QS60StyleEnums::FontCategories , int>, QFont> m_mappedFontsCache;
|
|
446 |
mutable QHash<SkinFrameElements, QColor> m_colorCache;
|
|
447 |
|
|
448 |
// Has one entry per SkinFrameElements
|
|
449 |
static const struct frameElementCenter {
|
|
450 |
SkinElements element;
|
|
451 |
QS60StyleEnums::SkinParts center;
|
|
452 |
} m_frameElementsData[];
|
|
453 |
|
|
454 |
static QPixmap frame(SkinFrameElements frame, const QSize &size,
|
|
455 |
SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
456 |
static QPixmap backgroundTexture();
|
|
457 |
|
|
458 |
#ifdef Q_WS_S60
|
|
459 |
void handleDynamicLayoutVariantSwitch();
|
|
460 |
void handleSkinChange();
|
|
461 |
#endif // Q_WS_S60
|
|
462 |
|
|
463 |
static QSize naviPaneSize();
|
|
464 |
|
|
465 |
private:
|
|
466 |
static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter,
|
|
467 |
const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
468 |
static void drawRow(QS60StyleEnums::SkinParts start, QS60StyleEnums::SkinParts middle,
|
|
469 |
QS60StyleEnums::SkinParts end, Qt::Orientation orientation, QPainter *painter,
|
|
470 |
const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
471 |
static void drawFrame(SkinFrameElements frame, QPainter *painter,
|
|
472 |
const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
473 |
|
|
474 |
static QPixmap cachedPart(QS60StyleEnums::SkinParts part, const QSize &size,
|
|
475 |
SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
476 |
static QPixmap cachedFrame(SkinFrameElements frame, const QSize &size,
|
|
477 |
SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
478 |
|
|
479 |
static void refreshUI();
|
|
480 |
|
|
481 |
// set S60 font for widget
|
|
482 |
void setFont(QWidget *widget) const;
|
|
483 |
void setThemePalette(QWidget *widget) const;
|
|
484 |
void setThemePalette(QPalette *palette) const;
|
|
485 |
void setThemePaletteHash(QPalette *palette) const;
|
|
486 |
static void storeThemePalette(QPalette *palette);
|
|
487 |
static void deleteThemePalette();
|
|
488 |
|
|
489 |
static QSize partSize(QS60StyleEnums::SkinParts part,
|
|
490 |
SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
491 |
static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size,
|
|
492 |
SkinElementFlags flags = KDefaultSkinElementFlags);
|
|
493 |
|
|
494 |
static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize);
|
|
495 |
|
|
496 |
static QSize screenSize();
|
|
497 |
|
|
498 |
// Contains background texture.
|
|
499 |
static QPixmap *m_background;
|
|
500 |
const static SkinElementFlags KDefaultSkinElementFlags;
|
|
501 |
// defined theme palette
|
|
502 |
static QPalette *m_themePalette;
|
|
503 |
QPalette m_originalPalette;
|
|
504 |
|
|
505 |
QPointer<QFocusFrame> m_focusFrame;
|
|
506 |
};
|
|
507 |
|
|
508 |
QT_END_NAMESPACE
|
|
509 |
|
|
510 |
#endif // QS60STYLE_P_H
|