|
1 /* |
|
2 * Copyright (c) 2008 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MCSSERVICE_H |
|
20 #define __MCSSERVICE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <liwcommon.h> |
|
24 #include <liwserviceifbase.h> |
|
25 #include <liwbufferextension.h> |
|
26 #include "mcsmenusapi.h" |
|
27 #include "mcsmenuitem.h" |
|
28 #include "mcsoperationmanager.h" |
|
29 |
|
30 class CMCSReqNotification; |
|
31 /** |
|
32 * MCS callback interface, its pure interface class, application need to |
|
33 * Write there own callback derriving from this class. |
|
34 */ |
|
35 |
|
36 class MMCSCallback |
|
37 { |
|
38 /** |
|
39 * Handles notifications caused by an asynchronous calls. |
|
40 * |
|
41 * @return Success/Error code for the callback. |
|
42 */ |
|
43 public: |
|
44 |
|
45 virtual void NotifyResultL(TInt aErrCode, TAny* aResult = NULL ) = 0; |
|
46 }; |
|
47 |
|
48 /** |
|
49 * MCS Service class. |
|
50 */ |
|
51 class CMCSService : public CBase |
|
52 { |
|
53 public: |
|
54 |
|
55 /** |
|
56 * Two Phase Constructor |
|
57 */ |
|
58 IMPORT_C static CMCSService* NewL(const TDesC& aContent); |
|
59 |
|
60 /** |
|
61 * Destructor |
|
62 */ |
|
63 virtual ~CMCSService(); |
|
64 |
|
65 private: |
|
66 |
|
67 /** |
|
68 * Constructor |
|
69 */ |
|
70 CMCSService(); |
|
71 |
|
72 /** |
|
73 * Constructor |
|
74 */ |
|
75 void ConstructL(const TDesC& aContent); |
|
76 |
|
77 /** |
|
78 * @param aInputMap map containing attributes to add or modify |
|
79 * @param aMenuitem menuitem object |
|
80 * @param aFlag flag enum |
|
81 * @return void |
|
82 */ |
|
83 void SetFlagInMenuitemL( CLiwMap& aInputMap, |
|
84 CMenuItem& aMenuitem, TMenuItem::TFlags aFlag); |
|
85 |
|
86 |
|
87 |
|
88 public: |
|
89 |
|
90 /** |
|
91 * Add / Changes an item and its attribute. |
|
92 * @param aCallBack CallBack for asynchronous requests |
|
93 * @param aType type of item |
|
94 * @param aParentId parent id of the item |
|
95 * @param aBeforeId item id after which the new item will be added |
|
96 * @param aInputMap attributes to add or modify |
|
97 * @return void |
|
98 */ |
|
99 IMPORT_C void UpdateItemL( MMCSCallback* aCallBack, TDesC& aType, |
|
100 TInt aId, TInt aParentId, TInt aBeforeId, CLiwMap& aInputMap ); |
|
101 |
|
102 /** |
|
103 * Gets the list of items from xml |
|
104 * @param aInParamList list containing input parameters for getlist |
|
105 * @param aCallBack CallBack for asynchronous requests |
|
106 * @return void |
|
107 */ |
|
108 IMPORT_C void GetListL( const CLiwGenericParamList& aInParamList, |
|
109 MMCSCallback* aCallBack ); |
|
110 |
|
111 |
|
112 /** |
|
113 * Gets the Uid of running applications |
|
114 * @param aCallback CallBack for asynchronous requests |
|
115 * @return void |
|
116 */ |
|
117 IMPORT_C void GetRunningAppsL( MMCSCallback* aCallback ); |
|
118 |
|
119 /** |
|
120 * Execute a action (open/remove) |
|
121 * @param aCallback CallBack for asynchronous requests |
|
122 * @param aItemId item id |
|
123 * @param aAction action to execute |
|
124 * @return void |
|
125 */ |
|
126 IMPORT_C void ExecuteActionL( MMCSCallback* aCallback, |
|
127 TInt aItemId, TDesC8& aAction ); |
|
128 |
|
129 /** |
|
130 * Start notifying the changes |
|
131 * @param aCallback CallBack for asynchronous requests, Ownership is passed |
|
132 * @param aFolderId folder id to observe the events notification. |
|
133 * @param aEvents events to observe |
|
134 * @return void |
|
135 */ |
|
136 IMPORT_C void RegisterObserverL( TInt aFolderId,TInt aEvents,MMCSCallback* aCallBack ); |
|
137 |
|
138 /** |
|
139 * Stop notifying the changes |
|
140 */ |
|
141 IMPORT_C void UnRegisterObserverL(); |
|
142 |
|
143 /** |
|
144 * Delete an Item |
|
145 * @param aCallback CallBack for asynchronous requests, Ownership is passed |
|
146 * @param aItemId item id to delete |
|
147 * @return void |
|
148 */ |
|
149 IMPORT_C void DeleteL( MMCSCallback* aCallBack, TInt aItemId); |
|
150 |
|
151 /** |
|
152 * Set Get running applications output to output parameter |
|
153 * @param aOutputArray GetList array |
|
154 * @param aOutParamList Output parammeter |
|
155 * @return void |
|
156 */ |
|
157 IMPORT_C void SetRunningAppsOutputL( RArray<TUid>& aOutputArray, |
|
158 CLiwGenericParamList& aOutParamList ); |
|
159 |
|
160 /** |
|
161 * Organize |
|
162 * @param aCallback CallBack for asynchronous requests, Ownership is passed |
|
163 * @return void |
|
164 */ |
|
165 IMPORT_C void OrganizeL(MMCSCallback* aCallBack, |
|
166 TInt aItemId, TInt aBeforeItemId); |
|
167 |
|
168 /** |
|
169 * Organize |
|
170 * @param aCallback CallBack for asynchronous requests, Ownership is passed |
|
171 * @return void |
|
172 */ |
|
173 IMPORT_C void OrganizeL(MMCSCallback* aCallBack, |
|
174 const RArray<TInt>& aList, TInt aFolderId, TInt aBeforeItemId); |
|
175 |
|
176 /** |
|
177 * Set the events and folder to notify |
|
178 * @param aFolderId folder id which modified |
|
179 * @param aEvent events occured |
|
180 * @param aOutParamList Output parammeter |
|
181 * @return void |
|
182 */ |
|
183 IMPORT_C void SetReqNotificationOutputL( TInt aFolderId, |
|
184 TInt aEvent, CLiwGenericParamList& aOutParamList ); |
|
185 |
|
186 private: |
|
187 |
|
188 /** Menu */ |
|
189 RMenuSapi iMCS; |
|
190 /** Result Type*/ |
|
191 TBool iFlatResult; |
|
192 /** Notification events registered status */ |
|
193 TBool iIsRegistered; |
|
194 /** Event notifier */ |
|
195 CMCSReqNotification *iReqNotifier; |
|
196 /* own */ |
|
197 RMcsOperationManager iOperationManager; |
|
198 /** |
|
199 * CLiwGenericParamList class pointer |
|
200 * Not Own. |
|
201 */ |
|
202 CLiwGenericParamList* iAttributes; |
|
203 |
|
204 /** |
|
205 * CDesC16ArrayFlat class pointer |
|
206 * Own. |
|
207 */ |
|
208 CDesC16Array* iIgnoredAttributes; |
|
209 |
|
210 /** |
|
211 * CDesC16ArrayFlat class pointer |
|
212 * Own. |
|
213 */ |
|
214 CDesC16Array* iRequiredAttributes; |
|
215 |
|
216 }; |
|
217 |
|
218 |
|
219 #endif /* __MCSSERVICE_H */ |