homesync/contentmanager/mediaservant/inc/msmetadatacollector.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2008 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:  CMSMetadataCollector class definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CMSMETADATACOLLECTOR_H
       
    20 #define __CMSMETADATACOLLECTOR_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <badesca.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CMSAppUi;
       
    28 class CMSMetadataCollector;
       
    29 class CCmSqlPropertyContainer;
       
    30 class CCmSqlPropertyCollector;
       
    31 
       
    32 /**
       
    33  *  CMSMetadataCollector class
       
    34  *  Collects metadata
       
    35  *
       
    36  *  @since S60 5.1
       
    37  */
       
    38 NONSHARABLE_CLASS( CMSMetadataCollector ): public CBase
       
    39     {
       
    40     private:
       
    41         // Container types
       
    42         enum TMSContainerTypes
       
    43             {
       
    44             ETracks = 0,
       
    45             EArtists,
       
    46             EGenres,
       
    47             EAlbums            
       
    48             };
       
    49 
       
    50     public:
       
    51         
       
    52         /**
       
    53          * two-phase constructor
       
    54          *
       
    55          * @Since S60 5.1
       
    56          * @param aAppUi, application ui
       
    57          * @param aMediaType, mediatype
       
    58          * @param aGenreArray, genre container
       
    59          * @param aArtistArray, artist container
       
    60          * @param aAlbumArray, album container
       
    61          * @param aTrackArray, track/video title container
       
    62          * @return pointer to CMSMetadataCollector class
       
    63          */
       
    64         IMPORT_C static CMSMetadataCollector* NewL( CMSAppUi& aAppUi,
       
    65                                                     TCmMediaType aMediaType,
       
    66                                                     RArray<TInt>& aGenreArray,
       
    67                                                     RArray<TInt>& aArtistArray,
       
    68                                                     RArray<TInt>& aAlbumArray,
       
    69                                                     RArray<TInt>& aTrackArray );
       
    70     
       
    71         /**
       
    72          * two-phase constructor
       
    73          *
       
    74          * @Since S60 5.1
       
    75          * @param aAppUi, application ui
       
    76          * @param aMediaType, mediatype
       
    77          * @param aGenreArray, genre container
       
    78          * @param aArtistArray, artist container
       
    79          * @param aAlbumArray, album container
       
    80          * @param aTrackArray, track/video title container
       
    81          * @return pointer to CMSMetadataCollector class
       
    82          */
       
    83         IMPORT_C static CMSMetadataCollector* NewLC( CMSAppUi& aAppUi,
       
    84                                                      TCmMediaType aMediaType,
       
    85                                                      RArray<TInt>& aGenreArray,
       
    86                                                      RArray<TInt>& aArtistArray,
       
    87                                                      RArray<TInt>& aAlbumArray,
       
    88                                                      RArray<TInt>& aTrackArray );
       
    89         
       
    90         /**
       
    91          * Destructor.
       
    92          */
       
    93         virtual ~CMSMetadataCollector();
       
    94     
       
    95     public:
       
    96     
       
    97         /**
       
    98          * Starts collecting metadata items
       
    99          *
       
   100          * @since S60 5.1         
       
   101          * @param None
       
   102          * @return None
       
   103          */
       
   104         void GetFilteredMetadataL();
       
   105         
       
   106         /**
       
   107          * Returns genre array
       
   108          *
       
   109          * @since S60 5.1
       
   110          * @param None
       
   111          * @return CCmSqlPropertyContainer, genre container
       
   112          */
       
   113         CCmSqlPropertyContainer* Genres();
       
   114 
       
   115         /**
       
   116          * Returns artist array
       
   117          *
       
   118          * @since S60 5.1
       
   119          * @param None
       
   120          * @return CCmSqlPropertyContainer, artist container
       
   121          */
       
   122         CCmSqlPropertyContainer* Artists();
       
   123         
       
   124         /**
       
   125          * Returns album array
       
   126          *
       
   127          * @since S60 5.1
       
   128          * @param None
       
   129          * @return CCmSqlPropertyContainer, album container
       
   130          */
       
   131         CCmSqlPropertyContainer* Albums();
       
   132         
       
   133         /**
       
   134          * Returns track/video title array
       
   135          * @since S60 5.1
       
   136          * @param None
       
   137          * @return CCmSqlPropertyContainer, track container
       
   138          */
       
   139         CCmSqlPropertyContainer* Tracks();
       
   140                              
       
   141     protected:
       
   142 
       
   143         /**
       
   144          * Performs the first phase of two phase construction.
       
   145          *
       
   146          * @since S60 5.1
       
   147          * @param aAppUi, application ui
       
   148          * @param aMediaType, mediatype
       
   149          * @param aGenreArray, genre container
       
   150          * @param aArtistArray, artist container
       
   151          * @param aAlbumArray, album container
       
   152          * @param aTrackArray, track/video title container
       
   153          * @return None
       
   154          */
       
   155         CMSMetadataCollector( CMSAppUi& aAppUi,
       
   156                               TCmMediaType aMediaType,
       
   157                               RArray<TInt>& aGenreArray,
       
   158                               RArray<TInt>& aArtistArray,
       
   159                               RArray<TInt>& aAlbumArray,
       
   160                               RArray<TInt>& aTrackArray );
       
   161 
       
   162         /**
       
   163          * Performs the second phase construction.
       
   164          */
       
   165         void ConstructL();
       
   166 
       
   167     private:
       
   168         /**
       
   169          * Deletes all items from containers
       
   170          *
       
   171          * @since S60 5.1
       
   172          * @param None
       
   173          * @return None
       
   174          */
       
   175          
       
   176         void DeleteAllItems();
       
   177         /**
       
   178          * Adds container to collector
       
   179          *
       
   180          * @since S60 5.1
       
   181          * @param None
       
   182          * @return None
       
   183          */        
       
   184         void AddContainersL();
       
   185         
       
   186     private:
       
   187         /**
       
   188          * Application UI
       
   189          */
       
   190         CMSAppUi*                             iMSAppUi;         // not owned
       
   191         /**
       
   192          * MediaType indicator
       
   193          */
       
   194          TCmMediaType                         iMediaType;
       
   195         /**
       
   196          * Artist container
       
   197          */
       
   198         CCmSqlPropertyContainer*              iGenreContainer;  // not owned       
       
   199         /**
       
   200          * Artist container
       
   201          */
       
   202         CCmSqlPropertyContainer*              iArtistContainer; // not owned
       
   203         /**
       
   204          * Artist container
       
   205          */
       
   206         CCmSqlPropertyContainer*              iAlbumContainer;  // not owned        
       
   207         /**
       
   208          * Artist container
       
   209          */
       
   210         CCmSqlPropertyContainer*              iTrackContainer;  // not owned        
       
   211         /**
       
   212          * Container of MetadataContainers
       
   213          */
       
   214         CCmSqlPropertyCollector*              iMetadataCollector; // owned        
       
   215         /**
       
   216          * Selected genre array
       
   217          */
       
   218         RArray<TInt>*                         iGenreArray;        //owned
       
   219         /**
       
   220          * Selected artist array
       
   221          */
       
   222         RArray<TInt>*                         iArtistArray;       //owned
       
   223         /**
       
   224          * Selected album array
       
   225          */
       
   226         RArray<TInt>*                         iAlbumArray;        //owned
       
   227         /**
       
   228          * Selected track array
       
   229          */
       
   230         RArray<TInt>*                         iTrackArray;        //owned
       
   231         
       
   232     };
       
   233 
       
   234 #endif //  __CMSMETADATACOLLECTOR_H