|
1 /* |
|
2 * Copyright (c) 2002 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 - Provides LM document class methods. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 // INCLUDE FILES |
|
25 #include "CLmkDocument.h" |
|
26 #include "CLmkAppUi.h" |
|
27 #include "landmarks.hrh" |
|
28 #include "Debug.h" |
|
29 #include <EPos_CPosLandmarkDatabase.h> |
|
30 |
|
31 |
|
32 // ================= MEMBER FUNCTIONS ======================= |
|
33 // ---------------------------------------------------------------------------- |
|
34 // CLmkDocument::CLmkDocument |
|
35 // ---------------------------------------------------------------------------- |
|
36 // |
|
37 CLmkDocument::CLmkDocument( CEikApplication& aApp ) |
|
38 : CEikDocument( aApp ) |
|
39 { |
|
40 } |
|
41 |
|
42 // ---------------------------------------------------------------------------- |
|
43 // CLmkDocument::~CLmkDocument |
|
44 // ---------------------------------------------------------------------------- |
|
45 // |
|
46 CLmkDocument::~CLmkDocument() |
|
47 { |
|
48 delete iDb; |
|
49 } |
|
50 |
|
51 // ---------------------------------------------------------------------------- |
|
52 // CLmkDocument::ConstructL |
|
53 // Symbian 2nd phase constructor can leave. |
|
54 // ---------------------------------------------------------------------------- |
|
55 // |
|
56 void CLmkDocument::ConstructL() |
|
57 { |
|
58 DEBUG( CLmkDocument::ConstructL entered ); |
|
59 TRAP(iError,iDb = CPosLandmarkDatabase::OpenL()); |
|
60 DEBUG1( CLmkDocument::ConstructL iError=%d,iError ); |
|
61 } |
|
62 |
|
63 // ---------------------------------------------------------------------------- |
|
64 // CLmkDocument::NewL |
|
65 // Two-phased constructor. |
|
66 // ---------------------------------------------------------------------------- |
|
67 // |
|
68 CLmkDocument* CLmkDocument::NewL( |
|
69 CEikApplication& aApp ) // CLocApp reference |
|
70 { |
|
71 CLmkDocument* self = new ( ELeave ) CLmkDocument( aApp ); |
|
72 CleanupStack::PushL( self ); |
|
73 self->ConstructL(); |
|
74 CleanupStack::Pop(); |
|
75 return self; |
|
76 } |
|
77 |
|
78 // ---------------------------------------------------- |
|
79 // CLmkDocument::CreateAppUiL |
|
80 // constructs CLmkAppUi |
|
81 // ---------------------------------------------------- |
|
82 // |
|
83 CEikAppUi* CLmkDocument::CreateAppUiL() |
|
84 { |
|
85 return new ( ELeave ) CLmkAppUi; |
|
86 } |
|
87 |
|
88 // ---------------------------------------------------------------------------- |
|
89 // CLmkDocument::LmDb |
|
90 // ---------------------------------------------------------------------------- |
|
91 // |
|
92 CPosLandmarkDatabase& CLmkDocument::LmDbL() const |
|
93 { |
|
94 if ( iError != KErrNone) |
|
95 { |
|
96 User::Leave(iError); |
|
97 } |
|
98 return *iDb; |
|
99 } |
|
100 |
|
101 // End of File |