wmdrm/wmdrmengine/wmdrmserver/server/inc/slotdata.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 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:  Server definitions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __SLOTDATA_H
       
    20 #define __SLOTDATA_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "wmdrmserver.h"
       
    24 
       
    25 class CSlotData: public CBase
       
    26     {
       
    27 public:
       
    28 
       
    29     static CSlotData* NewL( 
       
    30         CWmDrmServer* aServer, 
       
    31         const TDesC8& aStore,
       
    32         const TDesC8& aNamespace,
       
    33         const TDesC8& aHashKey,
       
    34         const TDesC8& aUniqueKey );
       
    35     
       
    36     CSlotData( 
       
    37         CWmDrmServer* aServer, 
       
    38         const TDesC8& aStore,
       
    39         const TDesC8& aNamespace,
       
    40         const TDesC8& aHashKey,
       
    41         const TDesC8& aUniqueKey );
       
    42     
       
    43     ~CSlotData();
       
    44 
       
    45 
       
    46     void CreateL( TInt& aInitialSize );
       
    47 
       
    48     TInt OpenL( TInt& aCurrentSize );
       
    49 
       
    50     TInt Read( TInt aPosition, TDes8& aBuffer );
       
    51 
       
    52     TInt WriteL( TInt aPosition, const TDesC8& aBuffer );
       
    53 
       
    54     TInt ResizeL( TInt aNewSize );
       
    55 
       
    56     TInt DeleteL();
       
    57 
       
    58     TInt Size();
       
    59 
       
    60     void Close();
       
    61 
       
    62     void CloseFile();
       
    63 
       
    64     TBool IsOpen();
       
    65 
       
    66     void FlushL();
       
    67 	
       
    68 	CWmDrmServer* iServer;
       
    69 	TBuf8<KMaxWmDrmStoreNameSize> iStore;
       
    70     TBuf8<KMaxWmDrmNamespaceNameSize> iNamespace;
       
    71     TBuf8<KWmDrmIdSize> iHashKey;
       
    72     TBuf8<KWmDrmIdSize> iUniqueKey;
       
    73 	TBool iDirty;
       
    74 	TBool iExists;
       
    75 
       
    76 	// Is the file content read into the iData field and valid?
       
    77     TBool iOpen;
       
    78 	
       
    79 	TInt iReferences;
       
    80 	RBuf8 iData;
       
    81     };    
       
    82 
       
    83 #endif