|
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: Base class for renderers in native ui controller. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_AINATIVERENDERER_H |
|
20 #define M_AINATIVERENDERER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "aidevicestatuscontentmodel.h" |
|
24 #include "aiscutcontentmodel.h" |
|
25 #include "aiprofileplugincontentmodel.h" |
|
26 |
|
27 |
|
28 class RFile; |
|
29 class MAiPropertyExtension; |
|
30 |
|
31 namespace AiNativeUiController |
|
32 { |
|
33 |
|
34 /** |
|
35 * Base class for renderers in native ui controller. |
|
36 * |
|
37 * @since S60 3.2 |
|
38 */ |
|
39 class CAiNativeRenderer : public CBase |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 virtual ~CAiNativeRenderer(); |
|
45 |
|
46 /** |
|
47 * Publish resource. |
|
48 * |
|
49 * @since S60 3.2 |
|
50 * @param aPlugin is publishing plugin. |
|
51 * @param aContent is id of the content. |
|
52 * @param aResource is id of the resource. |
|
53 * @param aIndex is index of the content. |
|
54 * @return KErrNone if publish is successful. |
|
55 */ |
|
56 virtual TInt Publish( MAiPropertyExtension& aPlugin, |
|
57 TInt aContent, |
|
58 TInt aResource, |
|
59 TInt aIndex ); |
|
60 |
|
61 /** |
|
62 * Publish unicode text. |
|
63 * |
|
64 * @since S60 3.2 |
|
65 * @param aPlugin is publishing plugin. |
|
66 * @param aContent is id of the content. |
|
67 * @param aText is published text. |
|
68 * @param aIndex is index of the content. |
|
69 * @return KErrNone if publish is successful. |
|
70 */ |
|
71 virtual TInt Publish( MAiPropertyExtension& aPlugin, |
|
72 TInt aContent, |
|
73 const TDesC16& aText, |
|
74 TInt aIndex ); |
|
75 |
|
76 /** |
|
77 * Publish data. |
|
78 * |
|
79 * @since S60 3.2 |
|
80 * @param aPlugin is publishing plugin. |
|
81 * @param aContent is id of the content. |
|
82 * @param aBuf is published data. |
|
83 * @param aIndex is index of the content. |
|
84 * @return KErrNone if publish is successful. |
|
85 */ |
|
86 virtual TInt Publish( MAiPropertyExtension& aPlugin, |
|
87 TInt aContent, |
|
88 const TDesC8& aBuf, |
|
89 TInt aIndex ); |
|
90 |
|
91 /** |
|
92 * Publish content of the file. |
|
93 * |
|
94 * @since S60 3.2 |
|
95 * @param aPlugin is publishing plugin. |
|
96 * @param aContent is id of the content. |
|
97 * @param aFile is reference to opened file. |
|
98 * @param aIndex is index of the content. |
|
99 * @return KErrNone if publish is successful. |
|
100 */ |
|
101 virtual TInt Publish( MAiPropertyExtension& aPlugin, |
|
102 TInt aContent, |
|
103 RFile& aFile, |
|
104 TInt aIndex ); |
|
105 |
|
106 /** |
|
107 * Clean content. |
|
108 * |
|
109 * @since S60 3.2 |
|
110 * @param aPlugin is publishing plugin. |
|
111 * @param aContent is id of the content. |
|
112 * @param aIndex is index of the content. |
|
113 * @return KErrNone if cleaning works. |
|
114 */ |
|
115 virtual TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent ); |
|
116 |
|
117 /** |
|
118 * Renderer must implement this method if it needs to support resource publishing. |
|
119 * |
|
120 * Default implementation leaves with KErrNotFound. |
|
121 * |
|
122 * @since S60 3.2 |
|
123 * @param aPlugin is publishing plugin. |
|
124 * @param aContent is id of the content. |
|
125 * @param aResource is id of the resource. |
|
126 * @param aIndex is index of the content. |
|
127 */ |
|
128 virtual void DoPublishL( MAiPropertyExtension& aPlugin, |
|
129 TInt aContent, |
|
130 TInt aResource, |
|
131 TInt aIndex ); |
|
132 |
|
133 /** |
|
134 * Renderer must implement this method if it needs to support unicode text publishing. |
|
135 * |
|
136 * Default implementation leaves with KErrNotFound. |
|
137 * |
|
138 * @since S60 3.2 |
|
139 * @param aPlugin is publishing plugin. |
|
140 * @param aContent is id of the content. |
|
141 * @param aText is published text. |
|
142 * @param aIndex is index of the content. |
|
143 */ |
|
144 virtual void DoPublishL( MAiPropertyExtension& aPlugin, |
|
145 TInt aContent, |
|
146 const TDesC16& aText, |
|
147 TInt aIndex ); |
|
148 |
|
149 /** |
|
150 * Renderer must implement this method if it needs to support data publishing. |
|
151 * |
|
152 * Default implementation leaves with KErrNotFound. |
|
153 * |
|
154 * @since S60 3.2 |
|
155 * @param aPlugin is publishing plugin. |
|
156 * @param aContent is id of the content. |
|
157 * @param aBuf is published data. |
|
158 * @param aIndex is index of the content. |
|
159 */ |
|
160 virtual void DoPublishL( MAiPropertyExtension& aPlugin, |
|
161 TInt aContent, |
|
162 const TDesC8& aBuf, |
|
163 TInt aIndex ); |
|
164 |
|
165 /** |
|
166 * Renderer must implement this method if it needs to support file publishing. |
|
167 * |
|
168 * Default implementation leaves with KErrNotFound. |
|
169 * |
|
170 * @since S60 3.2 |
|
171 * @param aPlugin is publishing plugin. |
|
172 * @param aContent is id of the content. |
|
173 * @param aFile is reference to file client. |
|
174 * @param aIndex is index of the content. |
|
175 */ |
|
176 virtual void DoPublishL( MAiPropertyExtension& aPlugin, |
|
177 TInt aContent, |
|
178 RFile& aFile, |
|
179 TInt aIndex ); |
|
180 |
|
181 /** |
|
182 * Renderer must implement this method if it needs to support content cleaning. |
|
183 * |
|
184 * Default implementation leaves with KErrNotFound. |
|
185 * |
|
186 * @since S60 3.2 |
|
187 * @param aPlugin is publishing plugin. |
|
188 * @param aContent is id of the content. |
|
189 */ |
|
190 virtual void DoCleanL( MAiPropertyExtension& aPlugin, TInt aContent ); |
|
191 |
|
192 /** |
|
193 * Called when UI switches to foreground. |
|
194 */ |
|
195 virtual void FocusObtainedL() { }; |
|
196 |
|
197 /** |
|
198 * Called when UI switches to background. |
|
199 */ |
|
200 virtual void FocusLostL() { }; |
|
201 |
|
202 /** |
|
203 * Called when transaction is committed. |
|
204 */ |
|
205 virtual void TransactionCommittedL() { }; |
|
206 |
|
207 /** |
|
208 * Called when keylock state is enabled. |
|
209 */ |
|
210 virtual void KeylockEnabledL() { }; |
|
211 |
|
212 /** |
|
213 * Called when keylock state is disabled. |
|
214 */ |
|
215 virtual void KeylockDisabledL() { }; |
|
216 |
|
217 /** |
|
218 * LoadUIDefinitionL |
|
219 */ |
|
220 virtual void LoadUIDefinitionL() { }; |
|
221 |
|
222 protected: |
|
223 |
|
224 /** |
|
225 * Get integer content id using textual id. |
|
226 * |
|
227 * @since S60 3.2 |
|
228 * @param aCid is textual content id. |
|
229 * @return content id. |
|
230 */ |
|
231 TInt GetIntContentId( const TDesC& aCid ) const; |
|
232 |
|
233 /** |
|
234 * Does mime type check. |
|
235 * |
|
236 * @since S60 3.2 |
|
237 * @param aContentId is content id. |
|
238 * @param aMimeType is mime type. |
|
239 * @return ETrue if match is successful. |
|
240 */ |
|
241 TBool MatchMimeType( MAiPropertyExtension& aPlugin, TInt aContentId, const TDesC8& aMimeType ) const; |
|
242 |
|
243 |
|
244 /** |
|
245 * Does mime type check. |
|
246 * |
|
247 * @since S60 3.2 |
|
248 * @param aPlugin is publishing plugin. |
|
249 * @param aContentId is id of the content. |
|
250 */ |
|
251 void DoMimeTypeCheckL( MAiPropertyExtension& aPlugin, TInt aContentId ); |
|
252 |
|
253 }; |
|
254 |
|
255 } // namespace AiNativeUiController |
|
256 |
|
257 #endif // M_AINATIVERENDERER_H |