wmdrm/wmdrmengine/wmdrmserver/server/inc/wmdrmdatastore.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     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:  WMDRM data store 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CWMDRMDATASTORE_H
       
    20 #define CWMDRMDATASTORE_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "wmdrmserver.h"
       
    24 
       
    25 class CWmDrmDataStore : public CBase
       
    26     {
       
    27     public:
       
    28     
       
    29         static CWmDrmDataStore* NewL( CWmDrmServer* aServer );
       
    30         ~CWmDrmDataStore();
       
    31         
       
    32         TWmDrmStoreState DataStoreStateL();
       
    33         
       
    34         void UpdateDummyDbFileL( TInt aSize, TBool aConfiguredDrive );
       
    35         TInt DummyDBSizeL( TBool aConfiguredDrive );
       
    36         
       
    37     private:
       
    38 
       
    39         CWmDrmDataStore( CWmDrmServer* aServer );
       
    40         void ConstructL();
       
    41         
       
    42         void ReadInitialFreeSpaceL( const TDesC& aFileName, TBool& aConfiguredDrive );
       
    43         void WriteInitialFreeSpaceL( const TDesC& aFileName, TBool& aConfiguredDrive );
       
    44         void InitializeDummyDbFileL( const TDesC& aFileName, RFile& aDummyDb, 
       
    45         		TBool& aConfiguredDrive );
       
    46         TInt DataStoreSizeL( TBool aConfiguredDrive );
       
    47         void PrepareInfoFilesL( TBool aConfiguredDrive, TChar aDriveLetter, 
       
    48 			RFile& aDummyDb );
       
    49         
       
    50     private:    
       
    51     
       
    52         // Not owned
       
    53         CWmDrmServer* iServer;
       
    54         
       
    55         // The file and variables ending with '2' are used only
       
    56         // in the case when the WM DRM rights are stored to a
       
    57         // configured drive other than the default system drive.  
       
    58         RFile iDummyDb;
       
    59         RFile iDummyDb2;
       
    60         TInt64 iInitialFreeSpace; 
       
    61         TInt64 iInitialFreeSpace2;
       
    62         TInt64 iMinFreeSpace;
       
    63         TInt64 iMinFreeSpace2;
       
    64         TInt iMaxSpaceRatio;
       
    65         TInt iMaxSpaceRatio2;
       
    66         TInt iDummyDbInitialSize;
       
    67         TInt iDummyDbInitialSize2;
       
    68         
       
    69         // Whether WM DRM rights are configured to be stored to an internal
       
    70         // mass drive or not
       
    71         TBool iWmDrmRightsConfigFound;    
       
    72     };
       
    73 
       
    74 #endif // CWMDRMDATASTORE_H