|
64
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2008 - 2009 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: handles interface to LIW and Content Publishing Service
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
#ifndef CMAILCPSIF_H_
|
|
|
20 |
#define CMAILCPSIF_H_
|
|
|
21 |
|
|
|
22 |
// LIW interface
|
|
|
23 |
#include <liwservicehandler.h>
|
|
|
24 |
#include <liwvariant.h>
|
|
|
25 |
#include <liwgenericparam.h>
|
|
|
26 |
#include <fbs.h>
|
|
|
27 |
#include <data_caging_path_literals.hrh>
|
|
|
28 |
#include <hsccapiclient.h>
|
|
|
29 |
#include <hscontentcontrol.h>
|
|
|
30 |
#include <hscontentinfo.h>
|
|
|
31 |
#include <hscontentinfoarray.h>
|
|
|
32 |
|
|
|
33 |
#include "cmailcpshandler.h"
|
|
|
34 |
#include "cmailcpsifconsts.h"
|
|
|
35 |
|
|
|
36 |
/**
|
|
|
37 |
*
|
|
|
38 |
*/
|
|
|
39 |
class TInstIdInfo
|
|
|
40 |
{
|
|
|
41 |
public:
|
|
|
42 |
TBuf<KMaxDescLen> iCid;
|
|
|
43 |
TBool iUpdateNeeded;
|
|
|
44 |
TBool iWizardPublished;
|
|
|
45 |
};
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
/**
|
|
|
49 |
* CMail ContentPublishingService interface class
|
|
|
50 |
* Class implementing interface towards LIW FW and Content Publishing Service
|
|
|
51 |
*
|
|
|
52 |
* @lib fsmailserver.exe
|
|
|
53 |
* @since S60 v5.1
|
|
|
54 |
*/
|
|
|
55 |
NONSHARABLE_CLASS( CMailCpsIf ) : public CBase,
|
|
|
56 |
public MHsContentControl,
|
|
|
57 |
public MLiwNotifyCallback
|
|
|
58 |
{
|
|
|
59 |
public:
|
|
|
60 |
/**
|
|
|
61 |
* Two-phased constructor.
|
|
|
62 |
*/
|
|
|
63 |
static CMailCpsIf* NewL( CMailCpsHandler* aMailCpsHandler );
|
|
|
64 |
|
|
|
65 |
/**
|
|
|
66 |
* Destructor.
|
|
|
67 |
*/
|
|
|
68 |
~CMailCpsIf();
|
|
|
69 |
|
|
|
70 |
/**
|
|
|
71 |
* Publishes setup text and action to launch setup wizard
|
|
|
72 |
*/
|
|
|
73 |
void PublishSetupWizardL(TInt instance);
|
|
|
74 |
|
|
|
75 |
/**
|
|
|
76 |
* Publishes mailbox name to widget and action to launch CMail UI
|
|
|
77 |
* @param aRowNumber specifies the row on widget UI
|
|
|
78 |
* @param aMailboxName contains name of the mailbox
|
|
|
79 |
*/
|
|
|
80 |
void PublishActiveMailboxNameL( const TInt aInstance,
|
|
|
81 |
const TInt aRowNumber,
|
|
|
82 |
const TDesC& aMailboxName);
|
|
|
83 |
|
|
|
84 |
/**
|
|
|
85 |
* Publishes mailbox name to widget and action related to widget
|
|
|
86 |
* @param aInstance specifies the widget instance on homescreen
|
|
|
87 |
* @param aMailboxName specifies the text to be published
|
|
|
88 |
* @param aAction specifies the action identifier that will be sent back
|
|
|
89 |
* when user presses the widget
|
|
|
90 |
*/
|
|
|
91 |
void PublishMailboxNameL(
|
|
|
92 |
const TInt aInstance,
|
|
|
93 |
const TDesC& aMailboxName,
|
|
|
94 |
const TDesC8& aAction );
|
|
|
95 |
|
|
|
96 |
/**
|
|
|
97 |
* Resets mailbox name from widget
|
|
|
98 |
* @param aRowNumber specifies the row on widget UI
|
|
|
99 |
*/
|
|
|
100 |
// void ResetActiveMailboxNameL( const TInt aRowNumber );
|
|
|
101 |
|
|
|
102 |
/**
|
|
|
103 |
* Publishes unseen or outbox icon
|
|
|
104 |
*/
|
|
|
105 |
void PublishIndicatorIconL( const TInt aInstance,
|
|
|
106 |
const TInt aRowNumber,
|
|
|
107 |
const TInt aIcon );
|
|
|
108 |
|
|
|
109 |
/**
|
|
|
110 |
*
|
|
|
111 |
*/
|
|
|
112 |
void PublishMailboxIconL( const TInt aInstance, const TInt aRowNumber, const TInt aIcon, TFSMailMsgId aMailBoxId );
|
|
|
113 |
|
|
|
114 |
/**
|
|
|
115 |
* Publishes mailbox icon based on given resource path
|
|
|
116 |
* @param aInstance specifies the widget
|
|
|
117 |
* @param aIconResourcePath specifies the icon resource
|
|
|
118 |
* (e.g. "mif(z:\\resource\\apps\\myemailplugin.mif 16384 16385)")
|
|
|
119 |
*/
|
|
|
120 |
void PublishMailboxIconL( const TInt aInstance, const TDesC& aIconPath );
|
|
|
121 |
|
|
|
122 |
/**
|
|
|
123 |
*
|
|
|
124 |
*/
|
|
|
125 |
void PublishIconReferenceL(
|
|
|
126 |
const TDesC& aContentId,
|
|
|
127 |
const TDesC& aContentType,
|
|
|
128 |
const TDesC8& aKey,
|
|
|
129 |
const TDesC& aIconPath );
|
|
|
130 |
|
|
|
131 |
/**
|
|
|
132 |
*
|
|
|
133 |
*/
|
|
|
134 |
void PublishMailDetailL(
|
|
|
135 |
const TInt aInstance,
|
|
|
136 |
const TInt aRowNumber,
|
|
|
137 |
const TDesC& aSender,
|
|
|
138 |
TWidgetMailDetails aDetail);
|
|
|
139 |
|
|
|
140 |
/**
|
|
|
141 |
* Resets mail header data
|
|
|
142 |
* @param aRowNumber specifies the row on widget UI
|
|
|
143 |
*/
|
|
|
144 |
void ResetMessageL( TInt aRowNumber );
|
|
|
145 |
|
|
|
146 |
/**
|
|
|
147 |
*
|
|
|
148 |
*/
|
|
|
149 |
void PublisherRegisteryActionL();
|
|
|
150 |
|
|
|
151 |
/**
|
|
|
152 |
*
|
|
|
153 |
*/
|
|
|
154 |
void RegisterForObserverL();
|
|
|
155 |
|
|
|
156 |
/**
|
|
|
157 |
*
|
|
|
158 |
*/
|
|
|
159 |
void UnRegisterForObserverL();
|
|
|
160 |
|
|
|
161 |
/**
|
|
|
162 |
*
|
|
|
163 |
*/
|
|
|
164 |
TInt HandleNotifyL(
|
|
|
165 |
TInt aCmdId,
|
|
|
166 |
TInt aEventId,
|
|
|
167 |
CLiwGenericParamList& aEventParamList,
|
|
|
168 |
const CLiwGenericParamList& aInParamList );
|
|
|
169 |
|
|
|
170 |
/**
|
|
|
171 |
*
|
|
|
172 |
*/
|
|
|
173 |
TBool PublisherStatusL(const CLiwGenericParamList& aEventParamList);
|
|
|
174 |
|
|
|
175 |
/**
|
|
|
176 |
*
|
|
|
177 |
*/
|
|
|
178 |
TBool AllowedToPublish( TInt aWidgetInstance );
|
|
|
179 |
|
|
|
180 |
/**
|
|
|
181 |
* Sets configuration data to publisher interface
|
|
|
182 |
* CpsIf uses this
|
|
|
183 |
* @param aRowNumber specifies the row on widget UI
|
|
|
184 |
*/
|
|
|
185 |
void SetConfiguration( const TInt32 aConfigData );
|
|
|
186 |
|
|
|
187 |
/**
|
|
|
188 |
*
|
|
|
189 |
*/
|
|
|
190 |
TInt GetWidgetInstanceCount();
|
|
|
191 |
|
|
|
192 |
/**
|
|
|
193 |
*
|
|
|
194 |
*/
|
|
|
195 |
void AddWidgetToHomescreenL( const TFSMailMsgId aMailbox );
|
|
|
196 |
/**
|
|
|
197 |
*
|
|
|
198 |
*/
|
|
|
199 |
TInt GetWidgetInstanceId(const TDesC& aContentId);
|
|
|
200 |
|
|
|
201 |
/**
|
|
|
202 |
*
|
|
|
203 |
*/
|
|
|
204 |
void SetUpdateNeeded( const TInt aInstance, const TBool aValue );
|
|
|
205 |
|
|
|
206 |
/**
|
|
|
207 |
*
|
|
|
208 |
*/
|
|
|
209 |
TBool UpdateNeeded( const TInt aInstance );
|
|
|
210 |
|
|
|
211 |
private:
|
|
|
212 |
|
|
|
213 |
CMailCpsIf( CMailCpsHandler* aMailCpsHandler );
|
|
|
214 |
void ConstructL();
|
|
|
215 |
|
|
|
216 |
/**
|
|
|
217 |
* adds resource file
|
|
|
218 |
*/
|
|
|
219 |
void AllocateResourcesL();
|
|
|
220 |
|
|
|
221 |
/**
|
|
|
222 |
* initializes the LIW IF
|
|
|
223 |
* @return instance of LIW IF
|
|
|
224 |
*/
|
|
|
225 |
MLiwInterface* GetMessagingInterfaceL( );
|
|
|
226 |
|
|
|
227 |
/**
|
|
|
228 |
* Gets published item's ID from LIW. Id is later used e.g. when reseting values
|
|
|
229 |
* @param aInParamList parameter list returned from LIW IF
|
|
|
230 |
* @return Id
|
|
|
231 |
*/
|
|
|
232 |
TUint ExtractItemId( const CLiwGenericParamList& aInParamList );
|
|
|
233 |
|
|
|
234 |
/**
|
|
|
235 |
* Publishes descriptor
|
|
|
236 |
* @param aPublisherId id of the publisher
|
|
|
237 |
* @param aContentType content type of the published data
|
|
|
238 |
* @param aContentId content id of the published data
|
|
|
239 |
* @param aTextToAdd data to be published
|
|
|
240 |
* @param aKey key of the added descriptor
|
|
|
241 |
* @param aTrigger optional trigger tag
|
|
|
242 |
* @param aUid optional app uid (app to be launched)
|
|
|
243 |
* @return Id
|
|
|
244 |
*/
|
|
|
245 |
TUint PublishDescriptorL(
|
|
|
246 |
const TDesC& aPublisherId,
|
|
|
247 |
const TDesC& aContentType,
|
|
|
248 |
const TDesC& aContentId,
|
|
|
249 |
const TDesC& aTextToAdd,
|
|
|
250 |
const TDesC& aKey,
|
|
|
251 |
const TDesC8& aTrigger);
|
|
|
252 |
|
|
|
253 |
/**
|
|
|
254 |
* Publishes image
|
|
|
255 |
* @param aContentId
|
|
|
256 |
* @param aResult
|
|
|
257 |
* @param aBitmapId
|
|
|
258 |
* @param aBitmapMaskId
|
|
|
259 |
* @param aMailBoxId
|
|
|
260 |
*/
|
|
|
261 |
|
|
|
262 |
void PublishImageL(
|
|
|
263 |
const TDesC& aContentId,
|
|
|
264 |
const TDesC& aContentType,
|
|
|
265 |
const TDesC8& aKey,
|
|
|
266 |
TInt aBitmapId,
|
|
|
267 |
TInt aBitmapMaskId,
|
|
|
268 |
TFSMailMsgId aMailBoxId,
|
|
|
269 |
const TDesC& aBrandId );
|
|
|
270 |
|
|
|
271 |
/**
|
|
|
272 |
* Removes a published entity from Content Publishing Service
|
|
|
273 |
* @param aId of the published data
|
|
|
274 |
*/
|
|
|
275 |
void RemoveL( TUint aId );
|
|
|
276 |
|
|
|
277 |
/**
|
|
|
278 |
* Resets all the published content values on HomeScreen database
|
|
|
279 |
*/
|
|
|
280 |
void ResetPublishedDataL( const TDesC& aContentId );
|
|
|
281 |
|
|
|
282 |
//
|
|
|
283 |
// -------------------------- from base classes-----------------------------
|
|
|
284 |
//
|
|
|
285 |
virtual void NotifyWidgetListChanged(); // MHsContentControl
|
|
|
286 |
virtual void NotifyViewListChanged(); // MHsContentControl
|
|
|
287 |
virtual void NotifyAppListChanged(); // MHsContentControl
|
|
|
288 |
|
|
|
289 |
public:
|
|
|
290 |
//
|
|
|
291 |
RArray<TInstIdInfo> iInstIdList;
|
|
|
292 |
private:
|
|
|
293 |
CMailCpsHandler* iMailCpsHandler; //uses
|
|
|
294 |
// LIW IF
|
|
|
295 |
MLiwInterface* iMsgInterface;
|
|
|
296 |
// LIW Service handler
|
|
|
297 |
CLiwServiceHandler* iServiceHandler;
|
|
|
298 |
// resource file offset
|
|
|
299 |
TInt iResourceFileOffset;
|
|
|
300 |
// UIDS of the published entities
|
|
|
301 |
TUint iMailboxNameUid;
|
|
|
302 |
// message count of a mailbox
|
|
|
303 |
TUint iMessageCountUid;
|
|
|
304 |
// row count
|
|
|
305 |
TUint iRowCountUid;
|
|
|
306 |
// message header details id
|
|
|
307 |
TUint iMsgUid;
|
|
|
308 |
// setup text and action id
|
|
|
309 |
TUint iSetupUid;
|
|
|
310 |
// is content allowed to publish
|
|
|
311 |
TBool iAllowedToPublish[KMaxMailboxCount];
|
|
|
312 |
// From configuration: are homescreen notifications observed or ignored
|
|
|
313 |
TBool iIgnoreHsNotifications;
|
|
|
314 |
//
|
|
|
315 |
CHsCcApiClient* iContentControlClient;
|
|
|
316 |
};
|
|
|
317 |
|
|
|
318 |
#endif /*CMAILCPSIF_H_*/
|