author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 27 May 2010 13:40:48 +0300 | |
changeset 23 | 89e065397ea6 |
parent 22 | 79de32ba3296 |
child 30 | 5dc02b23752f |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
7 |
** This file is part of the QtGui module of the Qt Toolkit. |
0 | 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 QT_S60_P_H |
|
43 |
#define QT_S60_P_H |
|
44 |
||
45 |
// |
|
46 |
// W A R N I N G |
|
47 |
// ------------- |
|
48 |
// |
|
49 |
// This file is not part of the Qt API. It exists purely as an |
|
50 |
// implementation detail. This header file may change from version to |
|
51 |
// version without notice, or even be removed. |
|
52 |
// |
|
53 |
// We mean it. |
|
54 |
// |
|
55 |
||
56 |
#include "QtGui/qwindowdefs.h" |
|
57 |
#include "private/qcore_symbian_p.h" |
|
58 |
#include "qhash.h" |
|
59 |
#include "qpoint.h" |
|
60 |
#include "QtGui/qfont.h" |
|
61 |
#include "QtGui/qimage.h" |
|
62 |
#include "QtGui/qevent.h" |
|
63 |
#include "qpointer.h" |
|
64 |
#include "qapplication.h" |
|
65 |
#include <w32std.h> |
|
66 |
#include <coecntrl.h> |
|
67 |
#include <eikenv.h> |
|
68 |
#include <eikappui.h> |
|
69 |
||
70 |
#ifdef Q_WS_S60 |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
71 |
#include <AknUtils.h> // AknLayoutUtils |
0 | 72 |
#include <avkon.hrh> // EEikStatusPaneUidTitle |
73 |
#include <akntitle.h> // CAknTitlePane |
|
74 |
#include <akncontext.h> // CAknContextPane |
|
75 |
#include <eikspane.h> // CEikStatusPane |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
76 |
#include <AknPopupFader.h> // MAknFadedComponent and TAknPopupFader |
0 | 77 |
#endif |
78 |
||
79 |
QT_BEGIN_NAMESPACE |
|
80 |
||
81 |
// Application internal HandleResourceChangeL events, |
|
82 |
// system events seems to start with 0x10 |
|
83 |
const TInt KInternalStatusPaneChange = 0x50000000; |
|
84 |
||
85 |
//this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2 |
|
86 |
#define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13) |
|
87 |
||
88 |
class QS60Data |
|
89 |
{ |
|
90 |
public: |
|
91 |
QS60Data(); |
|
92 |
TUid uid; |
|
93 |
int screenDepth; |
|
94 |
QPoint lastCursorPos; |
|
95 |
QPoint lastPointerEventPos; |
|
96 |
QPointer<QWidget> lastPointerEventTarget; |
|
97 |
QPointer<QWidget> mousePressTarget; |
|
98 |
int screenWidthInPixels; |
|
99 |
int screenHeightInPixels; |
|
100 |
int screenWidthInTwips; |
|
101 |
int screenHeightInTwips; |
|
102 |
int defaultDpiX; |
|
103 |
int defaultDpiY; |
|
104 |
WId curWin; |
|
105 |
int virtualMouseLastKey; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
106 |
enum PressedKeys { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
107 |
Select = 0x1, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
108 |
Right = 0x2, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
109 |
Down = 0x4, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
110 |
Left = 0x8, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
111 |
Up = 0x10 |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
112 |
}; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
113 |
int virtualMousePressedKeys; // of the above type, but avoids casting problems |
0 | 114 |
int virtualMouseAccel; |
115 |
int virtualMouseMaxAccel; |
|
116 |
#ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS |
|
117 |
int brokenPointerCursors : 1; |
|
118 |
#endif |
|
119 |
int hasTouchscreen : 1; |
|
120 |
int mouseInteractionEnabled : 1; |
|
121 |
int virtualMouseRequired : 1; |
|
122 |
int qtOwnsS60Environment : 1; |
|
123 |
int supportsPremultipliedAlpha : 1; |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
124 |
int avkonComponentsSupportTransparency : 1; |
22
79de32ba3296
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
125 |
int menuBeingConstructed : 1; |
0 | 126 |
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type |
127 |
static inline void updateScreenSize(); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
128 |
static inline RWsSession& wsSession(); |
0 | 129 |
static inline RWindowGroup& windowGroup(); |
130 |
static inline CWsScreenDevice* screenDevice(); |
|
131 |
static inline CCoeAppUi* appUi(); |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
132 |
static inline CEikMenuBar* menuBar(); |
0 | 133 |
#ifdef Q_WS_S60 |
134 |
static inline CEikStatusPane* statusPane(); |
|
135 |
static inline CCoeControl* statusPaneSubPane(TInt aPaneId); |
|
136 |
static inline CAknTitlePane* titlePane(); |
|
137 |
static inline CAknContextPane* contextPane(); |
|
138 |
static inline CEikButtonGroupContainer* buttonGroupContainer(); |
|
139 |
||
140 |
TTrapHandler *s60InstalledTrapHandler; |
|
141 |
#endif |
|
142 |
}; |
|
143 |
||
144 |
QS60Data* qGlobalS60Data(); |
|
145 |
#define S60 qGlobalS60Data() |
|
146 |
||
147 |
class QAbstractLongTapObserver |
|
148 |
{ |
|
149 |
public: |
|
150 |
virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, |
|
151 |
const TPoint& aPenEventScreenLocation ) = 0; |
|
152 |
}; |
|
153 |
class QLongTapTimer; |
|
154 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
155 |
|
0 | 156 |
class QSymbianControl : public CCoeControl, public QAbstractLongTapObserver |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
157 |
#ifdef Q_WS_S60 |
23
89e065397ea6
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
158 |
, public MAknFadedComponent, public MEikStatusPaneObserver |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
159 |
#endif |
0 | 160 |
{ |
161 |
public: |
|
162 |
DECLARE_TYPE_ID(0x51740000) // Fun fact: the two first values are "Qt" in ASCII. |
|
163 |
||
164 |
public: |
|
165 |
QSymbianControl(QWidget *w); |
|
166 |
void ConstructL(bool isWindowOwning = false, bool desktop = false); |
|
167 |
~QSymbianControl(); |
|
168 |
void HandleResourceChange(int resourceType); |
|
169 |
void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
170 |
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
171 |
#if !defined(QT_NO_IM) && defined(Q_WS_S60) |
|
172 |
TCoeInputCapabilities InputCapabilities() const; |
|
173 |
#endif |
|
174 |
TTypeUid::Ptr MopSupplyObject(TTypeUid id); |
|
175 |
||
176 |
inline QWidget* widget() const { return qwidget; } |
|
177 |
void setWidget(QWidget *w); |
|
178 |
void sendInputEvent(QWidget *widget, QInputEvent *inputEvent); |
|
179 |
void setIgnoreFocusChanged(bool enabled) { m_ignoreFocusChanged = enabled; } |
|
180 |
void CancelLongTapTimer(); |
|
181 |
||
182 |
void setFocusSafely(bool focus); |
|
183 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
184 |
#ifdef Q_WS_S60 |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
185 |
void FadeBehindPopup(bool fade){ popupFader.FadeBehindPopup( this, this, fade); } |
23
89e065397ea6
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
186 |
void HandleStatusPaneSizeChange(); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
187 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
188 |
protected: // from MAknFadedComponent |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
189 |
TInt CountFadedComponents() {return 1;} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
190 |
CCoeControl* FadedComponent(TInt /*aIndex*/) {return this;} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
191 |
#else |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
192 |
#warning No fallback implementation for QSymbianControl::FadeBehindPopup |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
193 |
void FadeBehindPopup(bool /*fade*/){ } |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
194 |
#endif |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
195 |
|
0 | 196 |
protected: |
197 |
void Draw(const TRect& aRect) const; |
|
198 |
void SizeChanged(); |
|
199 |
void PositionChanged(); |
|
200 |
void FocusChanged(TDrawNow aDrawNow); |
|
201 |
||
202 |
private: |
|
203 |
void HandlePointerEvent(const TPointerEvent& aPointerEvent); |
|
204 |
TKeyResponse OfferKeyEvent(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
205 |
TKeyResponse sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent); |
|
206 |
bool sendMouseEvent(QWidget *widget, QMouseEvent *mEvent); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
207 |
void sendMouseEvent( |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
208 |
QWidget *receiver, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
209 |
QEvent::Type type, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
210 |
const QPoint &globalPos, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
211 |
Qt::MouseButton button, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
212 |
Qt::KeyboardModifiers modifiers); |
0 | 213 |
void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); |
214 |
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER |
|
215 |
void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event); |
|
216 |
#endif |
|
19
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
217 |
void handleClientAreaChange(); |
0 | 218 |
|
219 |
private: |
|
220 |
static QSymbianControl *lastFocusedControl; |
|
221 |
||
222 |
private: |
|
223 |
QWidget *qwidget; |
|
224 |
QLongTapTimer* m_longTapDetector; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
225 |
bool m_ignoreFocusChanged : 1; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
226 |
bool m_symbianPopupIsOpen : 1; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
227 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
228 |
#ifdef Q_WS_S60 |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
229 |
// Fader object used to fade everything except this menu and the CBA. |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
230 |
TAknPopupFader popupFader; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
231 |
#endif |
0 | 232 |
}; |
233 |
||
234 |
inline QS60Data::QS60Data() |
|
235 |
{ |
|
236 |
memclr(this, sizeof(QS60Data)); //zero init data |
|
237 |
} |
|
238 |
||
239 |
inline void QS60Data::updateScreenSize() |
|
240 |
{ |
|
241 |
TPixelsTwipsAndRotation params; |
|
242 |
int mode = S60->screenDevice()->CurrentScreenMode(); |
|
243 |
S60->screenDevice()->GetScreenModeSizeAndRotation(mode, params); |
|
244 |
S60->screenWidthInPixels = params.iPixelSize.iWidth; |
|
245 |
S60->screenHeightInPixels = params.iPixelSize.iHeight; |
|
246 |
S60->screenWidthInTwips = params.iTwipsSize.iWidth; |
|
247 |
S60->screenHeightInTwips = params.iTwipsSize.iHeight; |
|
248 |
||
249 |
S60->virtualMouseMaxAccel = qMax(S60->screenHeightInPixels, S60->screenWidthInPixels) / 20; |
|
250 |
||
251 |
TReal inches = S60->screenHeightInTwips / (TReal)KTwipsPerInch; |
|
252 |
S60->defaultDpiY = S60->screenHeightInPixels / inches; |
|
253 |
inches = S60->screenWidthInTwips / (TReal)KTwipsPerInch; |
|
254 |
S60->defaultDpiX = S60->screenWidthInPixels / inches; |
|
255 |
} |
|
256 |
||
257 |
inline RWsSession& QS60Data::wsSession() |
|
258 |
{ |
|
259 |
return CCoeEnv::Static()->WsSession(); |
|
260 |
} |
|
261 |
||
262 |
inline RWindowGroup& QS60Data::windowGroup() |
|
263 |
{ |
|
264 |
return CCoeEnv::Static()->RootWin(); |
|
265 |
} |
|
266 |
||
267 |
inline CWsScreenDevice* QS60Data::screenDevice() |
|
268 |
{ |
|
269 |
return CCoeEnv::Static()->ScreenDevice(); |
|
270 |
} |
|
271 |
||
272 |
inline CCoeAppUi* QS60Data::appUi() |
|
273 |
{ |
|
274 |
return CCoeEnv::Static()-> AppUi(); |
|
275 |
} |
|
276 |
||
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
277 |
inline CEikMenuBar* QS60Data::menuBar() |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
278 |
{ |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
279 |
return CEikonEnv::Static()->AppUiFactory()->MenuBar(); |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
280 |
} |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
281 |
|
0 | 282 |
#ifdef Q_WS_S60 |
283 |
inline CEikStatusPane* QS60Data::statusPane() |
|
284 |
{ |
|
285 |
return CEikonEnv::Static()->AppUiFactory()->StatusPane(); |
|
286 |
} |
|
287 |
||
288 |
// Returns the application's status pane control, if not present returns NULL. |
|
289 |
inline CCoeControl* QS60Data::statusPaneSubPane( TInt aPaneId ) |
|
290 |
{ |
|
291 |
const TUid paneUid = { aPaneId }; |
|
292 |
CEikStatusPane* statusPane = S60->statusPane(); |
|
293 |
if (statusPane && statusPane->PaneCapabilities(paneUid).IsPresent()) { |
|
294 |
CCoeControl* control = NULL; |
|
295 |
// ControlL shouldn't leave because the pane is present |
|
296 |
TRAPD(err, control = statusPane->ControlL(paneUid)); |
|
297 |
return err != KErrNone ? NULL : control; |
|
298 |
} |
|
299 |
return NULL; |
|
300 |
} |
|
301 |
||
302 |
// Returns the application's title pane, if not present returns NULL. |
|
303 |
inline CAknTitlePane* QS60Data::titlePane() |
|
304 |
{ |
|
305 |
return static_cast<CAknTitlePane*>(S60->statusPaneSubPane(EEikStatusPaneUidTitle)); |
|
306 |
} |
|
307 |
||
308 |
// Returns the application's title pane, if not present returns NULL. |
|
309 |
inline CAknContextPane* QS60Data::contextPane() |
|
310 |
{ |
|
311 |
return static_cast<CAknContextPane*>(S60->statusPaneSubPane(EEikStatusPaneUidContext)); |
|
312 |
} |
|
313 |
||
314 |
inline CEikButtonGroupContainer* QS60Data::buttonGroupContainer() |
|
315 |
{ |
|
316 |
return CEikonEnv::Static()->AppUiFactory()->Cba(); |
|
317 |
} |
|
318 |
#endif // Q_WS_S60 |
|
319 |
||
320 |
static inline QFont qt_TFontSpec2QFontL(const TFontSpec &fontSpec) |
|
321 |
{ |
|
322 |
return QFont( |
|
323 |
qt_TDesC2QString(fontSpec.iTypeface.iName), |
|
324 |
fontSpec.iHeight / KTwipsPerPoint, |
|
325 |
fontSpec.iFontStyle.StrokeWeight() == EStrokeWeightNormal ? QFont::Normal : QFont::Bold, |
|
326 |
fontSpec.iFontStyle.Posture() == EPostureItalic |
|
327 |
); |
|
328 |
} |
|
329 |
||
330 |
static inline QImage::Format qt_TDisplayMode2Format(TDisplayMode mode) |
|
331 |
{ |
|
332 |
QImage::Format format; |
|
333 |
switch(mode) { |
|
334 |
case EGray2: |
|
335 |
format = QImage::Format_MonoLSB; |
|
336 |
break; |
|
337 |
case EColor256: |
|
338 |
case EGray256: |
|
339 |
format = QImage::Format_Indexed8; |
|
340 |
break; |
|
341 |
case EColor4K: |
|
342 |
format = QImage::Format_RGB444; |
|
343 |
break; |
|
344 |
case EColor64K: |
|
345 |
format = QImage::Format_RGB16; |
|
346 |
break; |
|
347 |
case EColor16M: |
|
348 |
format = QImage::Format_RGB888; |
|
349 |
break; |
|
350 |
case EColor16MU: |
|
351 |
format = QImage::Format_RGB32; |
|
352 |
break; |
|
353 |
case EColor16MA: |
|
354 |
format = QImage::Format_ARGB32; |
|
355 |
break; |
|
356 |
case Q_SYMBIAN_ECOLOR16MAP: |
|
357 |
format = QImage::Format_ARGB32_Premultiplied; |
|
358 |
break; |
|
359 |
default: |
|
360 |
format = QImage::Format_Invalid; |
|
361 |
break; |
|
362 |
} |
|
363 |
return format; |
|
364 |
} |
|
365 |
||
366 |
#ifndef QT_NO_CURSOR |
|
367 |
void qt_symbian_setWindowCursor(const QCursor &cursor, const CCoeControl* wid); |
|
368 |
void qt_symbian_setWindowGroupCursor(const QCursor &cursor, RWindowTreeNode &node); |
|
369 |
void qt_symbian_setGlobalCursor(const QCursor &cursor); |
|
370 |
void qt_symbian_set_cursor_visible(bool visible); |
|
371 |
bool qt_symbian_is_cursor_visible(); |
|
372 |
#endif |
|
373 |
||
374 |
QT_END_NAMESPACE |
|
375 |
||
376 |
#endif // QT_S60_P_H |