114
|
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 |
// System includes
|
|
23 |
#include <liwcommon.h>
|
|
24 |
#include <AknsItemID.h>
|
|
25 |
|
|
26 |
// User includes
|
|
27 |
#include <hscontentpublisher.h>
|
|
28 |
#include "wrtdatapluginconst.h"
|
|
29 |
|
|
30 |
// Forward declarations
|
|
31 |
class MLiwInterface;
|
|
32 |
class CLiwServiceHandler;
|
|
33 |
class CWrtDataObserver;
|
|
34 |
class CWrtDataPlugin;
|
|
35 |
class MAiCpsCommandBuffer;
|
|
36 |
|
|
37 |
/**
|
|
38 |
* @ingroup group_wrtdataplugin
|
|
39 |
*
|
|
40 |
* Wrt data
|
|
41 |
*
|
|
42 |
* @since S60 5.2
|
|
43 |
*/
|
|
44 |
NONSHARABLE_CLASS( CWrtData ) : public CBase
|
|
45 |
{
|
|
46 |
public:
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Part of the two phased constuction
|
|
50 |
*
|
|
51 |
* @param none
|
|
52 |
* @return none
|
|
53 |
*/
|
|
54 |
static CWrtData* NewL( CWrtDataPlugin* aPlugin );
|
|
55 |
|
|
56 |
/*
|
|
57 |
* Destructor
|
|
58 |
*/
|
|
59 |
~CWrtData();
|
|
60 |
|
|
61 |
private :
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Default Constructor
|
|
65 |
*
|
|
66 |
*/
|
|
67 |
CWrtData();
|
|
68 |
|
|
69 |
/**
|
|
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
|
|
176 |
|
|
177 |
/**
|
|
178 |
* Createts the filter map
|
|
179 |
*
|
|
180 |
* @return filter map
|
|
181 |
*/
|
|
182 |
CLiwDefaultMap* CreateFilterLC( );
|
|
183 |
|
|
184 |
/**
|
|
185 |
* Execute the command to get the data from CPS
|
|
186 |
*
|
|
187 |
* @param aInFilter input filter for the command
|
|
188 |
* @param aOutDataMap output data map
|
|
189 |
* @param aRegistry type of registry (publisher/cp_data)
|
|
190 |
* @return void
|
|
191 |
*/
|
|
192 |
void ExecuteCommandL(CLiwDefaultMap* aInFilter,
|
|
193 |
CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry );
|
|
194 |
|
|
195 |
/**
|
|
196 |
* Gets the widgent name and uid
|
|
197 |
*
|
|
198 |
* @param aName - widget name
|
|
199 |
* @param aAppUID - widget uid
|
|
200 |
* @return void
|
|
201 |
*/
|
|
202 |
void GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID );
|
|
203 |
|
|
204 |
/**
|
|
205 |
* Resolves the Uid from the string
|
|
206 |
*
|
|
207 |
* @param aUidDes - uid in string
|
|
208 |
* @param aUid - uid
|
|
209 |
* @return ETure/EFalse
|
|
210 |
*/
|
|
211 |
TBool ResolveUid(const TDesC& aUidDes, TUid& aUid );
|
|
212 |
|
|
213 |
/**
|
|
214 |
* Creates icon from the uid
|
|
215 |
*
|
|
216 |
* @param aHandle - icon handle
|
|
217 |
* @param aMaskHandle - mask handle
|
|
218 |
* @param aAppUid - application uid
|
|
219 |
* @return ETure/EFalse
|
|
220 |
*/
|
|
221 |
void CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid );
|
|
222 |
|
|
223 |
/**
|
|
224 |
* Resend the the current plugin status to publisher
|
|
225 |
*
|
|
226 |
* @param aActionsList new list of status for the publisher
|
|
227 |
* @return void
|
|
228 |
*/
|
|
229 |
void ReSendNotificationL(CLiwDefaultList* aActionsList);
|
|
230 |
|
|
231 |
private :
|
|
232 |
// data
|
|
233 |
TBuf<KHsPublisherNamespaceMaxLength> iPluginId;
|
|
234 |
/** CPS Command Buffer Interface, Not Owned */
|
|
235 |
MAiCpsCommandBuffer* iCpsExecute;
|
|
236 |
/** Subscriber interface, Not owned */
|
|
237 |
MLiwInterface* iInterface;
|
|
238 |
/** Service handler, Not owned */
|
|
239 |
CLiwServiceHandler* iServiceHandler;
|
|
240 |
/** Data Observer to CPS, owned */
|
|
241 |
CWrtDataObserver* iObserver;
|
|
242 |
/** Reference of the wrt data plugin, not owned */
|
|
243 |
CWrtDataPlugin* iPlugin;
|
|
244 |
/** Content id, owned */
|
|
245 |
HBufC* iContentId;
|
|
246 |
/** Widget's UID */
|
|
247 |
TUid iAppUid;
|
|
248 |
};
|
|
249 |
|
|
250 |
#endif /*WRTDATA_H*/
|