filemanager/bkupengine/inc/CMMCScBkupIndexJavaData.h
branchRCL_3
changeset 38 491b3ed49290
parent 36 95243422089a
child 39 65326cf895ed
equal deleted inserted replaced
36:95243422089a 38:491b3ed49290
     1 /*
       
     2 * Copyright (c) 2006 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: Declaration for CMMCScBkupIndexJavaDataEntry and 
       
    15 *              CMMCScBkupIndexJavaData
       
    16 *     
       
    17 *
       
    18 */
       
    19 
       
    20 #ifndef __CMMCSCBKUPINDEXJAVADATA_H__
       
    21 #define __CMMCSCBKUPINDEXJAVADATA_H__
       
    22 
       
    23 // User includes
       
    24 #include "CMMCScBkupIndexWithIdentifier.h"
       
    25 
       
    26 
       
    27 
       
    28 /**
       
    29 *
       
    30 * @since 3.0
       
    31 */
       
    32 NONSHARABLE_CLASS( CMMCScBkupIndexJavaDataEntry ) : public CBase
       
    33     {
       
    34     public:
       
    35 
       
    36         /**
       
    37         *
       
    38         */
       
    39         static CMMCScBkupIndexJavaDataEntry* NewLC();
       
    40 
       
    41         /**
       
    42         *
       
    43         */
       
    44         static CMMCScBkupIndexJavaDataEntry* NewLC( RReadStream& aStream );
       
    45 
       
    46         /**
       
    47         * C++ destructor
       
    48         */
       
    49         ~CMMCScBkupIndexJavaDataEntry();
       
    50 
       
    51     private: 
       
    52 
       
    53         /**
       
    54         *
       
    55         */
       
    56         CMMCScBkupIndexJavaDataEntry();
       
    57 
       
    58         /**
       
    59         *
       
    60         */
       
    61         void ConstructL();
       
    62 
       
    63     public: // API
       
    64 
       
    65         /**
       
    66         *
       
    67         */
       
    68         inline const TDesC& Hash() const { return *iHash; }
       
    69 
       
    70         /**
       
    71         *
       
    72         */
       
    73         void SetHashL( const TDesC& aHash );
       
    74 
       
    75         /**
       
    76         *
       
    77         */
       
    78         inline TDriveNumber Drive() const { return iDrive; }
       
    79 
       
    80         /**
       
    81         *
       
    82         */
       
    83         inline void SetDrive( TDriveNumber aDrive ) { iDrive = aDrive; }
       
    84 
       
    85         /**
       
    86         *
       
    87         */
       
    88         inline const TMMCScBkupArchiveVector& MidletInfo() const { return iMidletInfo; }
       
    89 
       
    90         /**
       
    91         *
       
    92         */
       
    93         inline void SetMidletInfo( const TMMCScBkupArchiveVector& aInfo ) { iMidletInfo = aInfo; }
       
    94 
       
    95         /**
       
    96         *
       
    97         */
       
    98         inline const TMMCScBkupArchiveVector& MidletDataInfo() const { return iMidletDataInfo; }
       
    99 
       
   100         /**
       
   101         *
       
   102         */
       
   103         inline void SetMidletDataInfo( const TMMCScBkupArchiveVector& aInfo ) { iMidletDataInfo = aInfo; }
       
   104         
       
   105         /**
       
   106         *
       
   107         */
       
   108         inline TBool HasMidletDataInfo() const { return iMidletDataInfo.Length() > 0 && iMidletDataInfo.Offset() > 0; }
       
   109 
       
   110     public: // Store & restore
       
   111 
       
   112         /**
       
   113         *
       
   114         */
       
   115         void InternalizeL( RReadStream& aStream );
       
   116 
       
   117         /**
       
   118         *
       
   119         */
       
   120         void ExternalizeL( RWriteStream& aStream ) const;
       
   121 
       
   122     private: // Internal enumerations
       
   123         enum
       
   124             {
       
   125             EStreamFormatVersion1 = 1
       
   126             };
       
   127 
       
   128     private: // Data members
       
   129         //
       
   130         HBufC* iHash;
       
   131         //
       
   132         TDriveNumber iDrive;
       
   133         //
       
   134         TMMCScBkupArchiveVector iMidletInfo;
       
   135         //
       
   136         TMMCScBkupArchiveVector iMidletDataInfo;
       
   137     };
       
   138 
       
   139     
       
   140     
       
   141 /**
       
   142 *
       
   143 *
       
   144 * @since 3.0
       
   145 */
       
   146 NONSHARABLE_CLASS(CMMCScBkupIndexJavaData) : public CMMCScBkupIndexBase
       
   147     {
       
   148     public:
       
   149 
       
   150         /**
       
   151         * Static constructor
       
   152         */
       
   153         static CMMCScBkupIndexJavaData* NewLC();
       
   154 
       
   155         /**
       
   156         * C++ destructor
       
   157         */
       
   158         ~CMMCScBkupIndexJavaData();
       
   159 
       
   160     private:
       
   161 
       
   162         /**
       
   163         * C++ default constructor
       
   164         */
       
   165         CMMCScBkupIndexJavaData();
       
   166 
       
   167     public: // API
       
   168 
       
   169         /**
       
   170         *
       
   171         */
       
   172         void AddIndexRecordL( const TMMCScBkupArchiveVector& aInfo, const TDesC& aHash, TDriveNumber aDrive, TJavaTransferType aType );
       
   173 
       
   174         /**
       
   175         *
       
   176         */
       
   177         inline TInt Count() const { return iEntries.Count(); }
       
   178 
       
   179         /**
       
   180         *
       
   181         */
       
   182         const CMMCScBkupIndexJavaDataEntry& At( TInt aIndex ) const;
       
   183 
       
   184     public: // From CMMCScBkupIndexBase
       
   185 
       
   186         /**
       
   187         *
       
   188         */
       
   189         void StoreL( MMMCScBkupDriver& aDriver );
       
   190 
       
   191         /**
       
   192         *
       
   193         */
       
   194         void RestoreL( MMMCScBkupDriver& aDriver );
       
   195 
       
   196     private: // Internal classes
       
   197 
       
   198         /**
       
   199         *
       
   200         */
       
   201         CMMCScBkupIndexJavaDataEntry* EntryByHash( const TDesC& aHash, TDriveNumber aDrive ) const;
       
   202 
       
   203     private: // Internal enumerations
       
   204         enum
       
   205             {
       
   206             EStreamFormatVersion1 = 1
       
   207             };
       
   208 
       
   209     private: // Member data
       
   210 
       
   211         //
       
   212         RMMCScBkupPointerArray< CMMCScBkupIndexJavaDataEntry > iEntries;
       
   213 
       
   214     };
       
   215 
       
   216 
       
   217 
       
   218 
       
   219 
       
   220 #endif // __CMMCSCBKUPINDEXJAVADATA_H__
       
   221 
       
   222 //End of File