upnpharvester/common/cmlibrary/inc/cmstorerule.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2006-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:      Capsulating fill rule
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef __CMSTORERULE_H
       
    24 #define __CMSTORERULE_H
       
    25 
       
    26 // INCLUDES
       
    27 #include <e32base.h>
       
    28 #include <badesca.h>
       
    29 #include "cmcommontypes.h"
       
    30 #include "cmcommon.h"
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class RWriteStream;
       
    34 class RReadStream;
       
    35 class CCmMediaServer;
       
    36 
       
    37 class TCmStoreRuleMediaServers
       
    38     {
       
    39 public: // public member variables
       
    40     CCmMediaServer* iMediaServer; // Media server object
       
    41     TCmMediaType iMediaType;      // Media type
       
    42     };
       
    43     
       
    44 /**
       
    45  *  CCmStoreRule class
       
    46  *    Capsulating store rules
       
    47  *  @lib cmcommon.lib
       
    48  *  @since S60 v3.0
       
    49  */
       
    50 class CCmStoreRule : public CBase
       
    51     {
       
    52 
       
    53 public:
       
    54 
       
    55     /* Constructors and destructor. */
       
    56 
       
    57     /**
       
    58      * Creates new CCmStoreRule class.
       
    59      * @param None
       
    60      * @return  pointer to CCmStoreRule class
       
    61      */
       
    62     IMPORT_C static CCmStoreRule* NewL();
       
    63     
       
    64     /**
       
    65      * Creates new CCmStoreRule class and 
       
    66      * leaves the instance in the cleanup stack.
       
    67      * @param None
       
    68      * @return  pointer to CCmStoreRule class
       
    69      */
       
    70     IMPORT_C static CCmStoreRule* NewLC();
       
    71 
       
    72     /**
       
    73      * Destructor.
       
    74      */
       
    75     IMPORT_C virtual ~CCmStoreRule();
       
    76 
       
    77 public:
       
    78 
       
    79     /**
       
    80      * AddStoreRuleL.
       
    81      * @since Series 60 3.1     
       
    82      * @param aMediaType
       
    83      * @returns index of the rule
       
    84      */
       
    85     IMPORT_C TInt AddStoreRuleL( TCmMediaType aMediaType );
       
    86 
       
    87     /**
       
    88      * StoreRule.
       
    89      * @since Series 60 3.1     
       
    90      * @param aIndex rule index
       
    91      * @param aMediaType
       
    92      * @returns index of the rule
       
    93      */    
       
    94     IMPORT_C void StoreRule( TInt aIndex, TCmMediaType* aMediaType );
       
    95 
       
    96     /**
       
    97      * AddMediaServerL.
       
    98      * @since Series 60 3.1     
       
    99      * @param aUDN
       
   100      * @returns index of the media server
       
   101      */    
       
   102     IMPORT_C TInt AddMediaServerL( const TDesC8& aUDN );
       
   103     
       
   104     /**
       
   105      * DeleteMediaServer.
       
   106      * @since Series 60 3.1     
       
   107      * @param aUDN
       
   108      * @returns None
       
   109      */        
       
   110     IMPORT_C void DeleteMediaServer( const TDesC8& aUDN );
       
   111 
       
   112     /**
       
   113      * AddExcAlbumL.
       
   114      * @since Series 60 3.1     
       
   115      * @param aAlbum
       
   116      * @returns None
       
   117      */        
       
   118     IMPORT_C void AddExcAlbumL( const TDesC& aAlbum );
       
   119     
       
   120     /**
       
   121      * AddExcPlayListL.
       
   122      * @since Series 60 3.1     
       
   123      * @param aPlayList
       
   124      * @returns None
       
   125      */        
       
   126     IMPORT_C void AddExcPlayListL( const TDesC& aPlayList );
       
   127     
       
   128     /**
       
   129      * RemoveExcAlbum.
       
   130      * @since Series 60 3.1     
       
   131      * @param aAlbum
       
   132      * @returns None
       
   133      */        
       
   134     IMPORT_C void RemoveExcAlbum( const TDesC& aAlbum );
       
   135     
       
   136     /**
       
   137      * RemoveExcPlayList.
       
   138      * @since Series 60 3.1     
       
   139      * @param aPlayList
       
   140      * @returns None
       
   141      */        
       
   142     IMPORT_C void RemoveExcPlayList( const TDesC& aPlayList );
       
   143 
       
   144     /**
       
   145      * ExcAlbums.
       
   146      * @since Series 60 3.1     
       
   147      * @param None
       
   148      * @returns array of albums
       
   149      */
       
   150     IMPORT_C CDesCArray& ExcAlbums();
       
   151 
       
   152     /**
       
   153      * ExcPlayLists.
       
   154      * @since Series 60 3.1     
       
   155      * @param None
       
   156      * @returns array of play lists
       
   157      */
       
   158     IMPORT_C CDesCArray& ExcPlayLists();
       
   159                 
       
   160     /**
       
   161      * MediaServer.
       
   162      * @since Series 60 3.1     
       
   163      * @param aIndex index of the rule
       
   164      * @returns server uuid
       
   165      */    
       
   166     IMPORT_C const TDesC8& MediaServerL( TInt aIndex );    
       
   167     
       
   168     /**
       
   169      * SetNameL.
       
   170      * @since Series 60 3.1     
       
   171      * @param aName
       
   172      * @returns None
       
   173      */    
       
   174     IMPORT_C void SetNameL( const TDesC8& aName );
       
   175     
       
   176     /**
       
   177      * Name.
       
   178      * @since Series 60 3.1     
       
   179      * @param None
       
   180      * @returns name of the fill rule
       
   181      */    
       
   182     IMPORT_C TDesC8& Name() const;
       
   183     
       
   184     /**
       
   185      * SetListId.
       
   186      * @since Series 60 3.1     
       
   187      * @param aId
       
   188      * @returns None
       
   189      */        
       
   190     IMPORT_C void SetListId( const TUint aId );
       
   191     
       
   192     /**
       
   193      * ListId.
       
   194      * @since Series 60 3.1     
       
   195      * @param None
       
   196      * @returns id of the store list
       
   197      */        
       
   198     IMPORT_C TUint ListId() const;
       
   199     
       
   200     /**
       
   201      * SetSelected.
       
   202      * @since Series 60 3.1     
       
   203      * @param aSelected
       
   204      * @returns None
       
   205      */    
       
   206     IMPORT_C void SetSelected( TCmFillRuleStatus aSelected );
       
   207 
       
   208     /**
       
   209      * Selected.
       
   210      * @since Series 60 3.1     
       
   211      * @param None
       
   212      * @returns status
       
   213      */        
       
   214     IMPORT_C TCmFillRuleStatus Selected() const;
       
   215 
       
   216     /**
       
   217      * SetStatus.
       
   218      * @since Series 60 3.1     
       
   219      * @param aStatus
       
   220      * @returns None
       
   221      */    
       
   222     IMPORT_C void SetStatus( TCmListItemStatus aStatus );
       
   223 
       
   224     /**
       
   225      * Status.
       
   226      * @since Series 60 3.1     
       
   227      * @param None
       
   228      * @returns status
       
   229      */    
       
   230     IMPORT_C TCmListItemStatus Status() const;
       
   231             
       
   232     /**
       
   233      * DefCount.
       
   234      * @since Series 60 3.1     
       
   235      * @param None
       
   236      * @returns count
       
   237      */    
       
   238     IMPORT_C TInt DefCount() const;
       
   239     
       
   240     /**
       
   241      * MediaServerCount.
       
   242      * @since Series 60 3.1     
       
   243      * @param None
       
   244      * @returns count
       
   245      */    
       
   246     IMPORT_C TInt MediaServerCount() const;
       
   247     
       
   248     /**
       
   249     * Externalizes container information to stream.
       
   250     * Leaves in case of errors.
       
   251     * @since Series 60 3.1
       
   252     * @param reference to RWriteStream
       
   253     * @return none
       
   254     */
       
   255     void ExternalizeL( RWriteStream& aStream ) const;
       
   256     
       
   257     /**
       
   258     * Internalizes container information from stream.
       
   259     * Leaves in case of errors.
       
   260     * @since Series 60 3.1
       
   261     * @param reference to RReadStream
       
   262     * @return none
       
   263     */
       
   264     void InternalizeL( RReadStream& aStream );        
       
   265 
       
   266 private:
       
   267 
       
   268     /**
       
   269      * Constructor.
       
   270      */
       
   271     CCmStoreRule();
       
   272 
       
   273     /**
       
   274      * Second-phase constructor.
       
   275      */
       
   276     void ConstructL();
       
   277     
       
   278 
       
   279 private: // data
       
   280     
       
   281     /** Rule name */
       
   282     HBufC8* iName; // owned
       
   283     
       
   284     /** Selected or not */
       
   285     TCmFillRuleStatus iSelected;
       
   286     
       
   287     /** Rule defs */    
       
   288     RArray<TCmMediaType> iRuleDefs;
       
   289        
       
   290     /** Array rules included to fill rule*/
       
   291     RPointerArray<CCmMediaServer> iMediaServers; // items owned
       
   292     
       
   293     /** Id of the fill list */
       
   294     TUint iId;
       
   295     
       
   296     /** Excluded albums */
       
   297     CDesCArray* iExcAlbums; // owned
       
   298     
       
   299     /** Excluded playlists */
       
   300     CDesCArray* iExcPlayLists; // owned
       
   301     
       
   302     /** How to handle list items after store */
       
   303     TCmListItemStatus iStatus;
       
   304 
       
   305     };
       
   306 
       
   307 #endif //  __CMSTORERULE_H