|
1 /* |
|
2 * Copyright (c) 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 the License "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 C_WRTCONTENTHARVESTER_H |
|
20 #define C_WRTCONTENTHARVESTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <apgcli.h> // RApaLsSession |
|
24 #include <contentharvesterplugin.h> |
|
25 #include "widgetappdefs.rh" |
|
26 #include "wrtharvesterregistryaccess.h" |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CWrtHarvesterPSNotifier; |
|
31 class CWrtHarvesterPublisherObserver; |
|
32 class MLiwInterface; |
|
33 class CLiwGenericParamList; |
|
34 |
|
35 // CONSTANTS |
|
36 |
|
37 // CLASS DECLARATION |
|
38 /** |
|
39 * |
|
40 * |
|
41 * @lib ??????.dll |
|
42 * @since S60 S60 v3.1 |
|
43 */ |
|
44 |
|
45 class CWrtHarvester: public CContentHarvesterPlugin |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CWrtHarvester* NewL( MLiwInterface* aCPSInterface ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CWrtHarvester(); |
|
57 |
|
58 // from base class |
|
59 |
|
60 /** |
|
61 * |
|
62 */ |
|
63 void UpdateL(); |
|
64 |
|
65 /** |
|
66 * |
|
67 */ |
|
68 void TryLaunchNextWidgetL(); |
|
69 |
|
70 /** |
|
71 * @param aContentId |
|
72 * @param aTrigger |
|
73 */ |
|
74 void HandlePublisherNotificationL( const TDesC& aContentId, const TDesC8& aTrigger ); |
|
75 |
|
76 private: |
|
77 |
|
78 /** |
|
79 * Perform the second phase construction |
|
80 */ |
|
81 void ConstructL(); |
|
82 |
|
83 /** |
|
84 * Default constructor. |
|
85 * @param aCPSInterface |
|
86 */ |
|
87 CWrtHarvester( MLiwInterface* aCPSInterface ); |
|
88 |
|
89 /** |
|
90 * |
|
91 */ |
|
92 void UpdatePublishersL(); |
|
93 |
|
94 /** |
|
95 * |
|
96 * @param aPublisherId |
|
97 * @param aContentId |
|
98 * @param aContentType |
|
99 * @param aResultType |
|
100 * @return TInt |
|
101 */ |
|
102 TInt RegisterPublisherL( const TDesC& aPublisherId, const TDesC& aContentId, |
|
103 const TDesC& aContentType, const TDesC8& aResultType ); |
|
104 |
|
105 /** |
|
106 * |
|
107 * @param aPublisherId |
|
108 * @param aContentId |
|
109 * @param aContentType |
|
110 */ |
|
111 void RemovePublisherL( const TDesC& aPublisherId, const TDesC& aContentId, |
|
112 const TDesC& aContentType ); |
|
113 |
|
114 /** |
|
115 * Starts WRT widget |
|
116 * @param aUid Uid of the widget |
|
117 */ |
|
118 void StartWidgetL( TUid aUid ); |
|
119 |
|
120 /** |
|
121 * |
|
122 * @param aPublisherId |
|
123 * @param aContentId |
|
124 * @param aContentType |
|
125 */ |
|
126 void RequestForNotificationL( const TDesC& aPublisherId, const TDesC& aContentId, |
|
127 const TDesC& aContentType ); |
|
128 |
|
129 /** |
|
130 * |
|
131 * @param aInParamList |
|
132 * @return TInt |
|
133 */ |
|
134 TInt ExtractItemId( const CLiwGenericParamList& aInParamList ); |
|
135 |
|
136 |
|
137 /** |
|
138 * |
|
139 */ |
|
140 void LaunchWidgetL( TWidgetOperations aOperation, TUid aUid ); |
|
141 |
|
142 |
|
143 private: // data |
|
144 |
|
145 /** |
|
146 * Instance of CPS interface used for update with CPS. |
|
147 */ |
|
148 MLiwInterface* iCPSInterface; |
|
149 |
|
150 /** |
|
151 * Publish & Subscribe listener |
|
152 * own |
|
153 */ |
|
154 CWrtHarvesterPSNotifier* iWidgetUIListener; |
|
155 |
|
156 /** |
|
157 * Publish & Subscribe listener |
|
158 * own |
|
159 */ |
|
160 CWrtHarvesterPSNotifier* iWidgetRegListener; |
|
161 |
|
162 /** |
|
163 * Publish & Subscribe listener |
|
164 * own |
|
165 */ |
|
166 CWrtHarvesterPSNotifier* iWidgetMMCListener; |
|
167 |
|
168 /** |
|
169 * |
|
170 */ |
|
171 RWrtArray< CWrtHarvesterPublisherObserver > iObservers; |
|
172 |
|
173 /** |
|
174 * |
|
175 */ |
|
176 WrtHarvesterRegistryAccess iRegistryAccess; |
|
177 |
|
178 /** |
|
179 * |
|
180 */ |
|
181 RArray<TUid> iWidgetUids; |
|
182 |
|
183 /** |
|
184 * |
|
185 */ |
|
186 RApaLsSession iApaSession; |
|
187 }; |
|
188 |
|
189 #endif // C_WRTCONTENTHARVESTER_H |