17 |
17 |
18 |
18 |
19 #ifndef M_AICONTENTOBSERVER_H |
19 #ifndef M_AICONTENTOBSERVER_H |
20 #define M_AICONTENTOBSERVER_H |
20 #define M_AICONTENTOBSERVER_H |
21 |
21 |
|
22 // System includes |
22 #include <e32std.h> |
23 #include <e32std.h> |
23 |
24 |
24 class MAiPropertyExtension; |
25 // User includes |
|
26 |
|
27 // Forward declarations |
|
28 class CHsContentPublisher; |
|
29 class THsPublisherInfo; |
25 class RFile; |
30 class RFile; |
26 class TDesC8; |
|
27 class TDesC16; |
|
28 struct TAiPublisherInfo; |
|
29 |
31 |
30 /** |
32 /** |
31 * Used by AI Plug-in to give notification about modifications in |
33 * Used by AI Plug-in to give notification about modifications in |
32 * content and/or internal state. |
34 * content and/or internal state. |
33 * |
35 * |
34 * @since S60 3.2 |
36 * @since S60 3.2 |
35 */ |
37 */ |
36 class MAiContentObserver |
38 class MAiContentObserver |
37 { |
39 { |
38 public: // New Enumeration |
40 public: |
39 /** |
41 // data types |
40 * CSS Primitive value type |
42 |
|
43 /** |
|
44 * Value type for SetProperty |
|
45 * |
|
46 * @since S60 5.2 |
41 */ |
47 */ |
42 enum TValueType |
48 enum TValueType |
43 { |
49 { |
44 EValueUnknown = 0, |
50 EValueUnknown = 0, |
45 EValueNumber, |
51 EValueNumber, |
105 virtual TInt CancelTransaction( TInt aTxId ) = 0; |
112 virtual TInt CancelTransaction( TInt aTxId ) = 0; |
106 |
113 |
107 /** |
114 /** |
108 * Invoked by plug-in to test if the specified content can be published. |
115 * Invoked by plug-in to test if the specified content can be published. |
109 * |
116 * |
110 * @param aPlugin - Plug-in property extension interface implementation. |
117 * @param aPlugin - Plug-in interface implementation. |
111 * @param aContent - identification of content selector, MUST correspond |
118 * @param aContent - identification of content selector, MUST correspond |
112 * single content selector supported by plug-in. The framework |
119 * single content selector supported by plug-in. The framework |
113 * utilizes the selector id to match for cid and MIME type. |
120 * utilizes the selector id to match for cid and MIME type. |
114 * @param aIndex - index of the content item. |
121 * @param aIndex - index of the content item. |
115 * @return ETrue - if content could be published; EFalse otherwise. |
122 * @return ETrue - if content could be published; EFalse otherwise. |
116 */ |
123 */ |
117 virtual TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ) = 0; |
124 virtual TBool CanPublish( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ) = 0; |
118 |
125 |
119 /** |
126 /** |
120 * Invoked by the plug-in to inform that content identified by reference |
127 * Invoked by the plug-in to inform that content identified by reference |
121 * aResource must be published to UI control\element identified by selector |
128 * aResource must be published to UI control\element identified by selector |
122 * aContent. |
129 * aContent. |
123 * |
130 * |
124 * @param aPlugin - Plug-in property extension interface implementation. |
131 * @param aPlugin - Plug-in interface implementation. |
125 * @param aContent - identification of content selector, MUST correspond |
132 * @param aContent - identification of content selector, MUST correspond |
126 * single content selector supported by plug-in. The framework |
133 * single content selector supported by plug-in. The framework |
127 * utilizes the selector id to match for cid and MIME type. |
134 * utilizes the selector id to match for cid and MIME type. |
128 * @param aResource - identification of content reference, MUST correspond |
135 * @param aResource - identification of content reference, MUST correspond |
129 * single content reference supported by plug-in. The framework |
136 * single content reference supported by plug-in. The framework |
135 * - KErrNotSupported - if content selector is not supported by |
142 * - KErrNotSupported - if content selector is not supported by |
136 * current UI definition. |
143 * current UI definition. |
137 * - KErrNotFound - if content reference is not found in current |
144 * - KErrNotFound - if content reference is not found in current |
138 * UI definition. |
145 * UI definition. |
139 */ |
146 */ |
140 virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ) = 0; |
147 virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ) = 0; |
141 |
148 |
142 /** |
149 /** |
143 * Invoked by the plug-in to inform that textual content provided within |
150 * Invoked by the plug-in to inform that textual content provided within |
144 * parameter aText must be published to UI control\element identified by |
151 * parameter aText must be published to UI control\element identified by |
145 * selector aContent. |
152 * selector aContent. |
146 * |
153 * |
147 * @param aPlugin - Plug-in property extension interface implementation. |
154 * @param aPlugin - Plug-in interface implementation. |
148 * @param aContent - identification of content selector, MUST correspond |
155 * @param aContent - identification of content selector, MUST correspond |
149 * single content selector supported by plug-in. The framework |
156 * single content selector supported by plug-in. The framework |
150 * utilizes the selector id to match for cid and MIME type. |
157 * utilizes the selector id to match for cid and MIME type. |
151 * @param aText - Textual content in UNICODE. |
158 * @param aText - Textual content in UNICODE. |
152 * @param aIndex - index of the content item. |
159 * @param aIndex - index of the content item. |
157 * - KErrNotFound - if content reference is not found in current |
164 * - KErrNotFound - if content reference is not found in current |
158 * UI definition. |
165 * UI definition. |
159 * - KErrArgument - if content cannot be published to UI element, |
166 * - KErrArgument - if content cannot be published to UI element, |
160 * e.g. MIME type mismatch. |
167 * e.g. MIME type mismatch. |
161 */ |
168 */ |
162 virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ) = 0; |
169 virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ) = 0; |
163 |
170 |
164 /** |
171 /** |
165 * Invoked by the plug-in to inform that content provided within buffer |
172 * Invoked by the plug-in to inform that content provided within buffer |
166 * aBuf must be published to UI control\element identified by selector |
173 * aBuf must be published to UI control\element identified by selector |
167 * aContent. |
174 * aContent. |
168 * |
175 * |
169 * @param aPlugin - Plug-in property extension interface implementation. |
176 * @param aPlugin - Plug-in interface implementation. |
170 * @param aContent - identification of content selector, MUST correspond |
177 * @param aContent - identification of content selector, MUST correspond |
171 * single content selector supported by plug-in. The framework |
178 * single content selector supported by plug-in. The framework |
172 * utilizes the selector id to match for cid and MIME type. |
179 * utilizes the selector id to match for cid and MIME type. |
173 * @param aBuf - instance of content. |
180 * @param aBuf - instance of content. |
174 * @param aIndex - index of the content item. |
181 * @param aIndex - index of the content item. |
179 * - KErrNotFound - if content reference is not found in current |
186 * - KErrNotFound - if content reference is not found in current |
180 * UI definition. |
187 * UI definition. |
181 * - KErrArgument - if content cannot be published to UI element, |
188 * - KErrArgument - if content cannot be published to UI element, |
182 * e.g. MIME type mismatch. |
189 * e.g. MIME type mismatch. |
183 */ |
190 */ |
184 virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ) = 0; |
191 virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ) = 0; |
185 |
192 |
186 /** |
193 /** |
187 * Invoked by the plug-in to inform that an object provided by pointer aPtr |
194 * Invoked by the plug-in to inform that an object provided by pointer aPtr |
188 * must be published to UI control\element identified by selector aContent. |
195 * must be published to UI control\element identified by selector aContent. |
189 * The implementation packages the pointer to a buffer and delegates to |
196 * The implementation packages the pointer to a buffer and delegates to |
190 * buffer publishing method Publish(MAiPropertyExtension&, TInt, const TDesC8&, TInt). |
197 * buffer publishing method Publish(MAiPropertyExtension&, TInt, const TDesC8&, TInt). |
191 * |
198 * |
192 * @param aPlugin - Plug-in property extension interface implementation. |
199 * @param aPlugin - Plug-in interface implementation. |
193 * @param aContent - identification of content selector, MUST correspond |
200 * @param aContent - identification of content selector, MUST correspond |
194 * single content selector supported by plug-in. The framework |
201 * single content selector supported by plug-in. The framework |
195 * utilizes the selector id to match for cid and MIME type. |
202 * utilizes the selector id to match for cid and MIME type. |
196 * @param aPtr - pointer to the content object. The actual type of the |
203 * @param aPtr - pointer to the content object. The actual type of the |
197 * pointer is deduced based on the MIME type of the content item |
204 * pointer is deduced based on the MIME type of the content item |
205 * UI definition. |
212 * UI definition. |
206 * - KErrArgument - if content cannot be published to UI element, |
213 * - KErrArgument - if content cannot be published to UI element, |
207 * e.g. MIME type mismatch. |
214 * e.g. MIME type mismatch. |
208 * @see KAiContentTypeBitmap |
215 * @see KAiContentTypeBitmap |
209 */ |
216 */ |
210 inline TInt PublishPtr( MAiPropertyExtension& aPlugin, TInt aContent, TAny* aPtr, TInt aIndex ); |
217 inline TInt PublishPtr( CHsContentPublisher& aPlugin, TInt aContent, TAny* aPtr, TInt aIndex ); |
211 |
218 |
212 /** |
219 /** |
213 * Helper function for unpacking a pointer that has been published with |
220 * Helper function for unpacking a pointer that has been published with |
214 * MAiContentObserver::PublishPtr. |
221 * MAiContentObserver::PublishPtr. |
215 * |
222 * |
219 |
226 |
220 /** |
227 /** |
221 * Invoked by the plug-in to inform that content from file handle aFile |
228 * Invoked by the plug-in to inform that content from file handle aFile |
222 * must be published to UI control\element identified by selector aContent. |
229 * must be published to UI control\element identified by selector aContent. |
223 * |
230 * |
224 * @param aPlugin - Plug-in property extension interface implementation. |
231 * @param aPlugin - Plug-in interface implementation. |
225 * @param aContent - identification of content selector, MUST correspond |
232 * @param aContent - identification of content selector, MUST correspond |
226 * single content selector supported by plug-in. The framework |
233 * single content selector supported by plug-in. The framework |
227 * utilizes the selector id to match for cid and MIME type. |
234 * utilizes the selector id to match for cid and MIME type. |
228 * @param aFile - file handle from where content can be obtained by UI |
235 * @param aFile - file handle from where content can be obtained by UI |
229 * framework. |
236 * framework. |
235 * - KErrNotFound - if content reference is not found in current |
242 * - KErrNotFound - if content reference is not found in current |
236 * UI definition. |
243 * UI definition. |
237 * - KErrArgument - if content cannot be published to UI element, |
244 * - KErrArgument - if content cannot be published to UI element, |
238 * e.g. MIME type mismatch. |
245 * e.g. MIME type mismatch. |
239 */ |
246 */ |
240 virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ) = 0; |
247 virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ) = 0; |
241 |
248 |
242 /** |
249 /** |
243 * Invoked by the plug-in to inform that content must be cleaned in UI |
250 * Invoked by the plug-in to inform that content must be cleaned in UI |
244 * control\element identified by selector aContent. |
251 * control\element identified by selector aContent. |
245 * |
252 * |
246 * @param aPlugin - Plug-in property extension interface implementation. |
253 * @param aPlugin - Plug-in interface implementation. |
247 * @param aContent - identification of content selector, MUST correspond |
254 * @param aContent - identification of content selector, MUST correspond |
248 * single content selector supported by plug-in. The framework |
255 * single content selector supported by plug-in. The framework |
249 * utilizes the selector id to match for cid and MIME type. |
256 * utilizes the selector id to match for cid and MIME type. |
250 * @param aIndex - index of the content item. |
257 * @param aIndex - index of the content item. |
251 * @return - Possible return values: |
258 * @return - Possible return values: |
252 * - KErrNone - if content is published. |
259 * - KErrNone - if content is published. |
253 * - KErrNotSupported - if content selector is not supported by |
260 * - KErrNotSupported - if content selector is not supported by |
254 * current UI definition. |
261 * current UI definition. |
255 * - KErrNotFound - if content reference is not found in current |
262 * - KErrNotFound - if content reference is not found in current |
256 * UI definition. |
263 * UI definition. |
257 */ |
264 */ |
258 virtual TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ) = 0; |
265 virtual TInt Clean( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ) = 0; |
259 |
266 |
260 /** |
267 /** |
261 * Returns interface extension. Not used in S60 3.2 release. |
268 * Returns interface extension. Not used in S60 3.2 release. |
262 * |
269 * |
263 * @param aUid - UID of the extension interface to access. |
270 * @param aUid - UID of the extension interface to access. |
265 * argument. |
272 * argument. |
266 */ |
273 */ |
267 virtual TAny* Extension( TUid aUid ) = 0; |
274 virtual TAny* Extension( TUid aUid ) = 0; |
268 |
275 |
269 /** |
276 /** |
270 * Invoked by the plugin factory |
277 * Invoked by the plugin factory |
271 * |
278 * |
272 * @param aPublsiherInfo Publisher which requires subscription |
279 * @param aPublsiherInfo Publisher which requires subscription |
273 * @return ETrue if subsription is needed, EFalse otherwise |
280 * @return ETrue if subsription is needed, EFalse otherwise |
274 */ |
281 */ |
275 virtual TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const = 0; |
282 virtual TBool RequiresSubscription( const THsPublisherInfo& aPublisherInfo ) const = 0; |
276 |
283 |
277 /** |
284 /** |
278 * Invoked by the plug-in to change the property value of a specific content. |
285 * Invoked by the plug-in to change the property value of a specific content. |
279 * value type must be string. |
286 * value type must be string. |
280 * @param aPlugin - Plug-in property extension interface implementation. |
287 * @param aPlugin - Plug-in interface implementation. |
281 * @param aElementId - id of content selector, MUST correspond |
288 * @param aElementId - id of content selector, MUST correspond |
282 * single content supported by plug-in. The framework |
289 * single content supported by plug-in. The framework |
283 * utilizes the id to find in the plugin xml defintion. |
290 * utilizes the id to find in the plugin xml defintion. |
284 * @param aPropertyName - property name. |
291 * @param aPropertyName - property name. |
285 * @param aPropertyValue - property value. |
292 * @param aPropertyValue - property value. |
288 * - KErrNotFound - if content reference is not found in current |
295 * - KErrNotFound - if content reference is not found in current |
289 * plugin definition. |
296 * plugin definition. |
290 * - KErrNotSupported - if content selector is not supported by |
297 * - KErrNotSupported - if content selector is not supported by |
291 * current plugin definition. |
298 * current plugin definition. |
292 */ |
299 */ |
293 virtual TInt SetProperty( MAiPropertyExtension& aPlugin, |
300 virtual TInt SetProperty( CHsContentPublisher& aPlugin, |
294 const TDesC8& aElementId, |
301 const TDesC8& aElementId, |
295 const TDesC8& aPropertyName, |
302 const TDesC8& aPropertyName, |
296 const TDesC8& aPropertyValue ) = 0; |
303 const TDesC8& aPropertyValue ) = 0; |
297 |
304 |
298 /** |
305 /** |
299 * Invoked by the plug-in to change the property value of a specific content. |
306 * Invoked by the plug-in to change the property value of a specific content. |
300 * |
307 * |
301 * @param aPlugin - Plug-in property extension interface implementation. |
308 * @param aPlugin - Plug-in interface implementation. |
302 * @param aElementId - id of content selector, MUST correspond |
309 * @param aElementId - id of content selector, MUST correspond |
303 * single content supported by plug-in. The framework |
310 * single content supported by plug-in. The framework |
304 * utilizes the id to find in the plugin xml defintion. |
311 * utilizes the id to find in the plugin xml defintion. |
305 * @param aPropertyName - property name. |
312 * @param aPropertyName - property name. |
306 * @param aPropertyValue - property value. |
313 * @param aPropertyValue - property value. |
310 * - KErrNotFound - if content reference is not found in current |
317 * - KErrNotFound - if content reference is not found in current |
311 * plugin definition. |
318 * plugin definition. |
312 * - KErrNotSupported - if content selector is not supported by |
319 * - KErrNotSupported - if content selector is not supported by |
313 * current plugin definition. |
320 * current plugin definition. |
314 */ |
321 */ |
315 virtual TInt SetProperty( MAiPropertyExtension& aPlugin, |
322 virtual TInt SetProperty( CHsContentPublisher& aPlugin, |
316 const TDesC8& aElementId, |
323 const TDesC8& aElementId, |
317 const TDesC8& aPropertyName, |
324 const TDesC8& aPropertyName, |
318 const TDesC8& aPropertyValue, |
325 const TDesC8& aPropertyValue, |
319 MAiContentObserver::TValueType aValueType) = 0; |
326 MAiContentObserver::TValueType aValueType) = 0; |
320 |
327 |