Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/s60framework/qs60mainapplication.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    4848#include <bautils.h>
    4949#include <coemain.h>
     50
     51
     52
    5053
    5154QT_BEGIN_NAMESPACE
     
    5962}
    6063
    61 _LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main" QT_LIBINFIX_UNICODE L".rsc");
    6264
    6365/*!
     
    7274  The QS60MainApplication provides a helper class for use in migrating
    7375  from existing S60 based applications to Qt based applications. It is
    74   used in the exact same way as the \c CAknApplication class from
     76  used in the exact same way as the \c CApplication class from
    7577  Symbian, but internally provides extensions used by Qt.
    7678
    7779  When modifying old S60 applications that rely on implementing
    78   functions in \c CAknApplication, the class should be modified to
    79   inherit from this class instead of \c CAknApplication. Then the
     80  functions in \c CApplication, the class should be modified to
     81  inherit from this class instead of \c CApplication. Then the
    8082  application can choose to override only certain functions. To make
    8183  Qt use the custom application objects, pass a factory function to
    8284  \c{QApplication::QApplication(QApplication::QS60MainApplicationFactory, int &, char **)}.
    8385
    84   For more information on \c CAknApplication, please see the S60 documentation.
     86  For more information on \c CApplication, please see the S60 documentation.
    8587
    8688  Unlike other Qt classes, QS60MainApplication behaves like an S60 class, and can throw Symbian
     
    130132TFileName QS60MainApplication::ResourceFileName() const
    131133{
    132     TFindFile finder(iCoeEnv->FsSession());
    133     TInt err = finder.FindByDir(KQtWrapperResourceFile, KNullDesC);
    134     if (err == KErrNone)
    135         return finder.File();
    136134    return KNullDesC();
    137135}
    138136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
    139165QT_END_NAMESPACE
  • trunk/src/gui/s60framework/qs60mainapplication.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    4545#include <QtCore/qglobal.h>
    4646
     47
     48
    4749#ifdef Q_WS_S60
    48 
    4950#include <aknapp.h>
     51
     52
     53
     54
     55
    5056
    5157QT_BEGIN_HEADER
     
    5561QT_MODULE(Gui)
    5662
    57 class Q_GUI_EXPORT QS60MainApplication : public CAknApplication
     63class Q_GUI_EXPORT QS60MainApplication : public
    5864{
    5965public:
     
    6672    virtual TFileName ResourceFileName() const;
    6773
     74
     75
     76
     77
     78
     79
     80
     81
    6882protected:
    6983
     
    7589QT_END_HEADER
    7690
    77 #endif // Q_WS_S60
     91#endif // Q_
    7892
    7993#endif // QS60MAINAPPLICATION_H
  • trunk/src/gui/s60framework/qs60mainapplication_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/gui/s60framework/qs60mainappui.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    4242// INCLUDE FILES
    4343#include <exception>
     44
     45
    4446#include <avkon.hrh>
    4547#include <eikmenub.h>
    4648#include <eikmenup.h>
     49
     50
    4751#include <barsread.h>
    4852#include <qconfig.h>
    49 #if defined(QT_LIBINFIX_UNQUOTED)
    50 // Two level macro needed for proper expansion of libinfix
    51 #  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 #else
    55 #  include <s60main.rsg>
    56 #endif
    57 #include <avkon.rsg>
    5853
    5954#include "qs60mainappui.h"
     
    116111    // resource files in most SDKs. S60 3rd FP1 public seems to require resource file
    117112    // 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;
    121117    // After 5th Edition S60, native side supports animated wallpapers.
    122         // However, there is no support for that feature on Qt side, so indicate to
    123         // native UI framework that this application will not support background animations.
     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.
    124120    if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)
    125121        flags |= KAknDisableAnimationBackground;
     122
    126123    BaseConstructL(flags);
    127124}
     
    169166void QS60MainAppUi::HandleResourceChangeL(TInt type)
    170167{
    171     CAknAppUi::HandleResourceChangeL(type);
     168    ::HandleResourceChangeL(type);
    172169
    173170    if (qApp) {
     
    186183 * handle the event.
    187184 */
    188 void QS60MainAppUi::HandleWsEventL(const TWsEvent& wsEvent, CCoeControl *destination)
     185void QS60MainAppUi::HandleWsEventL(const TWsEventwsEvent, CCoeControl *destination)
    189186{
    190187    int result = 0;
     
    197194
    198195    if (result <= 0)
    199         CAknAppUi::HandleWsEventL(wsEvent, destination);
     196        ::HandleWsEventL(wsEvent, destination);
    200197}
    201198
     
    237234void QS60MainAppUi::DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane)
    238235{
    239     if (resourceId == R_QT_WRAPPERAPP_MENU) {
     236#ifdef Q_WS_S60
     237    if (resourceId == R_AVKON_MENUPANE_EMPTY) {
    240238        if (menuPane->NumberOfItemsInPane() <= 1)
    241239            QT_TRYCATCH_LEAVING(qt_symbian_show_toplevel(menuPane));
     
    246244        QT_TRYCATCH_LEAVING(qt_symbian_show_submenu(menuPane, resourceId));
    247245    }
     246
     247
     248
    248249}
    249250
     
    256257 * If you override this function, you should call the base class implementation as well.
    257258 */
    258 void QS60MainAppUi::RestoreMenuL(CCoeControl* menuWindow, TInt resourceId, TMenuType menuType)
    259 {
     259void QS60MainAppUi::RestoreMenuL(CCoeControl *menuWindow, TInt resourceId, TMenuType menuType)
     260{
     261#ifdef Q_WS_S60
    260262    if (resourceId >= QT_SYMBIAN_FIRST_MENU_ITEM && resourceId <= QT_SYMBIAN_LAST_MENU_ITEM) {
    261263        if (menuType == EMenuPane)
     
    263265        else
    264266            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*/
     287void QS60MainAppUi::Exit()
     288{
     289    QS60MainAppUiBase::Exit();
     290}
     291
     292/*!
     293  \internal
     294*/
     295void QS60MainAppUi::SetFadedL(TBool aFaded)
     296{
     297    QS60MainAppUiBase::SetFadedL(aFaded);
     298}
     299
     300/*!
     301  \internal
     302*/
     303TRect QS60MainAppUi::ApplicationRect() const
     304{
     305    return QS60MainAppUiBase::ApplicationRect();
     306}
     307
     308/*!
     309  \internal
     310*/
     311void QS60MainAppUi::HandleScreenDeviceChangedL()
     312{
     313    QS60MainAppUiBase::HandleScreenDeviceChangedL();
     314}
     315
     316/*!
     317  \internal
     318*/
     319void QS60MainAppUi::HandleApplicationSpecificEventL(TInt aType, const TWsEvent &aEvent)
     320{
     321    QS60MainAppUiBase::HandleApplicationSpecificEventL(aType, aEvent);
     322}
     323
     324/*!
     325  \internal
     326*/
     327TTypeUid::Ptr QS60MainAppUi::MopSupplyObject(TTypeUid aId)
     328{
     329    return QS60MainAppUiBase::MopSupplyObject(aId);
     330}
     331
     332/*!
     333  \internal
     334*/
     335void QS60MainAppUi::ProcessCommandL(TInt aCommand)
     336{
     337    QS60MainAppUiBase::ProcessCommandL(aCommand);
     338}
     339
     340/*!
     341  \internal
     342*/
     343TErrorHandlerResponse 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*/
     351void QS60MainAppUi::HandleViewDeactivation(const TVwsViewId &aViewIdToBeDeactivated, const TVwsViewId &aNewlyActivatedViewId)
     352{
     353    QS60MainAppUiBase::HandleViewDeactivation(aViewIdToBeDeactivated, aNewlyActivatedViewId);
     354}
     355
     356/*!
     357  \internal
     358*/
     359void QS60MainAppUi::PrepareToExit()
     360{
     361    QS60MainAppUiBase::PrepareToExit();
     362}
     363
     364/*!
     365  \internal
     366*/
     367void QS60MainAppUi::HandleTouchPaneSizeChange()
     368{
     369    QS60MainAppUiBase::HandleTouchPaneSizeChange();
     370}
     371
     372/*!
     373  \internal
     374*/
     375void QS60MainAppUi::HandleSystemEventL(const TWsEvent &aEvent)
     376{
     377    QS60MainAppUiBase::HandleSystemEventL(aEvent);
     378}
     379
     380/*!
     381  \internal
     382*/
     383void QS60MainAppUi::Reserved_MtsmPosition()
     384{
     385    QS60MainAppUiBase::Reserved_MtsmPosition();
     386}
     387
     388/*!
     389  \internal
     390*/
     391void QS60MainAppUi::Reserved_MtsmObject()
     392{
     393    QS60MainAppUiBase::Reserved_MtsmObject();
     394}
     395
     396/*!
     397  \internal
     398*/
     399void QS60MainAppUi::HandleForegroundEventL(TBool aForeground)
     400{
     401    QS60MainAppUiBase::HandleForegroundEventL(aForeground);
     402}
     403
     404#ifndef Q_WS_S60
     405
     406void QS60StubAknAppUi::HandleViewDeactivation(const TVwsViewId &, const TVwsViewId &) {}
     407void QS60StubAknAppUi::HandleTouchPaneSizeChange() {}
     408void QS60StubAknAppUi::HandleStatusPaneSizeChange() {}
     409void QS60StubAknAppUi::Reserved_MtsmPosition() {}
     410void QS60StubAknAppUi::Reserved_MtsmObject() {}
     411
     412#endif
    269413
    270414QT_END_NAMESPACE
  • trunk/src/gui/s60framework/qs60mainappui.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    4545#include <QtCore/qglobal.h>
    4646
     47
     48
    4749#ifdef Q_WS_S60
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
    4860
    49 #include <aknappui.h>
     61class QS60StubMEikStatusPaneObserver
     62{
     63public:
     64    virtual void HandleStatusPaneSizeChange() = 0;
     65};
     66
     67class QS60StubMAknTouchPaneObserver
     68{
     69public:
     70    virtual void HandleTouchPaneSizeChange() = 0;
     71};
     72
     73class QS60StubAknAppUi : public QS60StubAknAppUiBase, QS60StubMEikStatusPaneObserver,
     74            public MCoeViewDeactivationObserver,
     75            public QS60StubMAknTouchPaneObserver
     76{
     77public: // MCoeViewDeactivationObserver
     78    virtual void HandleViewDeactivation(const TVwsViewId&, const TVwsViewId &);
     79
     80public: // from MAknTouchPaneObserver
     81    virtual void HandleTouchPaneSizeChange();
     82
     83protected: // from MEikStatusPaneObserver
     84    virtual void HandleStatusPaneSizeChange();
     85
     86protected: // from CAknAppUi
     87    virtual void Reserved_MtsmPosition();
     88    virtual void Reserved_MtsmObject();
     89
     90private:
     91    int qS60StubAknAppUiSpace[4];
     92};
     93
     94typedef QS60StubAknAppUi QS60MainAppUiBase;
     95#endif
    5096
    5197QT_BEGIN_HEADER
     
    55101QT_MODULE(Gui)
    56102
    57 class Q_GUI_EXPORT QS60MainAppUi : public CAknAppUi
     103class Q_GUI_EXPORT QS60MainAppUi : public
    58104{
    59105public:
     
    64110    virtual void ConstructL();
    65111
    66     virtual void RestoreMenuL(CCoeControl* menuWindow,TInt resourceId,TMenuType menuType);
     112    virtual void RestoreMenuL(CCoeControlmenuWindow,TInt resourceId,TMenuType menuType);
    67113    virtual void DynInitMenuBarL(TInt resourceId, CEikMenuBar *menuBar);
    68114    virtual void DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane);
     
    75121
    76122protected:
    77     virtual void HandleWsEventL(const TWsEvent& event, CCoeControl* destination);
     123    virtual void HandleWsEventL(const TWsEvent &event, CCoeControl *destination);
     124
     125public:
     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
     135protected:
     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);
    78143};
    79144
     
    82147QT_END_HEADER
    83148
    84 #endif // Q_WS_S60
     149#endif // Q_
    85150
    86151#endif // QS60MAINAPPUI_H
  • trunk/src/gui/s60framework/qs60maindocument.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    5858  The QS60MainDocument provides a helper class for use in migrating
    5959  from existing S60 based applications to Qt based applications. It is
    60   used in the exact same way as the \c CAknDocument class from
     60  used in the exact same way as the \c CDocument class from
    6161  Symbian, but internally provides extensions used by Qt.
    6262
    6363  When modifying old S60 applications that rely on implementing
    64   functions in \c CAknDocument, the class should be modified to
    65   inherit from this class instead of \c CAknDocument. Then the
     64  functions in \c CDocument, the class should be modified to
     65  inherit from this class instead of \c CDocument. Then the
    6666  application can choose to override only certain functions.
    6767
    68   For more information on \c CAknDocument, please see the S60
     68  For more information on \c CDocument, please see the S60
    6969  documentation.
    7070
     
    8080 * \a mainApplication should contain a pointer to a QS60MainApplication instance.
    8181 */
    82 QS60MainDocument::QS60MainDocument(CEikApplication& mainApplication)
    83     : CAknDocument(mainApplication)
     82QS60MainDocument::QS60MainDocument(CEikApplicationmainApplication)
     83    : (mainApplication)
    8484{
    8585    // No implementation required
     
    106106}
    107107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
    108124QT_END_NAMESPACE
  • trunk/src/gui/s60framework/qs60maindocument.h

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    4545#include <QtCore/qglobal.h>
    4646
     47
     48
    4749#ifdef Q_WS_S60
    48 
    4950#include <AknDoc.h>
     51
     52
     53
     54
     55
    5056
    5157class CEikApplication;
     
    5965class QS60MainAppUi;
    6066
    61 class Q_GUI_EXPORT QS60MainDocument : public CAknDocument
     67class Q_GUI_EXPORT QS60MainDocument : public
    6268{
    6369public:
     
    7076
    7177    virtual CEikAppUi *CreateAppUiL();
     78
     79
     80
     81
     82
     83
    7284};
    7385
     
    7688QT_END_HEADER
    7789
    78 #endif // Q_WS_S60
     90#endif // Q_
    7991
    8092#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 resource
    3 # file is always compiled for WINSCW
    4 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 += minimalAppResource31
    12 
    131SOURCES += s60framework/qs60mainapplication.cpp \
    142           s60framework/qs60mainappui.cpp \
  • trunk/src/gui/s60framework/s60main.rss

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
Note: See TracChangeset for help on using the changeset viewer.