|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: LandmarksUi Content File - |
|
15 * Declares document for application. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 // INCLUDE FILES |
|
25 #include "LmUiRefAppDocument.h" |
|
26 #include "LmUiRefAppUi.h" |
|
27 #include <EPos_CPosLandmarkDatabase.h> |
|
28 #include <EPos_Landmarks.h> |
|
29 #include <EPos_CPosLmOperation.h> |
|
30 |
|
31 |
|
32 |
|
33 // ================= MEMBER FUNCTIONS ======================= |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // CLmUiRefAppDocument::CLmUiRefAppDocument |
|
37 // constructor |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 CLmUiRefAppDocument::CLmUiRefAppDocument(CEikApplication& aApp) |
|
41 : CAknDocument(aApp) |
|
42 { |
|
43 } |
|
44 |
|
45 // --------------------------------------------------------------------------- |
|
46 // CLmUiRefAppDocument::~CLmUiRefAppDocument |
|
47 // --------------------------------------------------------------------------- |
|
48 // |
|
49 CLmUiRefAppDocument::~CLmUiRefAppDocument() |
|
50 { |
|
51 delete iDb; |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // CLmUiRefAppDocument::ConstructL() |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 void CLmUiRefAppDocument::ConstructL() |
|
59 { |
|
60 //Open database and initilize it if needed |
|
61 iDb = CPosLandmarkDatabase::OpenL(); |
|
62 CPosLmOperation* operation = NULL; |
|
63 if ( iDb->IsInitializingNeeded() ) |
|
64 { |
|
65 operation = iDb->InitializeL(); |
|
66 operation->ExecuteL(); |
|
67 } |
|
68 } |
|
69 |
|
70 // --------------------------------------------------------------------------- |
|
71 // CLmUiRefAppDocument::NewL() |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 CLmUiRefAppDocument* CLmUiRefAppDocument::NewL( |
|
75 CEikApplication& aApp) |
|
76 { |
|
77 CLmUiRefAppDocument* self = new (ELeave) CLmUiRefAppDocument( aApp ); |
|
78 CleanupStack::PushL( self ); |
|
79 self->ConstructL(); |
|
80 CleanupStack::Pop(); |
|
81 |
|
82 return self; |
|
83 } |
|
84 |
|
85 // ---------------------------------------------------- |
|
86 // CLmUiRefAppDocument::CreateAppUiL() |
|
87 // constructs CLmUiRefAppUi |
|
88 // ---------------------------------------------------- |
|
89 // |
|
90 CEikAppUi* CLmUiRefAppDocument::CreateAppUiL() |
|
91 { |
|
92 return new (ELeave) CLmUiRefAppUi; |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // CLmUiRefAppDocument::LmDb |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 CPosLandmarkDatabase& CLmUiRefAppDocument::LmDb() const |
|
100 { |
|
101 return *iDb; |
|
102 } |
|
103 |
|
104 // End of File |
|
105 |