|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Plug-in main class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WRTDATA_H |
|
20 #define WRTDATA_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <LiwCommon.h> |
|
24 #include <AknsItemID.h> |
|
25 #include "wrtdatapluginconst.h" |
|
26 #include "aicontentpublisher.h" |
|
27 |
|
28 class MLiwInterface; |
|
29 class CLiwServiceHandler; |
|
30 class CWrtDataObserver; |
|
31 class CWrtDataPlugin; |
|
32 |
|
33 /** |
|
34 * @ingroup group_wrtdataplugin |
|
35 * |
|
36 * Wrt data |
|
37 * |
|
38 * @since S60 v3.2 |
|
39 */ |
|
40 class CWrtData : public CBase |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Part of the two phased construction |
|
46 * |
|
47 * @param aPlugin refrence of the plugin |
|
48 * @return none |
|
49 */ |
|
50 static CWrtData* NewL(CWrtDataPlugin* aPlugin); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 * |
|
55 * @param none |
|
56 * @return none |
|
57 */ |
|
58 ~CWrtData(); |
|
59 |
|
60 private : |
|
61 |
|
62 /** |
|
63 * Constructor |
|
64 * |
|
65 * @param none |
|
66 * @return none |
|
67 */ |
|
68 CWrtData(); |
|
69 |
|
70 |
|
71 /** |
|
72 * Part of the two phased construction |
|
73 * |
|
74 * @param aPlugin reference of the plugin |
|
75 * @return void |
|
76 */ |
|
77 void ConstructL(CWrtDataPlugin* aPlugin); |
|
78 |
|
79 /** |
|
80 * Change the publisher status |
|
81 * |
|
82 * @param aStatus new status of the publisher |
|
83 * @return void |
|
84 */ |
|
85 void ChangePublisherStatusL(const TDesC& aStatus); |
|
86 |
|
87 /** |
|
88 * Gets the menu item from the publisher |
|
89 * |
|
90 * @param none |
|
91 * @return void |
|
92 */ |
|
93 void GetMenuItemsL(); |
|
94 |
|
95 public : |
|
96 |
|
97 /** |
|
98 * Configures the subscriber and data to subscribe. |
|
99 * |
|
100 * @param aConfigurations Information about the subscriber |
|
101 * and the data to subscribe. |
|
102 * @return void |
|
103 */ |
|
104 void ConfigureL(RAiSettingsItemArray& aConfigurations); |
|
105 |
|
106 /** |
|
107 * Publish updated data for all the items in the widget |
|
108 * |
|
109 * @param aObserver to publish data |
|
110 * @return void |
|
111 */ |
|
112 void PublishAllL( MAiContentObserver* aObserver ); |
|
113 |
|
114 /** |
|
115 * Execute the command to get the data from CPS |
|
116 * |
|
117 * @param aInFilter input filter for the command |
|
118 * @param aOutDataMap output data map |
|
119 * @param aRegistry type of registry (publisher/cp_data) |
|
120 * @return void |
|
121 */ |
|
122 void ExecuteCommandL(CLiwDefaultMap* aInFilter, |
|
123 CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ); |
|
124 |
|
125 /** |
|
126 * Checks is this menu item is supported by the publisher |
|
127 * |
|
128 * @param aMenuItem menu item name. |
|
129 * @return boolean (ETrue/EFalse) |
|
130 */ |
|
131 TBool HasMenuItem(const TDesC16& aMenuItem ); |
|
132 |
|
133 /** |
|
134 * Publish the updated data |
|
135 * |
|
136 * @param aObserver to publish data |
|
137 * @return void |
|
138 */ |
|
139 void PublishL( MAiContentObserver* aObserver ); |
|
140 |
|
141 /** |
|
142 * Tigger for execution of a action for a specific content id. |
|
143 * |
|
144 * @param aObjectId object Id. |
|
145 * @param aTrigger name of the trigger. |
|
146 * @return void |
|
147 */ |
|
148 void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger); |
|
149 |
|
150 /** |
|
151 * Register to CPS for all (add/delete/update/execute) action |
|
152 * |
|
153 * @param none |
|
154 * @return void |
|
155 */ |
|
156 void RegisterL(); |
|
157 |
|
158 /** |
|
159 * Called by the observer to refresh the changed content |
|
160 * |
|
161 * @param aPublisher publisher. |
|
162 * @param aContentType content type. |
|
163 * @param aContentId content Id. |
|
164 * @param aOperation operation (add/delete/update/execute). |
|
165 * @return void |
|
166 */ |
|
167 void RefreshL( TDesC& aPublisher, TDesC& aContentType, |
|
168 TDesC& aContentId, TDesC& aOperation ); |
|
169 |
|
170 /** |
|
171 * Createts the filter map |
|
172 * |
|
173 * @return filter map |
|
174 */ |
|
175 CLiwDefaultMap* CreateFilterLC( ); |
|
176 |
|
177 /** |
|
178 * Is the pugin is active to publish the data. |
|
179 * |
|
180 * @param None |
|
181 * @return boolean (ETrue/EFalse). |
|
182 */ |
|
183 TBool IsPluginActive(); |
|
184 |
|
185 /** |
|
186 * Resume the publisher |
|
187 * |
|
188 * @param None |
|
189 * @return void |
|
190 */ |
|
191 void ResumeL(); |
|
192 |
|
193 /** |
|
194 * Suspend the publisher |
|
195 * |
|
196 * @param None |
|
197 * @return void |
|
198 */ |
|
199 void SuspendL(); |
|
200 |
|
201 /** |
|
202 * Activate the publisher |
|
203 * |
|
204 * @param None |
|
205 * @return void |
|
206 */ |
|
207 void ActivateL(); |
|
208 |
|
209 /** |
|
210 * Deactivate the publisher |
|
211 * |
|
212 * @param None |
|
213 * @return void |
|
214 */ |
|
215 void DeActivateL(); |
|
216 |
|
217 /** |
|
218 * OnLineL |
|
219 * |
|
220 * @param None |
|
221 * @return void |
|
222 */ |
|
223 void OnLineL(); |
|
224 |
|
225 /** |
|
226 * OffLineL |
|
227 * |
|
228 * @param None |
|
229 * @return void |
|
230 */ |
|
231 void OffLineL(); |
|
232 |
|
233 /** |
|
234 * InActiveL |
|
235 * |
|
236 * @param None |
|
237 * @return void |
|
238 */ |
|
239 void InActiveL(); |
|
240 |
|
241 /** |
|
242 * Update the publisher status |
|
243 * |
|
244 * @param None |
|
245 * @return void |
|
246 */ |
|
247 void UpdatePublisherStatusL(); |
|
248 |
|
249 /** |
|
250 * Resolves skin item id and Mif id from pattern |
|
251 * skin( <majorId> <minorId> (<colourGroupId>) |
|
252 * mif(<MifFileName.mif> <bitmapId> <maskId>) |
|
253 * |
|
254 * @param aPath skin pattern / mif pattern value |
|
255 * @param aItemId skin item id |
|
256 * @param aMifId mif id |
|
257 * @param aMaskId mask id |
|
258 * @param aFilename mif file name |
|
259 * @return boolean (ETrue/EFalse) |
|
260 */ |
|
261 TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, |
|
262 TInt& aMifId, TInt& aMaskId, TDes& aFilename ); |
|
263 |
|
264 private : |
|
265 |
|
266 // Subscriber interface |
|
267 // own |
|
268 MLiwInterface* iInterface; |
|
269 |
|
270 // Data Observer to CPS |
|
271 // Own |
|
272 CWrtDataObserver* iObserver; |
|
273 |
|
274 // Service handler |
|
275 // Own |
|
276 CLiwServiceHandler* iServiceHandler; |
|
277 |
|
278 // Command name in configuration Array |
|
279 HBufC8* iCommandName; |
|
280 |
|
281 // Reference of the wrt data plugin |
|
282 // Not owned |
|
283 CWrtDataPlugin* iPlugin; |
|
284 |
|
285 // Menu item names |
|
286 // Own |
|
287 RPointerArray<HBufC16> iMenuItems; |
|
288 |
|
289 // Trigger names for the menu items |
|
290 // Own |
|
291 RPointerArray<HBufC8> iMenuTriggers; |
|
292 |
|
293 HBufC* iContentId; |
|
294 }; |
|
295 |
|
296 #endif /*WRTDATA_H*/ |