Changeset 846 for trunk/src/gui/s60framework
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/s60framework/qs60mainapplication.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 48 48 #include <bautils.h> 49 49 #include <coemain.h> 50 #ifndef Q_WS_S60 51 # include <eikserverapp.h> 52 #endif 50 53 51 54 QT_BEGIN_NAMESPACE … … 59 62 } 60 63 61 _LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main" QT_LIBINFIX_UNICODE L".rsc");62 64 63 65 /*! … … 72 74 The QS60MainApplication provides a helper class for use in migrating 73 75 from existing S60 based applications to Qt based applications. It is 74 used in the exact same way as the \c C AknApplication class from76 used in the exact same way as the \c CEikApplication class from 75 77 Symbian, but internally provides extensions used by Qt. 76 78 77 79 When modifying old S60 applications that rely on implementing 78 functions in \c C AknApplication, the class should be modified to79 inherit from this class instead of \c C AknApplication. Then the80 functions in \c CEikApplication, the class should be modified to 81 inherit from this class instead of \c CEikApplication. Then the 80 82 application can choose to override only certain functions. To make 81 83 Qt use the custom application objects, pass a factory function to 82 84 \c{QApplication::QApplication(QApplication::QS60MainApplicationFactory, int &, char **)}. 83 85 84 For more information on \c C AknApplication, please see the S60 documentation.86 For more information on \c CEikApplication, please see the S60 documentation. 85 87 86 88 Unlike other Qt classes, QS60MainApplication behaves like an S60 class, and can throw Symbian … … 130 132 TFileName QS60MainApplication::ResourceFileName() const 131 133 { 132 TFindFile finder(iCoeEnv->FsSession());133 TInt err = finder.FindByDir(KQtWrapperResourceFile, KNullDesC);134 if (err == KErrNone)135 return finder.File();136 134 return KNullDesC(); 137 135 } 138 136 137 /*! 138 \internal 139 */ 140 void QS60MainApplication::PreDocConstructL() 141 { 142 QS60MainApplicationBase::PreDocConstructL(); 143 } 144 145 /*! 146 \internal 147 */ 148 CDictionaryStore *QS60MainApplication::OpenIniFileLC(RFs &aFs) const 149 { 150 return QS60MainApplicationBase::OpenIniFileLC(aFs); 151 } 152 153 /*! 154 \internal 155 */ 156 void QS60MainApplication::NewAppServerL(CApaAppServer *&aAppServer) 157 { 158 #ifdef Q_WS_S60 159 QS60MainApplicationBase::NewAppServerL(aAppServer); 160 #else 161 aAppServer = new(ELeave) CEikAppServer; 162 #endif 163 } 164 139 165 QT_END_NAMESPACE -
trunk/src/gui/s60framework/qs60mainapplication.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include <QtCore/qglobal.h> 46 46 47 #ifdef Q_OS_SYMBIAN 48 47 49 #ifdef Q_WS_S60 48 49 50 #include <aknapp.h> 51 typedef CAknApplication QS60MainApplicationBase; 52 #else 53 #include <eikapp.h> 54 typedef CEikApplication QS60MainApplicationBase; 55 #endif 50 56 51 57 QT_BEGIN_HEADER … … 55 61 QT_MODULE(Gui) 56 62 57 class Q_GUI_EXPORT QS60MainApplication : public CAknApplication63 class Q_GUI_EXPORT QS60MainApplication : public QS60MainApplicationBase 58 64 { 59 65 public: … … 66 72 virtual TFileName ResourceFileName() const; 67 73 74 public: 75 76 virtual void PreDocConstructL(); 77 78 virtual CDictionaryStore *OpenIniFileLC(RFs &aFs) const; 79 80 virtual void NewAppServerL(CApaAppServer *&aAppServer); 81 68 82 protected: 69 83 … … 75 89 QT_END_HEADER 76 90 77 #endif // Q_ WS_S6091 #endif // Q_OS_SYMBIAN 78 92 79 93 #endif // QS60MAINAPPLICATION_H -
trunk/src/gui/s60framework/qs60mainapplication_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/gui/s60framework/qs60mainappui.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 42 42 // INCLUDE FILES 43 43 #include <exception> 44 #include <qglobal.h> 45 #ifdef Q_WS_S60 44 46 #include <avkon.hrh> 45 47 #include <eikmenub.h> 46 48 #include <eikmenup.h> 49 #include <avkon.rsg> 50 #endif 47 51 #include <barsread.h> 48 52 #include <qconfig.h> 49 #if defined(QT_LIBINFIX_UNQUOTED)50 // Two level macro needed for proper expansion of libinfix51 # define QT_S60MAIN_RSG_2(x) <s60main##x##.rsg>52 # define QT_S60MAIN_RSG(x) QT_S60MAIN_RSG_2(x)53 # include QT_S60MAIN_RSG(QT_LIBINFIX_UNQUOTED)54 #else55 # include <s60main.rsg>56 #endif57 #include <avkon.rsg>58 53 59 54 #include "qs60mainappui.h" … … 116 111 // resource files in most SDKs. S60 3rd FP1 public seems to require resource file 117 112 // even these flags are defined 118 TInt flags = CAknAppUi::EAknEnableSkin 119 | CAknAppUi::ENoScreenFurniture 120 | CAknAppUi::ENonStandardResourceFile; 113 TInt flags = CEikAppUi::ENoScreenFurniture 114 | CEikAppUi::ENonStandardResourceFile; 115 #ifdef Q_WS_S60 116 flags |= CAknAppUi::EAknEnableSkin; 121 117 // After 5th Edition S60, native side supports animated wallpapers. 122 123 118 // However, there is no support for that feature on Qt side, so indicate to 119 // native UI framework that this application will not support background animations. 124 120 if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) 125 121 flags |= KAknDisableAnimationBackground; 122 #endif 126 123 BaseConstructL(flags); 127 124 } … … 169 166 void QS60MainAppUi::HandleResourceChangeL(TInt type) 170 167 { 171 CAknAppUi::HandleResourceChangeL(type);168 QS60MainAppUiBase::HandleResourceChangeL(type); 172 169 173 170 if (qApp) { … … 186 183 * handle the event. 187 184 */ 188 void QS60MainAppUi::HandleWsEventL(const TWsEvent &wsEvent, CCoeControl *destination)185 void QS60MainAppUi::HandleWsEventL(const TWsEvent &wsEvent, CCoeControl *destination) 189 186 { 190 187 int result = 0; … … 197 194 198 195 if (result <= 0) 199 CAknAppUi::HandleWsEventL(wsEvent, destination);196 QS60MainAppUiBase::HandleWsEventL(wsEvent, destination); 200 197 } 201 198 … … 237 234 void QS60MainAppUi::DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane) 238 235 { 239 if (resourceId == R_QT_WRAPPERAPP_MENU) { 236 #ifdef Q_WS_S60 237 if (resourceId == R_AVKON_MENUPANE_EMPTY) { 240 238 if (menuPane->NumberOfItemsInPane() <= 1) 241 239 QT_TRYCATCH_LEAVING(qt_symbian_show_toplevel(menuPane)); … … 246 244 QT_TRYCATCH_LEAVING(qt_symbian_show_submenu(menuPane, resourceId)); 247 245 } 246 #else 247 QS60MainAppUiBase::DynInitMenuPaneL(resourceId, menuPane); 248 #endif 248 249 } 249 250 … … 256 257 * If you override this function, you should call the base class implementation as well. 257 258 */ 258 void QS60MainAppUi::RestoreMenuL(CCoeControl* menuWindow, TInt resourceId, TMenuType menuType) 259 { 259 void QS60MainAppUi::RestoreMenuL(CCoeControl *menuWindow, TInt resourceId, TMenuType menuType) 260 { 261 #ifdef Q_WS_S60 260 262 if (resourceId >= QT_SYMBIAN_FIRST_MENU_ITEM && resourceId <= QT_SYMBIAN_LAST_MENU_ITEM) { 261 263 if (menuType == EMenuPane) … … 263 265 else 264 266 DynInitMenuBarL(resourceId, (CEikMenuBar*)menuWindow); 265 } else { 266 CAknAppUi::RestoreMenuL(menuWindow, resourceId, menuType); 267 } 268 } 267 } else if(resourceId == R_AVKON_MENUPANE_EMPTY) { 268 CEikMenuBarTitle *title = new(ELeave) CEikMenuBarTitle; 269 CleanupStack::PushL(title); 270 271 title->iData.iMenuPaneResourceId = R_AVKON_MENUPANE_EMPTY; 272 title->iTitleFlags = 0; 273 274 S60->menuBar()->TitleArray()->AddTitleL(title); 275 CleanupStack::Pop( title ); 276 } 277 else 278 #endif 279 { 280 QS60MainAppUiBase::RestoreMenuL(menuWindow, resourceId, menuType); 281 } 282 } 283 284 /*! 285 \internal 286 */ 287 void QS60MainAppUi::Exit() 288 { 289 QS60MainAppUiBase::Exit(); 290 } 291 292 /*! 293 \internal 294 */ 295 void QS60MainAppUi::SetFadedL(TBool aFaded) 296 { 297 QS60MainAppUiBase::SetFadedL(aFaded); 298 } 299 300 /*! 301 \internal 302 */ 303 TRect QS60MainAppUi::ApplicationRect() const 304 { 305 return QS60MainAppUiBase::ApplicationRect(); 306 } 307 308 /*! 309 \internal 310 */ 311 void QS60MainAppUi::HandleScreenDeviceChangedL() 312 { 313 QS60MainAppUiBase::HandleScreenDeviceChangedL(); 314 } 315 316 /*! 317 \internal 318 */ 319 void QS60MainAppUi::HandleApplicationSpecificEventL(TInt aType, const TWsEvent &aEvent) 320 { 321 QS60MainAppUiBase::HandleApplicationSpecificEventL(aType, aEvent); 322 } 323 324 /*! 325 \internal 326 */ 327 TTypeUid::Ptr QS60MainAppUi::MopSupplyObject(TTypeUid aId) 328 { 329 return QS60MainAppUiBase::MopSupplyObject(aId); 330 } 331 332 /*! 333 \internal 334 */ 335 void QS60MainAppUi::ProcessCommandL(TInt aCommand) 336 { 337 QS60MainAppUiBase::ProcessCommandL(aCommand); 338 } 339 340 /*! 341 \internal 342 */ 343 TErrorHandlerResponse QS60MainAppUi::HandleError (TInt aError, const SExtendedError &aExtErr, TDes &aErrorText, TDes &aContextText) 344 { 345 return QS60MainAppUiBase::HandleError(aError, aExtErr, aErrorText, aContextText); 346 } 347 348 /*! 349 \internal 350 */ 351 void QS60MainAppUi::HandleViewDeactivation(const TVwsViewId &aViewIdToBeDeactivated, const TVwsViewId &aNewlyActivatedViewId) 352 { 353 QS60MainAppUiBase::HandleViewDeactivation(aViewIdToBeDeactivated, aNewlyActivatedViewId); 354 } 355 356 /*! 357 \internal 358 */ 359 void QS60MainAppUi::PrepareToExit() 360 { 361 QS60MainAppUiBase::PrepareToExit(); 362 } 363 364 /*! 365 \internal 366 */ 367 void QS60MainAppUi::HandleTouchPaneSizeChange() 368 { 369 QS60MainAppUiBase::HandleTouchPaneSizeChange(); 370 } 371 372 /*! 373 \internal 374 */ 375 void QS60MainAppUi::HandleSystemEventL(const TWsEvent &aEvent) 376 { 377 QS60MainAppUiBase::HandleSystemEventL(aEvent); 378 } 379 380 /*! 381 \internal 382 */ 383 void QS60MainAppUi::Reserved_MtsmPosition() 384 { 385 QS60MainAppUiBase::Reserved_MtsmPosition(); 386 } 387 388 /*! 389 \internal 390 */ 391 void QS60MainAppUi::Reserved_MtsmObject() 392 { 393 QS60MainAppUiBase::Reserved_MtsmObject(); 394 } 395 396 /*! 397 \internal 398 */ 399 void QS60MainAppUi::HandleForegroundEventL(TBool aForeground) 400 { 401 QS60MainAppUiBase::HandleForegroundEventL(aForeground); 402 } 403 404 #ifndef Q_WS_S60 405 406 void QS60StubAknAppUi::HandleViewDeactivation(const TVwsViewId &, const TVwsViewId &) {} 407 void QS60StubAknAppUi::HandleTouchPaneSizeChange() {} 408 void QS60StubAknAppUi::HandleStatusPaneSizeChange() {} 409 void QS60StubAknAppUi::Reserved_MtsmPosition() {} 410 void QS60StubAknAppUi::Reserved_MtsmObject() {} 411 412 #endif 269 413 270 414 QT_END_NAMESPACE -
trunk/src/gui/s60framework/qs60mainappui.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include <QtCore/qglobal.h> 46 46 47 #ifdef Q_OS_SYMBIAN 48 47 49 #ifdef Q_WS_S60 50 #include <aknappui.h> 51 typedef CAknAppUi QS60MainAppUiBase; 52 #else 53 #include <eikappui.h> 54 // these stub classes simulate the structure of CAknAppUi, to help binary compatibility between Qt configured with and without S60/Avkon 55 class QS60StubAknAppUiBase : public CEikAppUi 56 { 57 private: 58 int qS60StubAknAppUiBaseSpace[4]; 59 }; 48 60 49 #include <aknappui.h> 61 class QS60StubMEikStatusPaneObserver 62 { 63 public: 64 virtual void HandleStatusPaneSizeChange() = 0; 65 }; 66 67 class QS60StubMAknTouchPaneObserver 68 { 69 public: 70 virtual void HandleTouchPaneSizeChange() = 0; 71 }; 72 73 class QS60StubAknAppUi : public QS60StubAknAppUiBase, QS60StubMEikStatusPaneObserver, 74 public MCoeViewDeactivationObserver, 75 public QS60StubMAknTouchPaneObserver 76 { 77 public: // MCoeViewDeactivationObserver 78 virtual void HandleViewDeactivation(const TVwsViewId&, const TVwsViewId &); 79 80 public: // from MAknTouchPaneObserver 81 virtual void HandleTouchPaneSizeChange(); 82 83 protected: // from MEikStatusPaneObserver 84 virtual void HandleStatusPaneSizeChange(); 85 86 protected: // from CAknAppUi 87 virtual void Reserved_MtsmPosition(); 88 virtual void Reserved_MtsmObject(); 89 90 private: 91 int qS60StubAknAppUiSpace[4]; 92 }; 93 94 typedef QS60StubAknAppUi QS60MainAppUiBase; 95 #endif 50 96 51 97 QT_BEGIN_HEADER … … 55 101 QT_MODULE(Gui) 56 102 57 class Q_GUI_EXPORT QS60MainAppUi : public CAknAppUi103 class Q_GUI_EXPORT QS60MainAppUi : public QS60MainAppUiBase 58 104 { 59 105 public: … … 64 110 virtual void ConstructL(); 65 111 66 virtual void RestoreMenuL(CCoeControl *menuWindow,TInt resourceId,TMenuType menuType);112 virtual void RestoreMenuL(CCoeControl *menuWindow,TInt resourceId,TMenuType menuType); 67 113 virtual void DynInitMenuBarL(TInt resourceId, CEikMenuBar *menuBar); 68 114 virtual void DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane); … … 75 121 76 122 protected: 77 virtual void HandleWsEventL(const TWsEvent& event, CCoeControl* destination); 123 virtual void HandleWsEventL(const TWsEvent &event, CCoeControl *destination); 124 125 public: 126 virtual void Exit(); 127 virtual void SetFadedL(TBool aFaded); 128 virtual TRect ApplicationRect() const; 129 virtual void ProcessCommandL(TInt aCommand); 130 virtual TErrorHandlerResponse HandleError (TInt aError, const SExtendedError &aExtErr, TDes &aErrorText, TDes &aContextText); 131 virtual void HandleViewDeactivation(const TVwsViewId &aViewIdToBeDeactivated, const TVwsViewId &aNewlyActivatedViewId); 132 virtual void PrepareToExit(); 133 virtual void HandleTouchPaneSizeChange(); 134 135 protected: 136 virtual void HandleScreenDeviceChangedL(); 137 virtual void HandleApplicationSpecificEventL(TInt aType, const TWsEvent &aEvent); 138 virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId); 139 virtual void HandleSystemEventL(const TWsEvent &aEvent); 140 virtual void Reserved_MtsmPosition(); 141 virtual void Reserved_MtsmObject(); 142 virtual void HandleForegroundEventL(TBool aForeground); 78 143 }; 79 144 … … 82 147 QT_END_HEADER 83 148 84 #endif // Q_ WS_S60149 #endif // Q_OS_SYMBIAN 85 150 86 151 #endif // QS60MAINAPPUI_H -
trunk/src/gui/s60framework/qs60maindocument.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 58 58 The QS60MainDocument provides a helper class for use in migrating 59 59 from existing S60 based applications to Qt based applications. It is 60 used in the exact same way as the \c C AknDocument class from60 used in the exact same way as the \c CEikDocument class from 61 61 Symbian, but internally provides extensions used by Qt. 62 62 63 63 When modifying old S60 applications that rely on implementing 64 functions in \c C AknDocument, the class should be modified to65 inherit from this class instead of \c C AknDocument. Then the64 functions in \c CEikDocument, the class should be modified to 65 inherit from this class instead of \c CEikDocument. Then the 66 66 application can choose to override only certain functions. 67 67 68 For more information on \c C AknDocument, please see the S6068 For more information on \c CEikDocument, please see the S60 69 69 documentation. 70 70 … … 80 80 * \a mainApplication should contain a pointer to a QS60MainApplication instance. 81 81 */ 82 QS60MainDocument::QS60MainDocument(CEikApplication &mainApplication)83 : CAknDocument(mainApplication)82 QS60MainDocument::QS60MainDocument(CEikApplication &mainApplication) 83 : QS60MainDocumentBase(mainApplication) 84 84 { 85 85 // No implementation required … … 106 106 } 107 107 108 /*! 109 \internal 110 */ 111 CFileStore *QS60MainDocument::OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs) 112 { 113 return QS60MainDocumentBase::OpenFileL(aDoOpen, aFilename, aFs); 114 } 115 116 /*! 117 \internal 118 */ 119 void QS60MainDocument::OpenFileL(CFileStore *&aFileStore, RFile &aFile) 120 { 121 QS60MainDocumentBase::OpenFileL(aFileStore, aFile); 122 } 123 108 124 QT_END_NAMESPACE -
trunk/src/gui/s60framework/qs60maindocument.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include <QtCore/qglobal.h> 46 46 47 #ifdef Q_OS_SYMBIAN 48 47 49 #ifdef Q_WS_S60 48 49 50 #include <AknDoc.h> 51 typedef CAknDocument QS60MainDocumentBase; 52 #else 53 #include <eikdoc.h> 54 typedef CEikDocument QS60MainDocumentBase; 55 #endif 50 56 51 57 class CEikApplication; … … 59 65 class QS60MainAppUi; 60 66 61 class Q_GUI_EXPORT QS60MainDocument : public CAknDocument67 class Q_GUI_EXPORT QS60MainDocument : public QS60MainDocumentBase 62 68 { 63 69 public: … … 70 76 71 77 virtual CEikAppUi *CreateAppUiL(); 78 79 public: 80 81 virtual CFileStore *OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs); 82 83 virtual void OpenFileL(CFileStore *&aFileStore, RFile &aFile); 72 84 }; 73 85 … … 76 88 QT_END_HEADER 77 89 78 #endif // Q_ WS_S6090 #endif // Q_OS_SYMBIAN 79 91 80 92 #endif // QS60MAINDOCUMENT_H -
trunk/src/gui/s60framework/s60framework.pri
r769 r846 1 # This block serves the minimalistic resource file for S60 3.1 platforms.2 # Note there is no way to ifdef S60 version in mmp file, that is why the resource3 # file is always compiled for WINSCW4 minimalAppResource31 = \5 "SOURCEPATH s60framework" \6 "START RESOURCE s60main.rss" \7 "TARGET s60main$${QT_LIBINFIX}" \8 "HEADER" \9 "TARGETPATH /resource/apps" \10 "END"11 MMP_RULES += minimalAppResource3112 13 1 SOURCES += s60framework/qs60mainapplication.cpp \ 14 2 s60framework/qs60mainappui.cpp \ -
trunk/src/gui/s60framework/s60main.rss
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com)
Note:
See TracChangeset
for help on using the changeset viewer.