|
1 /* |
|
2 * Copyright (c) 2005 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: mms application adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MMSAPPLICATIONADAPTER_H |
|
22 #define MMSAPPLICATIONADAPTER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <msvstd.h> // TMsvId |
|
26 #include <msvapi.h> // MMsvSessionObserver |
|
27 #include <badesca.h> // descriptor array |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 // MACROS |
|
32 |
|
33 // DATA TYPES |
|
34 |
|
35 // FUNCTION PROTOTYPES |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CMmsSettings; |
|
39 class CMmsRegisteredApplications; |
|
40 class CMmsHeaders; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 /** |
|
45 * |
|
46 * |
|
47 * @lib mmsappadapter.lib |
|
48 * @since 3.0 |
|
49 */ |
|
50 |
|
51 class CMmsApplicationAdapter : public CBase, public MMsvSessionObserver |
|
52 { |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 */ |
|
58 IMPORT_C static CMmsApplicationAdapter* NewL( ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CMmsApplicationAdapter(); |
|
64 |
|
65 public: // New functions |
|
66 |
|
67 /** |
|
68 * Register application. |
|
69 * |
|
70 * @since 3.0 |
|
71 * |
|
72 * @param aApplicationId application id |
|
73 * @param aFolderId folder id for this application id. |
|
74 * @return KErrNone if successful. |
|
75 */ |
|
76 IMPORT_C TInt RegisterL( const TDesC& aApplicationId, TMsvId& aFolderId ); |
|
77 |
|
78 /** |
|
79 * Unregister application |
|
80 * The function destroys the corresponding folder and its content. |
|
81 * |
|
82 * @since 3.0 |
|
83 * |
|
84 * @param aApplicationId application id |
|
85 |
|
86 * @return KErrNone if successful |
|
87 */ |
|
88 IMPORT_C TInt UnregisterL( const TDesC& aApplicationId ); |
|
89 |
|
90 /** |
|
91 * RegisteredL |
|
92 * |
|
93 * checks if the application id is registered or not |
|
94 * @since 3.0 |
|
95 * |
|
96 * @param aApplicationId application id |
|
97 * @return ETrue, if the application id is registered |
|
98 * EFalse, if the application id is not registered. |
|
99 */ |
|
100 IMPORT_C TBool RegisteredL( const TDesC& aApplicationId ); |
|
101 |
|
102 /** |
|
103 * Folder Entry ID |
|
104 * |
|
105 * @since 3.0 |
|
106 * |
|
107 * @param aApplicationId application id |
|
108 * @return the index of the folder entry |
|
109 */ |
|
110 IMPORT_C TMsvId FolderIdL( const TDesC& aApplicationId ); |
|
111 |
|
112 /** |
|
113 * Application ID |
|
114 * |
|
115 * @since 3.0 |
|
116 * |
|
117 * @param aMmId Index to the multimedia message |
|
118 |
|
119 * @return application id |
|
120 */ |
|
121 IMPORT_C TPtrC16 ApplicationIdL( TMsvId aMmId ); |
|
122 |
|
123 /** |
|
124 * Set application ID |
|
125 * |
|
126 * @since 3.0 |
|
127 * |
|
128 * @param aMmId Index to the multimedia message |
|
129 * @param aApplicationId application id |
|
130 * @return |
|
131 */ |
|
132 IMPORT_C void SetApplicationIdL( |
|
133 TMsvId aMmId, |
|
134 const TDesC& aApplicationId ); |
|
135 |
|
136 /** |
|
137 * Reply to Application ID |
|
138 * |
|
139 * @since 3.0 |
|
140 * |
|
141 * @param aMmId Index to the multimedia message |
|
142 |
|
143 * @return reply to application id |
|
144 */ |
|
145 IMPORT_C TPtrC16 ReplyToApplicationIdL( TMsvId aMmId ); |
|
146 |
|
147 /** |
|
148 * Set reply to application ID |
|
149 * |
|
150 * @since 3.0 |
|
151 * |
|
152 * @param aMmId Index to the multimedia message |
|
153 * @param aReplyToApplicationId reply to application id |
|
154 * @return |
|
155 */ |
|
156 IMPORT_C void SetReplyToApplicationIdL( |
|
157 TMsvId aMmId, |
|
158 const TDesC& aReplyToApplicationId ); |
|
159 |
|
160 /** |
|
161 * Delete the specified MM. |
|
162 * |
|
163 * @since 3.0 |
|
164 * |
|
165 * @param aMmId Index to the MM, which will be deleted. |
|
166 * |
|
167 * @return KErrNone if successful |
|
168 */ |
|
169 IMPORT_C TInt DeleteL( TMsvId aMmId ); |
|
170 |
|
171 /** |
|
172 * MmscUrlL |
|
173 * |
|
174 * @since 3.0 |
|
175 * |
|
176 * @param HBufC*& aServerUri |
|
177 * |
|
178 * Usage: |
|
179 * aServerUri should not be allocated by the caller of this method. |
|
180 * The buffer is pushed onto CleanupStack temporarily. |
|
181 * The caller is responsible for destroying the buffer |
|
182 * when the buffer is no longer needed. |
|
183 * |
|
184 * @return KErrNone if successful |
|
185 * KErrNotFound if not found |
|
186 * KErrGeneralError, something has failed. |
|
187 * |
|
188 * Note that if the uri is not defined, KErrNone is returned. |
|
189 */ |
|
190 IMPORT_C TInt MmscUrlL( HBufC*& aServerUri ); |
|
191 |
|
192 /** |
|
193 * Return a list of registered applications |
|
194 * |
|
195 * @since 3.1 |
|
196 * |
|
197 * @return Descriptor array that contains ids of registered applications |
|
198 */ |
|
199 IMPORT_C const CDesCArray& RegisteredApplicationList() const; |
|
200 |
|
201 /** |
|
202 * Register application. |
|
203 * |
|
204 * @since 3.2 |
|
205 * |
|
206 * @param aApplicationId application id |
|
207 * @param aUserFriendlyName user friendly name for the application |
|
208 * @param aFolderId folder id for this application id (return value). |
|
209 * @return KErrNone if successful. |
|
210 */ |
|
211 IMPORT_C TInt RegisterWithNameL( |
|
212 const TDesC& aApplicationId, |
|
213 const TDesC& aUserFriendlyName, |
|
214 TMsvId& aFolderId ); |
|
215 |
|
216 /** |
|
217 * Get User Friendly Name for an application |
|
218 * |
|
219 * @since 3.2 |
|
220 * @param aApplicationId application id |
|
221 * @return User Friendly Name for the application. |
|
222 * If a user friendly name cannot be found, returns empty string. |
|
223 * The pointer is valid only as long as CMmsRegisteredApplications |
|
224 * is alive and as long as the function is not called again. |
|
225 * (It is a pointer to member variable) |
|
226 * The caller should allocate memory and copy the string if it is needed |
|
227 * for longer period of time or if names for several applications are |
|
228 * needed. |
|
229 */ |
|
230 IMPORT_C TPtrC UserFriendlyName( const TDesC& aApplicationId ); |
|
231 |
|
232 |
|
233 |
|
234 public: // Functions from base classes |
|
235 |
|
236 |
|
237 protected: // New functions |
|
238 |
|
239 |
|
240 protected: // Functions from base classes |
|
241 |
|
242 /** |
|
243 * From MMsvSessionObserver. |
|
244 * @since 3.0 |
|
245 * |
|
246 * @param aEvent the caller of the method sets the value. |
|
247 * @param aArg1 depends on the aEvent value |
|
248 * @param aArg2 depends on the aEvent value |
|
249 * @param aArg3 depends on the aEvent value |
|
250 * |
|
251 */ |
|
252 |
|
253 virtual void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); |
|
254 |
|
255 |
|
256 private: // New functions |
|
257 |
|
258 /** |
|
259 * C++ default constructor. |
|
260 * C++ default constructor can NOT contain any code, that |
|
261 * might leave. |
|
262 * @since 3.0 |
|
263 */ |
|
264 CMmsApplicationAdapter(); |
|
265 |
|
266 /** |
|
267 * By default Symbian 2nd phase constructor is private. |
|
268 * @since 3.0 |
|
269 */ |
|
270 void ConstructL(); |
|
271 |
|
272 |
|
273 private: |
|
274 |
|
275 |
|
276 |
|
277 /** |
|
278 * Functions from CMmsBaseOperation |
|
279 */ |
|
280 |
|
281 |
|
282 |
|
283 |
|
284 public: // Data |
|
285 protected: // Data |
|
286 private: // Data |
|
287 |
|
288 CMsvSession* iSession; // channel for client side thread and message server |
|
289 CMsvEntry* iClientEntry; |
|
290 |
|
291 CMmsHeaders* iMmsHeaders; |
|
292 CMmsSettings* iMmsSettings; |
|
293 CMmsRegisteredApplications* iRegAppIds; |
|
294 |
|
295 public: // Friend classes |
|
296 protected: // Friend classes |
|
297 private: // Friend classes |
|
298 |
|
299 }; |
|
300 |
|
301 #endif // MMSAPPLICATIONADAPTER |
|
302 |
|
303 // End of File |