|
1 /* |
|
2 * Copyright (c) 2004-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 - This class wraps functionality related to landmark database |
|
15 * initialization into a simpler interface. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CLMKDBINITIALIZER_H |
|
26 #define CLMKDBINITIALIZER_H |
|
27 |
|
28 // INCLUDES |
|
29 #include "MLmkAOOperationObserver.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CLmkDbUtils; |
|
33 class CPosLandmarkDatabase; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * This class wraps landmark database initialization and compacting |
|
38 * into a simple helper class. |
|
39 * The database initialization and the database compaction operations |
|
40 * are performed in executing two methods of CPosLandmarkDatabase class |
|
41 * asynchronously |
|
42 */ |
|
43 class CLmkDbInitializer : public CBase, public MLmkAOOperationObserver |
|
44 { |
|
45 public: // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * Create CLmkDbInitializer object |
|
49 * @param aDb - landmark database which needs to be initialized |
|
50 * @param aObserver - caller class/object which sets itself as observer to |
|
51 * the CLmkDbInitializer class |
|
52 * @param aProgressNote - Note showing the progress of database initialise |
|
53 * operation |
|
54 * @return newly instantiated object |
|
55 */ |
|
56 static CLmkDbInitializer* NewL( CPosLandmarkDatabase& aDb, |
|
57 MLmkAOOperationObserver& aObserver, |
|
58 TBool aProgressNote ); |
|
59 |
|
60 /** |
|
61 * Destructor. Cancels possibly ongoing operation. |
|
62 */ |
|
63 ~CLmkDbInitializer(); |
|
64 |
|
65 public: // New functions |
|
66 /** |
|
67 * Start the database initialize followed by the compact operation |
|
68 * This is done in two asynchronous calls, one for initialize and the other |
|
69 * for compacting |
|
70 */ |
|
71 void StartInitAndCompactL(); |
|
72 |
|
73 protected: //from MLmkAOOperationObserver |
|
74 void HandleOperationL( TOperationTypes aType, |
|
75 TReal32 aProgress, |
|
76 TInt aStatus ); |
|
77 |
|
78 private: // Constructors and destructor |
|
79 /** |
|
80 * C++ default constructor. |
|
81 * @param aObserver - caller class or object setting itself as observer |
|
82 * for this class |
|
83 * @param aProgressNote -- Note showing the progress of the database |
|
84 * initialize operation |
|
85 * @return newly instantiated object |
|
86 */ |
|
87 CLmkDbInitializer( MLmkAOOperationObserver& aObserver, |
|
88 TBool aProgressNote ); |
|
89 |
|
90 /** |
|
91 * By default Symbian 2nd phase constructor is private. |
|
92 * @param aDb |
|
93 */ |
|
94 void ConstructL( CPosLandmarkDatabase& aDb ); |
|
95 |
|
96 private: // Data |
|
97 ///Ref: |
|
98 MLmkAOOperationObserver& iObserver; |
|
99 |
|
100 ///Own: |
|
101 CLmkDbUtils* iDbUtils; |
|
102 |
|
103 TBool iProgressNote; |
|
104 }; |
|
105 |
|
106 #endif // CLMKDBINITIALIZER_H |
|
107 |
|
108 // End of File |