| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** All rights reserved.
|
|---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
|---|
| 6 | **
|
|---|
| 7 | ** This file is part of the Symbian application wrapper of the Qt Toolkit.
|
|---|
| 8 | **
|
|---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 10 | ** Commercial Usage
|
|---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 14 | ** a written agreement between you and Nokia.
|
|---|
| 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 | ** GNU General Public License Usage
|
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 32 | ** packaging of this file. Please review the following information to
|
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
|---|
| 35 | **
|
|---|
| 36 | ** If you have questions regarding the use of this file, please contact
|
|---|
| 37 | ** Nokia at [email protected].
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | // INCLUDE FILES
|
|---|
| 43 | #include <exception>
|
|---|
| 44 | #include <private/qcore_symbian_p.h>
|
|---|
| 45 | #include "qs60maindocument.h"
|
|---|
| 46 | #include "qs60mainapplication_p.h"
|
|---|
| 47 | #include "qs60mainapplication.h"
|
|---|
| 48 | #include <bautils.h>
|
|---|
| 49 | #include <coemain.h>
|
|---|
| 50 | #ifndef Q_WS_S60
|
|---|
| 51 | # include <eikserverapp.h>
|
|---|
| 52 | #endif
|
|---|
| 53 |
|
|---|
| 54 | QT_BEGIN_NAMESPACE
|
|---|
| 55 |
|
|---|
| 56 | /**
|
|---|
| 57 | * factory function to create the QS60Main application class
|
|---|
| 58 | */
|
|---|
| 59 | CApaApplication *newS60Application()
|
|---|
| 60 | {
|
|---|
| 61 | return new QS60MainApplication;
|
|---|
| 62 | }
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 | /*!
|
|---|
| 66 | \class QS60MainApplication
|
|---|
| 67 | \since 4.6
|
|---|
| 68 | \brief The QS60MainApplication class provides support for migration from S60.
|
|---|
| 69 |
|
|---|
| 70 | \warning This class is provided only to get access to S60 specific
|
|---|
| 71 | functionality in the application framework classes. It is not
|
|---|
| 72 | portable. We strongly recommend against using it in new applications.
|
|---|
| 73 |
|
|---|
| 74 | The QS60MainApplication provides a helper class for use in migrating
|
|---|
| 75 | from existing S60 based applications to Qt based applications. It is
|
|---|
| 76 | used in the exact same way as the \c CEikApplication class from
|
|---|
| 77 | Symbian, but internally provides extensions used by Qt.
|
|---|
| 78 |
|
|---|
| 79 | When modifying old S60 applications that rely on implementing
|
|---|
| 80 | functions in \c CEikApplication, the class should be modified to
|
|---|
| 81 | inherit from this class instead of \c CEikApplication. Then the
|
|---|
| 82 | application can choose to override only certain functions. To make
|
|---|
| 83 | Qt use the custom application objects, pass a factory function to
|
|---|
| 84 | \c{QApplication::QApplication(QApplication::QS60MainApplicationFactory, int &, char **)}.
|
|---|
| 85 |
|
|---|
| 86 | For more information on \c CEikApplication, please see the S60 documentation.
|
|---|
| 87 |
|
|---|
| 88 | Unlike other Qt classes, QS60MainApplication behaves like an S60 class, and can throw Symbian
|
|---|
| 89 | leaves.
|
|---|
| 90 |
|
|---|
| 91 | \sa QS60MainDocument, QS60MainAppUi, QApplication::QS60MainApplicationFactory
|
|---|
| 92 | */
|
|---|
| 93 |
|
|---|
| 94 | /*!
|
|---|
| 95 | * \brief Contructs an instance of QS60MainApplication.
|
|---|
| 96 | */
|
|---|
| 97 | QS60MainApplication::QS60MainApplication()
|
|---|
| 98 | {
|
|---|
| 99 | }
|
|---|
| 100 |
|
|---|
| 101 | /*!
|
|---|
| 102 | * \brief Destroys the QS60MainApplication.
|
|---|
| 103 | */
|
|---|
| 104 | QS60MainApplication::~QS60MainApplication()
|
|---|
| 105 | {
|
|---|
| 106 | }
|
|---|
| 107 |
|
|---|
| 108 | /*!
|
|---|
| 109 | * \brief Creates an instance of QS60MainDocument.
|
|---|
| 110 | *
|
|---|
| 111 | * \sa QS60MainDocument
|
|---|
| 112 | */
|
|---|
| 113 | CApaDocument *QS60MainApplication::CreateDocumentL()
|
|---|
| 114 | {
|
|---|
| 115 | // Create an QtS60Main document, and return a pointer to it
|
|---|
| 116 | return new (ELeave) QS60MainDocument(*this);
|
|---|
| 117 | }
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 | /*!
|
|---|
| 121 | * \brief Returns the UID of the application.
|
|---|
| 122 | */
|
|---|
| 123 | TUid QS60MainApplication::AppDllUid() const
|
|---|
| 124 | {
|
|---|
| 125 | // Return the UID for the QtS60Main application
|
|---|
| 126 | return RProcess().SecureId().operator TUid();
|
|---|
| 127 | }
|
|---|
| 128 |
|
|---|
| 129 | /*!
|
|---|
| 130 | * \brief Returns the resource file name.
|
|---|
| 131 | */
|
|---|
| 132 | TFileName QS60MainApplication::ResourceFileName() const
|
|---|
| 133 | {
|
|---|
| 134 | return KNullDesC();
|
|---|
| 135 | }
|
|---|
| 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 |
|
|---|
| 165 | QT_END_NAMESPACE
|
|---|