1 /* |
|
2 * Copyright (c) 2004 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 * This class provides functionality for adding multiple |
|
16 * landmarks to multiple categories in one asynchronous |
|
17 * operation. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 #ifndef CLMKADDTOCATOPERATION_H |
|
29 #define CLMKADDTOCATOPERATION_H |
|
30 |
|
31 // INCLUDES |
|
32 #include "MLmkAOOperationObserver.h" |
|
33 #include <EPos_CPosLmOperation.h> |
|
34 #include <EPos_Landmarks.h> |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CPosLmCategoryManager; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * CLmkAddToCatOperation class. |
|
43 * This class provides functionality for adding multiple landmarks to |
|
44 * multiple categories in one asynchronous operation. It is done by chaining |
|
45 * multiple CPosLmCategoryManager::AddCategoryToLandmarksL() operations. |
|
46 */ |
|
47 class CLmkAddToCatOperation |
|
48 : public CPosLmOperation, |
|
49 public MLmkAOOperationObserver |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 /** |
|
53 * Creates CLmkAddToCatOperation |
|
54 * @param aCategoryMgr |
|
55 * @param aLandmarkIdArray |
|
56 * @param aCategoryIdArray |
|
57 * @return newly instantiated object |
|
58 */ |
|
59 static CLmkAddToCatOperation* NewL( |
|
60 CPosLmCategoryManager& aCategoryMgr, |
|
61 const RArray<TPosLmItemId>& aLandmarkIdArray, |
|
62 const RArray<TPosLmItemId>& aCategoryIdArray ); |
|
63 |
|
64 /** |
|
65 * Creates CLmkAddToCatOperation |
|
66 * @param aCategoryMgr |
|
67 * @param aLandmarkId |
|
68 * @param aCategoryIdArray |
|
69 * @return newly instantiated object |
|
70 */ |
|
71 static CLmkAddToCatOperation* NewL( |
|
72 CPosLmCategoryManager& aCategoryMgr, |
|
73 TPosLmItemId aLandmarkId, |
|
74 const RArray<TPosLmItemId>& aCategoryIdArray ); |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 ~CLmkAddToCatOperation(); |
|
80 |
|
81 public: // From CPosLmOperation |
|
82 void NextStep( TRequestStatus& aStatus, TReal32& aProgress ); |
|
83 void ExecuteL(); |
|
84 |
|
85 protected: // From MLmkAOOperationObserver |
|
86 void HandleOperationL( TOperationTypes aType, |
|
87 TReal32 aProgress, |
|
88 TInt aStatus ); |
|
89 |
|
90 protected: // Constructors and destructor |
|
91 /** |
|
92 * C++ constructor. |
|
93 * @param aCategoryMgr |
|
94 * @return newly instantiated object |
|
95 */ |
|
96 CLmkAddToCatOperation( CPosLmCategoryManager& aCategoryMgr ); |
|
97 |
|
98 /** |
|
99 * By default Symbian 2nd phase constructor is private. |
|
100 * @param aLandmarkIdArray |
|
101 * @param aCategoryIdArray |
|
102 */ |
|
103 void ConstructL( const RArray<TPosLmItemId>& aLandmarkIdArray, |
|
104 const RArray<TPosLmItemId>& aCategoryIdArray ); |
|
105 |
|
106 private: //new functions |
|
107 /** |
|
108 * Internal helper method which performs one |
|
109 * CPosLmCategoryManager::AddCategoryToLandmarksL() operation. |
|
110 * @param aCategoryId |
|
111 */ |
|
112 void DoAddToCatStepL( TPosLmItemId aCategoryId ); |
|
113 |
|
114 private: // Data |
|
115 RArray<TPosLmItemId> iLmIdArray; |
|
116 |
|
117 RArray<TPosLmItemId> iCatIdArray; |
|
118 |
|
119 CPosLmCategoryManager& iCategoryMgr; |
|
120 |
|
121 TInt iCurrentIndex; |
|
122 |
|
123 ///Ref: |
|
124 TRequestStatus* iStatus; |
|
125 |
|
126 ///Ref: |
|
127 TReal32* iProgress; |
|
128 |
|
129 ///Own: |
|
130 CLmkAOOperation* iAddOperation; |
|
131 }; |
|
132 |
|
133 #endif // CLMKADDTOCATOPERATION_H |
|
134 |
|
135 // End of File |
|