omadrm/drmengine/server/inc/drmparentstorage.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Store for parent index of Decision Making Machine
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DRMPARENTSTORAGE_H
       
    20 #define DRMPARENTSTORAGE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <badesca.h> // CDesC8ArraySeg
       
    24 #include "drmenginetypedefs.h"
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // MACROS
       
    29 
       
    30 // DATA TYPES
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 
       
    34 // TYPE DEFINITIONS
       
    35 
       
    36 // FUNCTION PROTOTYPES
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  CDRMParentStorage is a container for parent permissions for Decision 
       
    42 *  Making Machine.
       
    43 *
       
    44 *  @lib RightsServer.exe
       
    45 *  @since 3.0
       
    46 */
       
    47 NONSHARABLE_CLASS( CDRMParentStorage ) : public CBase
       
    48     {
       
    49     public: // Constructors and destructor
       
    50         /**
       
    51         * NewLC
       
    52         *
       
    53         * Two-phase constructor.
       
    54         *
       
    55         * @since    3.0
       
    56         * @return   A pointer to newly created object.
       
    57         */
       
    58         static CDRMParentStorage* NewLC();
       
    59         
       
    60         /**
       
    61         * NewLC
       
    62         *
       
    63         * Two-phase constructor.
       
    64         *
       
    65         * @since    3.0
       
    66         * @return   A pointer to newly created object.
       
    67         */
       
    68         static CDRMParentStorage* NewL();
       
    69         
       
    70         /**
       
    71         * Destructor.
       
    72         * @since Sereis 60 Release 3.0
       
    73         */        
       
    74         ~CDRMParentStorage();
       
    75         
       
    76         /**
       
    77         * Creates a new list into the store.
       
    78         * @since Sereis 60 Release 3.0
       
    79         * @return A reference to a newly created list.
       
    80         */
       
    81         CDRMPermissionList& NewListL();
       
    82         
       
    83         /**
       
    84         * Adds the id to the list. Assumes the list has been retrieved
       
    85         * earlier with NewListL(), and the list has been filled properly.
       
    86         * @since Sereis 60 Release 3.0
       
    87         * @param aCID Content-ID
       
    88         */
       
    89         void AddL( const TDesC8& aCID );
       
    90         
       
    91         /**
       
    92         * Checks whether the id is marked as bad parent.
       
    93         * @since Sereis 60 Release 3.0
       
    94         * @param aCID Content-ID
       
    95         * @return boolean.
       
    96         */
       
    97         TBool Bad( const TDesC8& aCID );
       
    98         
       
    99         /**
       
   100         * Check if there are permissions for a given id
       
   101         * @since Sereis 60 Release 3.0
       
   102         * @param aCID The id to be found
       
   103         * @return List of permissions associated to the id.
       
   104         */
       
   105         TBool HasPermissions( const TDesC8& aCID );
       
   106 
       
   107         /**
       
   108         * Find operator. 
       
   109         * Assumes the id is in store, and will panic if there are no permissions.
       
   110         * @since Sereis 60 Release 3.0
       
   111         * @param aCID The id to be found
       
   112         * @return List of permissions associated to the id.
       
   113         */
       
   114         CDRMPermissionList& operator[]( const TDesC8& aCID );
       
   115         
       
   116     protected: 
       
   117         /**
       
   118         * Default constructor.
       
   119         * @since Sereis 60 Release 3.0
       
   120         */
       
   121         CDRMParentStorage();
       
   122         
       
   123         /*
       
   124         * 2nd phase constructor.
       
   125         * @since Sereis 60 Release 3.0
       
   126         */
       
   127         void ConstructL();
       
   128     private:
       
   129         // An array of parent IDs. Ordered list.
       
   130         CDesC8ArraySeg* iParentIDs;
       
   131         
       
   132         // An array of permission lists. In sync with iParentIDs.
       
   133         RPointerArray< CDRMPermissionList > iParents;
       
   134         
       
   135     };
       
   136 
       
   137 #endif // DRMPARENTSTORAGE_H
       
   138 
       
   139 
       
   140 // End of file