S60 3rd Edition SDK for Symbian OS
Example Applications Guide

LmUiRefAppDocument.cpp

00001 /*
00002 * ============================================================================
00003 *  Name        : LmUiRefAppDocument.h
00004 *  Part of     : Landmarks UI Reference Application 
00005 *  Interface   : 
00006 *  Description : 
00007 *  Version     : 
00008 *
00009 *  Copyright (c) 2005-2006 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation.
00013 * ============================================================================
00014 */
00015 
00016 // INCLUDE FILES
00017 #include "LmUiRefAppDocument.h"
00018 #include "LmUiRefAppUi.h"
00019 #include <EPos_CPosLandmarkDatabase.h>
00020 #include <Epos_Landmarks.h>
00021 #include <EPos_CPosLmOperation.h>
00022 
00023 
00024 
00025 // ================= MEMBER FUNCTIONS =======================
00026 
00027 // ---------------------------------------------------------------------------
00028 // CLmUiRefAppDocument::CLmUiRefAppDocument
00029 // constructor
00030 // ---------------------------------------------------------------------------
00031 //
00032 CLmUiRefAppDocument::CLmUiRefAppDocument(CEikApplication& aApp)
00033 : CAknDocument(aApp)    
00034     {
00035     }
00036 
00037 // ---------------------------------------------------------------------------
00038 // CLmUiRefAppDocument::~CLmUiRefAppDocument
00039 // ---------------------------------------------------------------------------
00040 //
00041 CLmUiRefAppDocument::~CLmUiRefAppDocument()
00042     {
00043     delete iDb;
00044     }
00045 
00046 // ---------------------------------------------------------------------------
00047 // CLmUiRefAppDocument::ConstructL()
00048 // ---------------------------------------------------------------------------
00049 //
00050 void CLmUiRefAppDocument::ConstructL()
00051     {
00052     //Open database and initilize it if needed
00053     iDb = CPosLandmarkDatabase::OpenL();
00054     CPosLmOperation* operation = NULL;
00055     if ( iDb->IsInitializingNeeded() )
00056         {
00057         operation = iDb->InitializeL();
00058         operation->ExecuteL();
00059         }
00060     }
00061 
00062 // ---------------------------------------------------------------------------
00063 // CLmUiRefAppDocument::NewL()
00064 // ---------------------------------------------------------------------------
00065 //
00066 CLmUiRefAppDocument* CLmUiRefAppDocument::NewL(
00067         CEikApplication& aApp)     
00068     {
00069     CLmUiRefAppDocument* self = new (ELeave) CLmUiRefAppDocument( aApp );
00070     CleanupStack::PushL( self );
00071     self->ConstructL();
00072     CleanupStack::Pop();
00073 
00074     return self;
00075     }
00076     
00077 // ----------------------------------------------------
00078 // CLmUiRefAppDocument::CreateAppUiL()
00079 // constructs CLmUiRefAppUi
00080 // ----------------------------------------------------
00081 //
00082 CEikAppUi* CLmUiRefAppDocument::CreateAppUiL()
00083     {
00084     return new (ELeave) CLmUiRefAppUi;
00085     }
00086 
00087 // ---------------------------------------------------------------------------
00088 // CLmUiRefAppDocument::LmDb
00089 // ---------------------------------------------------------------------------
00090 //
00091 CPosLandmarkDatabase& CLmUiRefAppDocument::LmDb() const
00092     {
00093     return *iDb;
00094     }
00095 
00096 // End of File  
00097 

© Nokia 2006

Back to top