|
1 /* |
|
2 * Copyright (c) 2006 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: Definitions for command type |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMPXCOLLECTIONCOMMANDDEFS_H |
|
21 #define CMPXCOLLECTIONCOMMANDDEFS_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <mpxattribute.h> |
|
25 |
|
26 /** |
|
27 * Content ID identifying sync. command to retrieve URIs of the medias |
|
28 * from the path for file deletion. If a client is required to delete |
|
29 * the associated file before removing the media from the collection, |
|
30 * this command can be used. A list of URIs associated with the path |
|
31 * will be returned. If the given path ends with a media or medias in |
|
32 * a particular playlist, the returned URI array will contain 0 element |
|
33 * since client won't want to delete the associated song files in this |
|
34 * case. |
|
35 */ |
|
36 const TInt KMPXCommandIdCollectionRetrieveUriForDeletion = 0x10282947; |
|
37 /** |
|
38 * Attributes supported for KMPXCommandIdCollectionRetrieveUriForDeletion |
|
39 */ |
|
40 /** |
|
41 * CMPXCollectionPath, collection path (in/out param). |
|
42 * The collection path to be used for searching. If the path ends |
|
43 * at a particular artist/album/genre/composer, the path will be |
|
44 * expended to include all the songs under category selected. |
|
45 */ |
|
46 const TMPXAttributeData KMPXCommandCollectionRetrievePath = { |
|
47 KMPXCommandIdCollectionRetrieveUriForDeletion, 0x01}; |
|
48 /** |
|
49 * TInt, error code (out param) |
|
50 */ |
|
51 const TMPXAttributeData KMPXCommandCollectionRetrieveUriError = { |
|
52 KMPXCommandIdCollectionRetrieveUriForDeletion, 0x02}; |
|
53 /** |
|
54 * CDesCArray, an array of URIs associated with the given |
|
55 * collection path. (out param) |
|
56 */ |
|
57 const TMPXAttributeData KMPXCommandCollectionRetrieveMediaUriArray = { |
|
58 KMPXCommandIdCollectionRetrieveUriForDeletion, 0x04}; |
|
59 |
|
60 /** |
|
61 * Attributes supported for KMPXCommandIdCollectionRetrieveUriForDeletion |
|
62 * @deprecated Please use constants above |
|
63 */ |
|
64 enum |
|
65 { |
|
66 /** |
|
67 * CMPXCollectionPath, collection path (in/out param). |
|
68 * The collection path to be used for searching. If the path ends |
|
69 * at a particular artist/album/genre/composer, the path will be |
|
70 * expended to include all the songs under category selected. |
|
71 */ |
|
72 EMPXCommandCollectionRetrievePath = 0x01, |
|
73 |
|
74 /** |
|
75 * TInt, error code (out param) |
|
76 */ |
|
77 EMPXCommandCollectionRetrieveUriError = 0x02, |
|
78 |
|
79 /** |
|
80 * CDesCArray, an array of URIs associated with the given |
|
81 * collection path. (out param) |
|
82 */ |
|
83 EMPXCommandCollectionRetrieveMediaUriArray = 0x04 |
|
84 }; |
|
85 |
|
86 /** |
|
87 * Content ID identifying incremental sync. Remove command |
|
88 */ |
|
89 const TInt KMPXCommandIdCollectionRemove = 0x101FFC49; |
|
90 /** |
|
91 * Attributes supported for KMPXCommandIdCollectionRemove |
|
92 */ |
|
93 /** |
|
94 * CMPXCollectionPath, collection path (in/out param). The path to |
|
95 * remove from the collection. Upon return, an updated path is returned |
|
96 * so it can be used for the next iteration. |
|
97 */ |
|
98 const TMPXAttributeData KMPXCommandCollectionRemovePath = { |
|
99 KMPXCommandIdCollectionRemove, 0x01}; |
|
100 /** |
|
101 * TInt, indicates how many media to remove in one command (in param) |
|
102 * 0 or a negative value means to delete all in one go |
|
103 */ |
|
104 const TMPXAttributeData KMPXCommandCollectionRemoveMediaCount = { |
|
105 KMPXCommandIdCollectionRemove, 0x02}; |
|
106 /** |
|
107 * TInt, error code (out param) |
|
108 */ |
|
109 const TMPXAttributeData KMPXCommandCollectionRemoveError = { |
|
110 KMPXCommandIdCollectionRemove, 0x04}; |
|
111 /** |
|
112 * TBool, completed (out param), indicates whether the client should |
|
113 * make further removal request |
|
114 */ |
|
115 const TMPXAttributeData KMPXCommandCollectionRemoveCompleted = { |
|
116 KMPXCommandIdCollectionRemove, 0x08}; |
|
117 |
|
118 /** |
|
119 * TBool, indicate if we should supporess collection change messages |
|
120 * Changes will be added to EMPXCommandCollectionChangeMsgs |
|
121 */ |
|
122 const TMPXAttributeData KMPXCommandCollectionRemoveSuppressMsgs = { |
|
123 KMPXCommandIdCollectionRemove, 0x10 }; |
|
124 |
|
125 /** |
|
126 * CMPXMessageArray to store collection messages |
|
127 */ |
|
128 const TMPXAttributeData KMPXCommandCollectionChangeMsgs = { |
|
129 KMPXCommandIdCollectionRemove, 0x20 }; |
|
130 |
|
131 /** |
|
132 * Attributes supported for KMPXCommandIdCollectionRemove |
|
133 * @deprecated please use constants above |
|
134 */ |
|
135 enum |
|
136 { |
|
137 /** |
|
138 * CMPXCollectionPath, collection path (in/out param). The path to |
|
139 * remove from the collection. Upon return, an updated path is returned |
|
140 * so it can be used for the next iteration. |
|
141 */ |
|
142 EMPXCommandCollectionRemovePath = 0x01, |
|
143 |
|
144 /** |
|
145 * TInt, indicates how many media to remove in one command (in param) |
|
146 * 0 or a negative value means to delete all in one go |
|
147 */ |
|
148 EMPXCommandCollectionRemoveMediaCount = 0x02, |
|
149 |
|
150 /** |
|
151 * TInt, error code (out param) |
|
152 */ |
|
153 EMPXCommandCollectionRemoveError = 0x04, |
|
154 |
|
155 /** |
|
156 * TBool, completed (out param), indicates whether the client should |
|
157 * make further removal request |
|
158 */ |
|
159 EMPXCommandCollectionRemoveCompleted = 0x08, |
|
160 |
|
161 /** |
|
162 * TBool, indicate if we should supporess collection change messages |
|
163 * Changes will be added to EMPXCommandCollectionChangeMsgs |
|
164 */ |
|
165 EMPXCommandCollectionSuppressMsgs = 0x10, |
|
166 |
|
167 /** |
|
168 * CMPXMessageArray to store collection messages |
|
169 */ |
|
170 EMPXCommandCollectionChangeMsgs = 0x20 |
|
171 }; |
|
172 |
|
173 /** |
|
174 * Content ID identifying sync. Remove Media command. The identified media |
|
175 * will be deleted from the collection database instead of being marked as |
|
176 * deleted if client explictly requests to delete the records; otherwise, |
|
177 * whether the records will be deleted or marked as deleted will be based |
|
178 * on other factors (e.g. whether MTP is supported, if so, the 1st X records |
|
179 * will be marked as deleted; thereafter, they will be deleted). |
|
180 */ |
|
181 const TInt KMPXCommandIdCollectionRemoveMedia = 0x10282949; |
|
182 /** |
|
183 * Attributes supported for KMPXCommandIdCollectionRemoveMedia |
|
184 */ |
|
185 /** |
|
186 * CMPXMedia, media to be removed (in param) |
|
187 */ |
|
188 const TMPXAttributeData KMPXCommandCollectionRemoveMedia = { |
|
189 KMPXCommandIdCollectionRemoveMedia, 0x01}; |
|
190 /** |
|
191 * TBool, indicates whether to delete the records associated |
|
192 * with the given media (in param) |
|
193 */ |
|
194 const TMPXAttributeData KMPXCommandCollectionRemoveMediaDeleteRecord = { |
|
195 KMPXCommandIdCollectionRemoveMedia, 0x02}; |
|
196 /** |
|
197 * TInt, error code (out param) |
|
198 */ |
|
199 const TMPXAttributeData KMPXCommandCollectionRemoveMediaError = { |
|
200 KMPXCommandIdCollectionRemoveMedia, 0x04}; |
|
201 |
|
202 |
|
203 /** |
|
204 * Attributes supported for KMPXCommandIdCollectionRemoveMedia |
|
205 * |
|
206 * @deprecated please use constant above |
|
207 */ |
|
208 enum |
|
209 { |
|
210 /** |
|
211 * CMPXMedia, media to be removed (in param) |
|
212 */ |
|
213 EMPXCommandCollectionRemoveMedia = 0x01, |
|
214 |
|
215 /** |
|
216 * TBool, indicates whether to delete the records associated |
|
217 * with the given media (in param) |
|
218 */ |
|
219 EMPXCommandCollectionRemoveMediaDeleteRecord = 0x02, |
|
220 |
|
221 /** |
|
222 * TInt, error code (out param) |
|
223 */ |
|
224 EMPXCommandCollectionRemoveMediaError = 0x04 |
|
225 }; |
|
226 |
|
227 /** |
|
228 * Content ID identifying sync. command to clean up medias that have |
|
229 * been marked as deleted. |
|
230 */ |
|
231 const TInt KMPXCommandIdCollectionCleanupDeletedMedias = 0x10282948; |
|
232 /** |
|
233 * Attributes supported for KMPXCommandIdCollectionCleanupDeletedMedias |
|
234 */ |
|
235 const TMPXAttributeData KMPXCommandCollectionCleanupError = { |
|
236 KMPXCommandIdCollectionCleanupDeletedMedias, 0x01}; |
|
237 |
|
238 /** |
|
239 * Attributes supported for KMPXCommandIdCollectionCleanupDeletedMedias |
|
240 * |
|
241 * @deprecated please use constants above |
|
242 */ |
|
243 enum |
|
244 { |
|
245 /** |
|
246 * TInt, error code (out param) |
|
247 */ |
|
248 EMPXCommandCollectionCleanupError = 0x01 |
|
249 }; |
|
250 |
|
251 /** |
|
252 * Remove all unused data before starting delete. |
|
253 */ |
|
254 const TInt KMPXCommandIdCollectionPrepareDelete= 0x10282999; |
|
255 /** |
|
256 * Attributes supported for KMPXCommandIdCollectionPrepareDelete |
|
257 */ |
|
258 |
|
259 /** |
|
260 * CMPXCollectionPath, collection path (in/out param). The path to |
|
261 * remove from the collection. |
|
262 */ |
|
263 const TMPXAttributeData KMPXCommandCollectionPrepareRemovePath = { KMPXCommandIdCollectionPrepareDelete, 0x01 }; |
|
264 |
|
265 /** |
|
266 * ContentID for completing the delete operation |
|
267 */ |
|
268 const TUint32 KMPXCommandIdCollectionCompleteDelete = 0x10282951; |
|
269 |
|
270 // CMPXMessageArray containing change messages |
|
271 const TMPXAttributeData KMPXCommandCollectionDeleteMsgArray = { KMPXCommandIdCollectionCompleteDelete, 0x01 }; |
|
272 // TBool compact database or not |
|
273 const TMPXAttributeData KMPXCommandCollectionDeleteCompactDb = { KMPXCommandIdCollectionCompleteDelete, 0x02 }; |
|
274 |
|
275 /** |
|
276 * Unique command ids for extensible commands |
|
277 */ |
|
278 const TUint32 KMPXCommandIdCollectionSelect = 0x10282940; // Focused index must be |
|
279 // passed in attribute KMPXCommandIdCollection, |
|
280 // EMPXCollectionCommandIndex |
|
281 |
|
282 // Content id for Collection commands (see above) |
|
283 const TInt KMPXCommandContentIdCollection = 0x10282941; |
|
284 const TMPXAttributeData KMPXCommandCollectionSelectIndex = { KMPXCommandContentIdCollection, 0x02 }; |
|
285 enum // Attribute ids for KMPXCommandContentIdCollection |
|
286 { |
|
287 /** |
|
288 * Index, TInt |
|
289 */ |
|
290 EMPXCollectionCommandIndex = 0x02 |
|
291 }; |
|
292 |
|
293 /** |
|
294 * Unique command ids for add media to collection |
|
295 */ |
|
296 const TInt KMPXCommandIdCollectionAdd = 0x10282962; |
|
297 const TMPXAttributeData KMPXCommandColAddMedia = { KMPXCommandIdCollectionAdd, 0x01 }; // CMPXMedia to add |
|
298 const TMPXAttributeData KMPXCommandColAddRtnId = { KMPXCommandIdCollectionAdd, 0x02 }; // TMPXItemId on return |
|
299 |
|
300 /** |
|
301 * Unique command ids for executing SQL statements to collection |
|
302 */ |
|
303 const TInt KMPXCommandIdCollectionExecSql = 0x02ABBADC; |
|
304 const TMPXAttributeData KMPXCommandColSqlFile = { KMPXCommandIdCollectionExecSql, 0x01 }; // Text for SQL file name |
|
305 /** |
|
306 * Unique command ids for update media in collection |
|
307 */ |
|
308 const TInt KMPXCommandIdCollectionSet = 0x10282963; |
|
309 const TMPXAttributeData KMPXCommandColSetMedia = { KMPXCommandIdCollectionSet, 0x01 }; // CMPXMedia to set. |
|
310 // The media can be an Item or contain an Item array |
|
311 |
|
312 /******************************************************************************* |
|
313 * Reorder a song in a playlist |
|
314 * |
|
315 ******************************************************************************/ |
|
316 const TInt KMPXCommandIdReorderPlaylist = 0x10282975; |
|
317 |
|
318 /** |
|
319 * Attributes supported for KMPXCommandIdReorderPlaylist |
|
320 */ |
|
321 |
|
322 /** |
|
323 * TMPXItemId, Id of the playlist to be reordered |
|
324 */ |
|
325 const TMPXAttributeData KMPXCommandReorderPlaylistId = { KMPXCommandIdReorderPlaylist, 0x01 }; |
|
326 |
|
327 /** |
|
328 * TMPXItemId, Id of the song in the playlist to be reordered |
|
329 */ |
|
330 const TMPXAttributeData KMPXCommandReorderSongId = { KMPXCommandIdReorderPlaylist, 0x02 }; |
|
331 |
|
332 /** |
|
333 * TUint, original ordinal of the song in the playlist |
|
334 */ |
|
335 const TMPXAttributeData KMPXCommandReorderOriginalOrdinal = { KMPXCommandIdReorderPlaylist, 0x04 }; |
|
336 |
|
337 /** |
|
338 * TUint, new ordinal of the song in the playlist |
|
339 */ |
|
340 const TMPXAttributeData KMPXCommandReorderNewOrdinal = { KMPXCommandIdReorderPlaylist, 0x08 }; |
|
341 |
|
342 |
|
343 /******************************************************************************* |
|
344 * Update the last refreshed time for a collection plugin |
|
345 * |
|
346 ******************************************************************************/ |
|
347 const TInt KMPXCommandIdUpdateRefreshTime = 0x10282976; |
|
348 |
|
349 |
|
350 /******************************************************************************* |
|
351 * Get total collection records count |
|
352 * |
|
353 ******************************************************************************/ |
|
354 const TInt KMPXCommandCollectionGetCount = 0x1028297C; |
|
355 |
|
356 /** |
|
357 * Attributes supported for KMPXCommandCollectionGetCount |
|
358 */ |
|
359 |
|
360 /** |
|
361 * TInt, drive number |
|
362 */ |
|
363 const TMPXAttributeData KMPXCommandCollectionCountDrive = {KMPXCommandCollectionGetCount, 0x01}; |
|
364 |
|
365 |
|
366 enum EMPXCollectionCountEnum |
|
367 { |
|
368 /** |
|
369 * count for all records in a music table or podcast table to be retrieved |
|
370 */ |
|
371 EMPXCollectionCountTrack = 1, |
|
372 |
|
373 /** |
|
374 * count for all records in a playlist table to be retrieved |
|
375 */ |
|
376 EMPXCollectionCountPlaylist = 2, |
|
377 |
|
378 /** |
|
379 * count for total music and .m3u playlists records to be retrieved |
|
380 */ |
|
381 EMPXCollectionCountTotal = 3 |
|
382 }; |
|
383 |
|
384 /** |
|
385 * TInt, what content should be retrieved: music, playlist or both, see EMPXCollectionCountEnum |
|
386 */ |
|
387 const TMPXAttributeData KMPXCommandCollectionCountTable = {KMPXCommandCollectionGetCount, 0x02}; |
|
388 |
|
389 /** |
|
390 * TInt, collection count (out param). |
|
391 */ |
|
392 const TMPXAttributeData KMPXCommandCollectionCountValue = {KMPXCommandCollectionGetCount, 0x04}; |
|
393 |
|
394 |
|
395 /******************************************************************************* |
|
396 * Get uri list for songs and playlists for the given drive from music db |
|
397 * |
|
398 ******************************************************************************/ |
|
399 const TInt KMPXCommandCollectionGetURIs = 0x1028297D; |
|
400 |
|
401 /** |
|
402 * Attributes supported for KMPXCommandCollectionGetURIs |
|
403 */ |
|
404 |
|
405 /** |
|
406 * TInt, drive number |
|
407 */ |
|
408 const TMPXAttributeData KMPXCommandCollectionURIDrive = {KMPXCommandCollectionGetURIs, 0x01}; |
|
409 |
|
410 enum EMPXCollectionURIEnum |
|
411 { |
|
412 /** |
|
413 * requests URIs for records in a music or podcast table |
|
414 */ |
|
415 EMPXCollectionURITrack = 1, |
|
416 |
|
417 /** |
|
418 * requests URIs for .m3u records in a playlist table |
|
419 */ |
|
420 EMPXCollectionURIPlaylist = 2 |
|
421 }; |
|
422 |
|
423 /** |
|
424 * TInt, what content should be retrieved: music or playlist, see EMPXCollectionURIEnum |
|
425 */ |
|
426 const TMPXAttributeData KMPXCommandCollectionURITable = {KMPXCommandCollectionGetCount, 0x02}; |
|
427 |
|
428 /** |
|
429 * TInt, number of records to retrieve |
|
430 */ |
|
431 const TMPXAttributeData KMPXCommandCollectionURIRecords = {KMPXCommandCollectionGetURIs, 0x04}; |
|
432 |
|
433 /** |
|
434 * TInt, ID of the record to use as a 'bottom' in SELECT |
|
435 */ |
|
436 const TMPXAttributeData KMPXCommandCollectionURIFromID = {KMPXCommandCollectionGetURIs, 0x08}; |
|
437 |
|
438 /** |
|
439 * CDesCArray, an array of URIs associated with the given drive (out param) |
|
440 */ |
|
441 const TMPXAttributeData KMPXCommandCollectionURIList = {KMPXCommandCollectionGetURIs, 0x16}; |
|
442 |
|
443 /** |
|
444 * TUint32, an ID of last retrieved URI for the array above (out param) |
|
445 * assume that music table and playlist table are both indexed by unique ID |
|
446 * note: Symbian does not recommend to use OFFSET and instead recommend item from index |
|
447 */ |
|
448 const TMPXAttributeData KMPXCommandCollectionURILastID = {KMPXCommandCollectionGetURIs, 0x32}; |
|
449 |
|
450 |
|
451 #endif // CMPXCOLLECTIONCOMMANDDEFS_H |