mmappfw_plat/mpx_collection_common_definition_api/inc/mpxcollectionframeworkdefs.h
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     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:  Common definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MPXCOLLECTIONFRAMEWORKDEFS_H
       
    20 #define MPXCOLLECTIONFRAMEWORKDEFS_H
       
    21 
       
    22 
       
    23 #include <mpxcommonframeworkdefs.h>
       
    24 
       
    25 // UID definition for collection mode
       
    26 // For application collection mode, application UID can be used
       
    27 //
       
    28 const TUid KMcModeDefault = {0x1028292C};
       
    29 const TUid KMcModeIsolated = {0x1028292D};
       
    30 const TUid KMcModePlaylist = {0x1028292E}; // special mode used by playlist
       
    31                                            // isolated, noshareable
       
    32 
       
    33 /**
       
    34  * This is SPECIFIC to the music db plugin and is a reference implementation.
       
    35  *
       
    36  * EMcItemDeleted, EMcItemInserted and EMcItemModified will be called back when
       
    37  * an item is deleted, added or modified via RemoveL(), AddL() and SetL()
       
    38  *
       
    39  * When user adds a new playlist through AddL, only EMcPlaylistInserted message
       
    40  * will be sent with the Id of the playlist added.
       
    41  *
       
    42  * When user adds a track to a saved playlist through AddL, only EMcPlaylistModified
       
    43  * message will be sent with the Id of the playlist modified.
       
    44  *
       
    45  * When user removes a track from the collection, the client will receive
       
    46  * EMcItemDeleted for the track deleted from the collection and
       
    47  * EMcPlaylistModified for the modified playlist to indicate which playlists
       
    48  * have been updated as result of this track removal.
       
    49  *
       
    50  * When user removes a playlist from the collection, the client will receive
       
    51  * EMcItemDeleted for the playlist removed from the collection.
       
    52  *
       
    53  * When user removes a track from the playlist, the client will receive
       
    54  * EMcPlaylistModified for the playlist the track is removed from.
       
    55  *
       
    56  * When user renames a playlist, EMcPlaylistModified is called back with the
       
    57  * new Id of the renamed playlist.
       
    58  *
       
    59  * When MTP renames a song, it will receive EMcItemModified for the track and
       
    60  * EMcPlaylistModified for the playlist because the URI of one of the songs in
       
    61  * the playlist has been changed.
       
    62  *
       
    63  * When a playlist is updated (overwrite its contents or reordering tracks in
       
    64  * the playlist), EMcPlaylistModified is sent.
       
    65  *
       
    66  * This will be replaced by KMPXMessageIdItemChanged message
       
    67  *
       
    68  * @deprecated TO BE REMOVED IN INCREMENT 9 RELEASE
       
    69  */
       
    70 
       
    71 enum TMPXCollectionChangeType
       
    72     {
       
    73     EMcItemDeleted,      // item deleted, including removing playlist itself
       
    74     EMcItemInserted,     // item added
       
    75     EMcItemModified,     // item modified
       
    76     EMcPlaylistInserted, // new playlist added
       
    77     EMcPlaylistModified  // Existing playlist content: track added to /removed from playlist or playlist being overwritten
       
    78     };
       
    79 
       
    80 /*
       
    81  * Simple structure to hold collection change event
       
    82  */
       
    83 NONSHARABLE_STRUCT(TMPXCollectionChangeEvent)
       
    84     {
       
    85     TUid iCollectionId;
       
    86     TMPXItemId iItemId;
       
    87     TMPXCollectionChangeType iChangeType;
       
    88     };
       
    89 
       
    90 enum TMPXCollectionPathChangeType
       
    91     {
       
    92     EMcPathChangedByOpen = 0,  // path changed due to after OpenL called
       
    93     EMcPathChangedByCollectionChange    // path changed due to collection content change
       
    94     };
       
    95 
       
    96 enum TMPXCollectionOpenEntry
       
    97     {
       
    98     EMcItemOpened = 0,
       
    99     EMcContainerOpened
       
   100     };
       
   101 
       
   102 enum TMPXCollectionType
       
   103     {
       
   104     EMcUnknown = 0x00,
       
   105     EMcLocal = 0x01,
       
   106     EMcRemote = 0x02
       
   107     };
       
   108 
       
   109 enum TMPXCollectionCommand
       
   110     {
       
   111     EMcCmdClose,
       
   112     EMcCmdRefresh,
       
   113     EMcCmdRemoveAll,  // delete all items from db,
       
   114                      // aData = collection id to remove all
       
   115     EMcCloseCollection,
       
   116     EMcReOpenCollection,
       
   117     EMcRefreshStarted,
       
   118     EMcRefreshEnded,
       
   119     EMcCmdReCreateDB,
       
   120     EMcCmdSelect, // aData = index of focused item
       
   121     EMcCmdDbCorrupted,
       
   122     EMcCmdCollectionInit,
       
   123     EMcCmdCollectionResyn,
       
   124     EMcCmdMtpStart,
       
   125     EMcCmdMtpEnd
       
   126     };
       
   127 
       
   128 enum TMPXCollectionBroadCastMsg
       
   129     {
       
   130     // This should be a 1:1 mapping to harvester events
       
   131     // for easy conversion
       
   132     // check mpxharvestercommon.h
       
   133     //
       
   134     EMcMsgFormatStart,
       
   135     EMcMsgFormatEnd,
       
   136     EMcMsgDiskRemoved,
       
   137     EMcMsgDiskInserted,
       
   138     EMcMsgUSBMassStorageStart,
       
   139     EMcMsgUSBMassStorageEnd,
       
   140     EMcMsgUSBMTPStart,
       
   141     EMcMsgUSBMTPEnd,
       
   142     EMcMsgUSBMTPNotActive,
       
   143     EMcMsgSystemEventMax,
       
   144     EMcMsgRefreshStart,
       
   145     EMcMsgRefreshEnd
       
   146     };
       
   147 
       
   148 // Server function codes
       
   149 enum TMPXCollectionServerOp
       
   150     {
       
   151     EMcsGetNextMessage,        // 0 Get next message, must be 0
       
   152     EMcsCancelGetMessage,      // 1 Cancel get message, must be 1
       
   153     EMcsSetMode,               // 2 Must be called before any following op
       
   154     EMcsOpen,                  // 3
       
   155     EMcsOpenIndex,             // 4
       
   156     EMcsOpenPath,              // 5
       
   157     EMcsGetUid,                // 6 Get uid of collection opened
       
   158     EMcsGetPath,               // 7
       
   159     EMcsBack,                  // 8
       
   160     EMcsGetSyncBuffer,         // 9 Read buffer of last sync request
       
   161     EMcsGetAsyncBuffer,        // 10 Read buffer of last async request
       
   162     EMcsMedia,                 // 11 media for current path
       
   163     EMcsMediaByPath,           // 12 media by path.
       
   164     EMcsAddItem,               // 13 Add an item
       
   165     EMcsRemovePath,            // 14 Remove a collection path
       
   166     EMcsRemoveItem,            // 15 Remove a CMPXMedia
       
   167     EMcsSetMedia,              // 16 Set a media properties
       
   168     EMcsFindAll,               // 17 Find command
       
   169     EMcsNotifyEvent,           // 18 Notify an event
       
   170     EMcsGetSupportedTypes,     // 19 Get supported Types
       
   171     EMcsCancelRequest,         // 20
       
   172     EMcsGetCapabilities,       // 21 Find the capabilities of loaded plugin
       
   173     EMcsCollectionID,          // 22 Get Collection implementation ID
       
   174     EMcsCommand,               // 23 Depricated: send a command to the server, with TInt parameter
       
   175     EMcsSetMediaAsync,         // 24 SetMediaL, Asynchronus SetL()
       
   176     EMcsCommandExt,            // 25 Send a command to the server, with CMPXMedia-based parameter
       
   177     EMcsFilter,                // 26 Get the current filter
       
   178     EMcsSetFilter,             // 27 Set the filter
       
   179     EMcsOpenByUids,            // 28 Open a list of plugins which match uids.
       
   180     EMcsCollectionIdLookup,    // 29 Collection id lookup
       
   181     EMcsServerOpEnd            // 30 End of operation,
       
   182     };
       
   183 
       
   184 // Define Collection capability as an int, can expand later
       
   185 typedef TInt TCollectionCapability;
       
   186 enum
       
   187     {
       
   188     EMcSearch = 0x01,            // Supports search
       
   189     EMcSearchWildCard = 0x02,    // Supports wildcard search
       
   190     EMcNotModifiable = 0x04      // Unmodifiable collection (ie UPNP)
       
   191     };
       
   192 
       
   193 //to indicate object type
       
   194 const TInt KMPXPathUpdated = 2;
       
   195 const TInt KMPXCollectionPath = 3;
       
   196 const TInt KMPXCollectionEntries = 4;
       
   197 const TInt KMPXCollectionMedia = 5;
       
   198 
       
   199 // Abstract UID definition for a "collection"
       
   200 // The collection server can resolve the real collection UID based on this
       
   201 //
       
   202 const TUid KLocalCollection = {0x101FFB30};
       
   203 const TUid KPodcastCollection = {0x101FFB31};
       
   204 const TUid KInMemoryCollection = {0x101FFCD7};
       
   205 
       
   206 #endif // MPXCOLLECTIONFRAMEWORKDEFS_H
       
   207