|
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: Operation for compacting a landmarks database. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CPOSLMLOCALCOMPACTINGOP_H |
|
21 #define CPOSLMLOCALCOMPACTINGOP_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "EPos_CPosLmLocalOperation.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CPosLmLocalDatabase; |
|
28 class CPosLmCompactDatabase; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Operation for compacting a landmarks database. This operation can be |
|
34 * either synchronous or asynchronous. |
|
35 * |
|
36 * @lib eposlmlocalaccess.lib |
|
37 */ |
|
38 NONSHARABLE_CLASS(CPosLmLocalCompactingOp) : public CPosLmLocalOperation |
|
39 { |
|
40 |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * @param aDb A database. |
|
46 */ |
|
47 static CPosLmLocalCompactingOp* NewL( |
|
48 /* IN */ CPosLmLocalDatabase& aDb |
|
49 ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CPosLmLocalCompactingOp(); |
|
55 |
|
56 public: // Functions from base classes |
|
57 |
|
58 /** |
|
59 * From CPosLmLocalOperation |
|
60 * Synchronous incremental execution of the operation. Performs a single |
|
61 * step of the operation synchronously. |
|
62 * |
|
63 * Leaves with an error code if something goes wrong. |
|
64 * |
|
65 * @param aProgress Will be set to the progress of the operation when |
|
66 * the step has finished. |
|
67 * @return @p KPosLmOperationNotComplete if the step has completed but |
|
68 * more steps are needed before the operation has finished, |
|
69 * @p KErrNone if the operation has finished successfully. |
|
70 */ |
|
71 TInt NextStepL( |
|
72 /* OUT */ TReal32& aProgress |
|
73 ); |
|
74 |
|
75 /** |
|
76 * From CPosLmLocalOperation |
|
77 * Handles any error generated by NextStepL. Will be called when |
|
78 * NextStepL leaves. The error code is allowed to be changed, if |
|
79 * necessary. |
|
80 * |
|
81 * @param aError An error code generated by NextStepL. |
|
82 */ |
|
83 void HandleError( |
|
84 /* IN/OUT */ TInt& aError |
|
85 ); |
|
86 |
|
87 private: |
|
88 |
|
89 /** |
|
90 * C++ default constructor. |
|
91 * @param aDb A database. |
|
92 */ |
|
93 CPosLmLocalCompactingOp( |
|
94 /* IN */ CPosLmLocalDatabase& aDb |
|
95 ); |
|
96 |
|
97 /** |
|
98 * By default Symbian 2nd phase constructor is private. |
|
99 */ |
|
100 void ConstructL(); |
|
101 |
|
102 // Prohibit copy constructor if not deriving from CBase. |
|
103 CPosLmLocalCompactingOp(const CPosLmLocalCompactingOp&); |
|
104 // Prohibit assigment operator if not deriving from CBase. |
|
105 CPosLmLocalCompactingOp& operator=(const CPosLmLocalCompactingOp&); |
|
106 |
|
107 private: // Data |
|
108 |
|
109 CPosLmCompactDatabase* iCompactDb; |
|
110 |
|
111 // Status flag. Holding the current status. |
|
112 TInt iStatusFlag; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif // CPOSLMLOCALCOMPACTINGOP_H |
|
117 |
|
118 // End of File |