summaryrefslogtreecommitdiffstats
path: root/src/gui/s60framework/qs60maindocument.cpp
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-09-22 11:48:38 (GMT)
committeraxis <qt-info@nokia.com>2009-09-23 14:06:36 (GMT)
commit77166549a95056a9e0ac78a1e2248c78406630a4 (patch)
treec8bf18cd8bac9c0dcd8a686f902a728487e78c81 /src/gui/s60framework/qs60maindocument.cpp
parent4a157ee126fc482cd1954b80f22f790ec544e241 (diff)
downloadQt-77166549a95056a9e0ac78a1e2248c78406630a4.zip
Qt-77166549a95056a9e0ac78a1e2248c78406630a4.tar.gz
Qt-77166549a95056a9e0ac78a1e2248c78406630a4.tar.bz2
Added support for using custom application objects on S60.
With this patch, the application developer can use his own CEikApplication, CEikDocument and CEikAppUi classes with Qt, by deriving from QS60MainApplication, QSMainDocument and QS60MainAppUi, respectively. He can then register a factory function in the QApplication constructor to have his own objects created during the framework initialization. This patch also fixes some Qt code style issues. RevBy: Jason Barron RevBy: mread RevBy: Sami Merila RevBy: Shane Kearns
Diffstat (limited to 'src/gui/s60framework/qs60maindocument.cpp')
-rw-r--r--src/gui/s60framework/qs60maindocument.cpp99
1 files changed, 40 insertions, 59 deletions
diff --git a/src/gui/s60framework/qs60maindocument.cpp b/src/gui/s60framework/qs60maindocument.cpp
index ba66e98..52595db 100644
--- a/src/gui/s60framework/qs60maindocument.cpp
+++ b/src/gui/s60framework/qs60maindocument.cpp
@@ -39,77 +39,60 @@
**
****************************************************************************/
-// INCLUDE FILES
+#include "qs60mainappui.h"
+#include "qs60maindocument.h"
+
#include <exception>
-#include "qs60mainappui_p.h"
-#include "qs60maindocument_p.h"
QT_BEGIN_NAMESPACE
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// QS60MainDocument::NewL()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-QS60MainDocument* QS60MainDocument::NewL(CEikApplication& aApp)
-{
- QS60MainDocument* self = NewLC(aApp);
- CleanupStack::Pop(self);
- return self;
-}
-
-// -----------------------------------------------------------------------------
-// QS60MainDocument::NewLC()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-QS60MainDocument* QS60MainDocument::NewLC(CEikApplication& aApp)
-{
- QS60MainDocument* self = new(ELeave) QS60MainDocument(aApp);
- CleanupStack::PushL(self);
- self->ConstructL();
- return self;
-}
-
-// -----------------------------------------------------------------------------
-// QS60MainDocument::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void QS60MainDocument::ConstructL()
-{
- // No implementation required
-}
+/*!
+ * \class QS60MainDocument
+ * \obsolete
+ * \since 4.6
+ * \brief Helper class for S60 migration
+ *
+ * The QS60MainDocument provides a helper class for use in migrating from existing S60 based
+ * applications to Qt based applications. It is used in the exact same way as the
+ * \c CAknDocument class from Symbian, but internally provides extensions used by Qt.
+ *
+ * When modifying old S60 applications that rely on implementing functions in \c CAknDocument,
+ * the class should be modified to inherit from this class instead of \c CAknDocument. Then the
+ * application can choose to override only certain functions.
+ *
+ * For more information on \c CAknDocument, please see the S60 documentation.
+ *
+ * Unlike other Qt classes, QS60MainDocument behaves like an S60 class, and can throw Symbian
+ * leaves.
+ *
+ * \sa QS60MainApplication, QS60MainAppUi
+ */
-// -----------------------------------------------------------------------------
-// QS60MainDocument::QS60MainDocument()
-// C++ default constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-//
-QS60MainDocument::QS60MainDocument(CEikApplication& aApp)
- : CAknDocument(aApp)
+/*!
+ * \brief Constructs an instance of QS60MainDocument.
+ *
+ * \a mainApplication should contain a pointer to a QS60MainApplication instance.
+ */
+QS60MainDocument::QS60MainDocument(CEikApplication& mainApplication)
+ : CAknDocument(mainApplication)
{
// No implementation required
}
-// ---------------------------------------------------------------------------
-// QS60MainDocument::~QS60MainDocument()
-// Destructor.
-// ---------------------------------------------------------------------------
-//
+/*!
+ * \brief Destroys the QS60MainDocument.
+ */
QS60MainDocument::~QS60MainDocument()
{
// No implementation required
}
-// ---------------------------------------------------------------------------
-// QS60MainDocument::CreateAppUiL()
-// Constructs CreateAppUi.
-// ---------------------------------------------------------------------------
-//
-CEikAppUi* QS60MainDocument::CreateAppUiL()
+/*!
+ * \brief Creates an instance of QS60MainAppUi.
+ *
+ * \sa QS60MainAppUi
+ */
+CEikAppUi *QS60MainDocument::CreateAppUiL()
{
// Create the application user interface, and return a pointer to it;
// the framework takes ownership of this object
@@ -117,5 +100,3 @@ CEikAppUi* QS60MainDocument::CreateAppUiL()
}
QT_END_NAMESPACE
-
-// End of File