41 * @since S60 5.2 |
42 * @since S60 5.2 |
42 */ |
43 */ |
43 NONSHARABLE_CLASS( CWrtData ) : public CBase |
44 NONSHARABLE_CLASS( CWrtData ) : public CBase |
44 { |
45 { |
45 public: |
46 public: |
46 // constructor and destructor |
47 |
47 |
48 /** |
|
49 * Part of the two phased constuction |
|
50 * |
|
51 * @param none |
|
52 * @return none |
|
53 */ |
48 static CWrtData* NewL( CWrtDataPlugin* aPlugin ); |
54 static CWrtData* NewL( CWrtDataPlugin* aPlugin ); |
49 |
55 |
|
56 /* |
|
57 * Destructor |
|
58 */ |
50 ~CWrtData(); |
59 ~CWrtData(); |
51 |
60 |
52 public : |
61 private : |
53 |
62 |
54 /** |
63 /** |
55 * Configures the subscriber and data to subscribe. |
64 * Default Constructor |
56 * |
65 * |
57 * @param aConfigurations Information about the subscriber |
66 */ |
58 * and the data to subscribe. |
67 CWrtData(); |
59 * @return void |
68 |
60 */ |
69 /** |
61 void ConfigureL(RAiSettingsItemArray& aConfigurations); |
70 * Part of the two phased construction |
|
71 * |
|
72 * @param aPlugin reference of the plugin |
|
73 * @return void |
|
74 */ |
|
75 void ConstructL(CWrtDataPlugin* aPlugin); |
|
76 |
|
77 public : |
|
78 // new functions |
|
79 |
|
80 /** |
|
81 * Configures the subscriber and data to subscribe. |
|
82 * |
|
83 * @param aConfigurations Information about the subscriber |
|
84 * and the data to subscribe. |
|
85 * @return void |
|
86 */ |
|
87 void ConfigureL(RAiSettingsItemArray& aConfigurations); |
|
88 |
|
89 /** |
|
90 * Register to CPS for all (add/delete/update/execute) action |
|
91 * |
|
92 * @param none |
|
93 * @return void |
|
94 */ |
|
95 void RegisterL(); |
|
96 |
|
97 /** |
|
98 * Update the publisher status |
|
99 * |
|
100 * @param None |
|
101 * @return void |
|
102 */ |
|
103 void UpdatePublisherStatusL(); |
|
104 |
|
105 /** |
|
106 * Publish initial data for all the items in the widget |
|
107 * |
|
108 * @param aObserver to publish data |
|
109 * @return void |
|
110 */ |
|
111 void PublishInitialDataL( MAiContentObserver* aObserver ); |
|
112 |
|
113 /** |
|
114 * Publish updated data for all the items in the widget |
|
115 * |
|
116 * @param aObserver to publish data |
|
117 * @return void |
|
118 */ |
|
119 void PublishDefaultImageL( MAiContentObserver* aObserver ); |
|
120 |
|
121 /** |
|
122 * Publish the updated data |
|
123 * |
|
124 * @param aObserver to publish data |
|
125 * @param aDataMap data map |
|
126 * @return void |
|
127 */ |
|
128 void PublishL( MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap ); |
|
129 |
|
130 /** |
|
131 * Called by the observer to refresh the changed content |
|
132 * |
|
133 * @param aContentId content Id. |
|
134 * @param aOperation operation (add/delete/update/execute). |
|
135 * @param aDataMap data map. |
|
136 * @return void |
|
137 */ |
|
138 void RefreshL( TDesC& aContentId, TDesC& aOperation, CLiwDefaultMap* aDataMap ); |
|
139 |
|
140 /** |
|
141 * Tigger for execution of a action for a specific content id. |
|
142 * |
|
143 * @param aObjectId object Id. |
|
144 * @param aTrigger name of the trigger. |
|
145 * @return void |
|
146 */ |
|
147 void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger); |
|
148 |
|
149 /** |
|
150 * Is the pugin is active to publish the data. |
|
151 * |
|
152 * @param None |
|
153 * @return boolean (ETrue/EFalse). |
|
154 */ |
|
155 TBool IsPluginActive(); |
|
156 |
|
157 /** |
|
158 * Notify the status to the publisher |
|
159 * |
|
160 * @param aStatus new status of the publisher |
|
161 * @return void |
|
162 */ |
|
163 void NotifyPublisherL(const TDesC8& aStatus); |
|
164 |
|
165 /** |
|
166 * Sets property value. |
|
167 * |
|
168 * @since S60 5.2 |
|
169 * @param aAny - contains pointer to command buffer. |
|
170 * @param aNameSpace - plugin name space id |
|
171 */ |
|
172 void SetCommandBuffer(TAny* aAny, const TDesC8& aNameSpace); |
|
173 |
|
174 private: |
|
175 // new functions |
62 |
176 |
63 /** |
177 /** |
64 * Checks is this menu item is supported by the publisher |
178 * Createts the filter map |
65 * |
179 * |
66 * @param aMenuItem menu item name. |
180 * @return filter map |
67 * @return boolean (ETrue/EFalse) |
181 */ |
68 */ |
182 CLiwDefaultMap* CreateFilterLC( ); |
69 TBool HasMenuItem(const TDesC16& aMenuItem ); |
183 |
70 |
184 /** |
71 /** |
185 * Execute the command to get the data from CPS |
72 * Register to CPS for all (add/delete/update/execute) action |
186 * |
73 * |
187 * @param aInFilter input filter for the command |
74 * @param none |
188 * @param aOutDataMap output data map |
75 * @return void |
189 * @param aRegistry type of registry (publisher/cp_data) |
76 */ |
190 * @return void |
77 void RegisterL(); |
191 */ |
78 |
192 void ExecuteCommandL(CLiwDefaultMap* aInFilter, |
79 /** |
193 CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ); |
80 * Update the publisher status |
194 |
81 * |
195 /** |
82 * @param None |
196 * Gets the widgent name and uid |
83 * @return void |
197 * |
84 */ |
198 * @param aName - widget name |
85 void UpdatePublisherStatusL(); |
199 * @param aAppUID - widget uid |
86 |
200 * @return void |
87 /** |
201 */ |
88 * Publish updated data for all the items in the widget |
202 void GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID ); |
89 * |
203 |
90 * @param aObserver to publish data |
204 /** |
91 * @return void |
205 * Resolves the Uid from the string |
92 */ |
206 * |
93 void PublishDefaultImageL( MAiContentObserver* aObserver ); |
207 * @param aUidDes - uid in string |
94 |
208 * @param aUid - uid |
95 /** |
209 * @return ETure/EFalse |
96 * Publish the updated data |
210 */ |
97 * |
211 TBool ResolveUid(const TDesC& aUidDes, TUid& aUid ); |
98 * @param aObserver to publish data |
212 |
99 * @param aDataMap data map |
213 /** |
100 * @return void |
214 * Creates icon from the uid |
101 */ |
215 * |
102 void PublishL( MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap ); |
216 * @param aHandle - icon handle |
103 |
217 * @param aMaskHandle - mask handle |
104 /** |
218 * @param aAppUid - application uid |
105 * Called by the observer to refresh the changed content |
219 * @return ETure/EFalse |
106 * |
220 */ |
107 * @param aContentId content Id. |
221 void CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid ); |
108 * @param aOperation operation (add/delete/update/execute). |
222 |
109 * @param aDataMap data map. |
223 /** |
110 * @return void |
224 * Resend the the current plugin status to publisher |
111 */ |
225 * |
112 void RefreshL( TDesC& aContentId, TDesC& aOperation, CLiwDefaultMap* aDataMap ); |
226 * @param aActionsList new list of status for the publisher |
113 |
227 * @return void |
114 /** |
228 */ |
115 * Tigger for execution of a action for a specific content id. |
229 void ReSendNotificationL(CLiwDefaultList* aActionsList); |
116 * |
230 |
117 * @param aObjectId object Id. |
231 private : |
118 * @param aTrigger name of the trigger. |
|
119 * @return void |
|
120 */ |
|
121 void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger); |
|
122 |
|
123 /** |
|
124 * Is the pugin is active to publish the data. |
|
125 * |
|
126 * @param None |
|
127 * @return boolean (ETrue/EFalse). |
|
128 */ |
|
129 TBool IsPluginActive(); |
|
130 |
|
131 /** |
|
132 * Activate the publisher |
|
133 * |
|
134 * @param None |
|
135 * @return void |
|
136 */ |
|
137 void ActivateL(); |
|
138 |
|
139 /** |
|
140 * Resume the publisher |
|
141 * |
|
142 * @param None |
|
143 * @return void |
|
144 */ |
|
145 void ResumeL(); |
|
146 |
|
147 /** |
|
148 * Suspend the publisher |
|
149 * |
|
150 * @param None |
|
151 * @return void |
|
152 */ |
|
153 void SuspendL(); |
|
154 |
|
155 /** |
|
156 * Deactivate the publisher |
|
157 * |
|
158 * @param None |
|
159 * @return void |
|
160 */ |
|
161 void DeActivateL(); |
|
162 |
|
163 /** |
|
164 * OnLineL |
|
165 * |
|
166 * @param None |
|
167 * @return void |
|
168 */ |
|
169 void OnLineL(); |
|
170 |
|
171 /** |
|
172 * OffLineL |
|
173 * |
|
174 * @param None |
|
175 * @return void |
|
176 */ |
|
177 void OffLineL(); |
|
178 |
|
179 private : |
|
180 |
|
181 /** |
|
182 * Default Constructor |
|
183 * |
|
184 */ |
|
185 CWrtData(); |
|
186 |
|
187 /** |
|
188 * Part of the two phased construction |
|
189 * |
|
190 * @param aPlugin reference of the plugin |
|
191 * @return void |
|
192 */ |
|
193 void ConstructL(CWrtDataPlugin* aPlugin); |
|
194 |
|
195 /** |
|
196 * Createts the filter map |
|
197 * |
|
198 * @return filter map |
|
199 */ |
|
200 CLiwDefaultMap* CreateFilterLC( ); |
|
201 |
|
202 /** |
|
203 * Execute the command to get the data from CPS |
|
204 * |
|
205 * @param aInFilter input filter for the command |
|
206 * @param aOutDataMap output data map |
|
207 * @param aRegistry type of registry (publisher/cp_data) |
|
208 * @return void |
|
209 */ |
|
210 void ExecuteCommandL(CLiwDefaultMap* aInFilter, |
|
211 CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ); |
|
212 |
|
213 |
|
214 /** |
|
215 * Change the publisher status |
|
216 * |
|
217 * @param aStatus new status of the publisher |
|
218 * @return void |
|
219 */ |
|
220 void ChangePublisherStatusL(const TDesC& aStatus); |
|
221 |
|
222 /** |
|
223 * Gets the menu item from the publisher |
|
224 * |
|
225 * @param none |
|
226 * @return void |
|
227 */ |
|
228 void GetMenuItemsL(); |
|
229 |
|
230 /** |
|
231 * Gets the widgent name and uid |
|
232 * |
|
233 * @param aName - widget name |
|
234 * @param aAppUID - widget uid |
|
235 * @return void |
|
236 */ |
|
237 void GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID ); |
|
238 |
|
239 /** |
|
240 * Resolves the Uid from the string |
|
241 * |
|
242 * @param aUidDes - uid in string |
|
243 * @param aUid - uid |
|
244 * @return ETure/EFalse |
|
245 */ |
|
246 TBool ResolveUid(const TDesC& aUidDes, TUid& aUid ); |
|
247 |
|
248 /** |
|
249 * Creates icon from the uid |
|
250 * |
|
251 * @param aHandle - icon handle |
|
252 * @param aMaskHandle - mask handle |
|
253 * @param aAppUid - application uid |
|
254 * @return ETure/EFalse |
|
255 */ |
|
256 void CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid ); |
|
257 |
|
258 private : |
|
259 // data |
232 // data |
260 |
233 TBuf<KHsPublisherNamespaceMaxLength> iPluginId; |
261 /** Subscriber interface, owned */ |
234 /** CPS Command Buffer Interface, Not Owned */ |
262 MLiwInterface* iInterface; |
235 MAiCpsCommandBuffer* iCpsExecute; |
|
236 /** Subscriber interface, Not owned */ |
|
237 MLiwInterface* iInterface; |
|
238 /** Service handler, Not owned */ |
|
239 CLiwServiceHandler* iServiceHandler; |
263 /** Data Observer to CPS, owned */ |
240 /** Data Observer to CPS, owned */ |
264 CWrtDataObserver* iObserver; |
241 CWrtDataObserver* iObserver; |
265 /** Service handler, owned */ |
|
266 CLiwServiceHandler* iServiceHandler; |
|
267 /** Command name in configuration Array, owned */ |
|
268 HBufC8* iCommandName; |
|
269 /** Reference of the wrt data plugin, not owned */ |
242 /** Reference of the wrt data plugin, not owned */ |
270 CWrtDataPlugin* iPlugin; |
243 CWrtDataPlugin* iPlugin; |
271 /** Menu item names, owned */ |
|
272 RPointerArray<HBufC16> iMenuItems; |
|
273 /** Trigger names for the menu items, owned */ |
|
274 RPointerArray<HBufC8> iMenuTriggers; |
|
275 /** Content id, owned */ |
244 /** Content id, owned */ |
276 HBufC* iContentId; |
245 HBufC* iContentId; |
|
246 /** Widget's UID */ |
|
247 TUid iAppUid; |
277 }; |
248 }; |
278 |
249 |
279 #endif /*WRTDATA_H*/ |
250 #endif /*WRTDATA_H*/ |