mtpfws/mtpfw/datatypes/interface/cmtptypestorageinfo.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CMTPTYPESTORAGEINFO_H
       
    22 #define CMTPTYPESTORAGEINFO_H
       
    23 
       
    24 #include <e32std.h>
       
    25 #include <mtp/cmtptypecompoundbase.h>
       
    26 
       
    27 class CMTPTypeString;
       
    28 
       
    29 /** 
       
    30 Defines the MTP StorageInfo dataset. The StorageInfo dataset provides a 
       
    31 description of the MTP device and is generated in response to a GetStorageInfo
       
    32 operation request.
       
    33 @internalComponent 
       
    34 */ 
       
    35 class CMTPTypeStorageInfo : public CMTPTypeCompoundBase
       
    36     {
       
    37 public:    
       
    38 
       
    39     /**
       
    40     MTP StotageInfo dataset element identifiers.
       
    41     */
       
    42      enum TMTPStorageInfoElement
       
    43         {
       
    44         /**
       
    45         The physical nature of the storage described by the dataset.
       
    46         */ 
       
    47         EStorageType,
       
    48         
       
    49         /**
       
    50         The logical file system in use on the storage.
       
    51         */ 
       
    52         EFileSystemType,
       
    53         
       
    54         /**
       
    55         The global write-protection status of the storage.
       
    56         */
       
    57         EAccessCapability,
       
    58         
       
    59         /**
       
    60         The maximum capacity of the storage in bytes.
       
    61         */
       
    62         EMaxCapacity,
       
    63         
       
    64         /**
       
    65         The available capacity of the storage in objects.
       
    66          */
       
    67         EFreeSpaceInBytes,
       
    68         
       
    69         /**
       
    70         The available capacity of the storage in objects. This field is only 
       
    71         used if there is a reasonable expectation that the number of objects 
       
    72         that remain to be written can be accurately predicted.
       
    73         */
       
    74         EFreeSpaceInObjects,
       
    75         
       
    76         /**
       
    77         The human-readable string identifying the storage.
       
    78         */
       
    79         EStorageDescription,
       
    80         
       
    81         /**
       
    82         The unique volume identifier of the storage, e.g. serial number.
       
    83         */
       
    84         EVolumeIdentifier,
       
    85         
       
    86         /**
       
    87         The number of dataset elements.
       
    88         */
       
    89         ENumElements
       
    90         };  
       
    91 
       
    92 public:  
       
    93     
       
    94     IMPORT_C static CMTPTypeStorageInfo* NewL();
       
    95     IMPORT_C static CMTPTypeStorageInfo* NewLC();
       
    96     
       
    97     IMPORT_C virtual ~CMTPTypeStorageInfo();  
       
    98      
       
    99 public: // From MMTPType
       
   100 
       
   101     IMPORT_C TUint Type() const;
       
   102         
       
   103 private: // From CMTPTypeCompoundBase
       
   104     
       
   105     const TElementInfo& ElementInfo(TInt aElementId) const; 
       
   106     
       
   107 private:
       
   108 
       
   109     CMTPTypeStorageInfo();        
       
   110     void ConstructL(); 
       
   111     
       
   112     MMTPType* NewFlatChunkL(const TElementInfo& aElementInfo);
       
   113     MMTPType* NewStringChunkL(const TElementInfo& aElementInfo);
       
   114         
       
   115 private:
       
   116         
       
   117     /**
       
   118     Data chunk identifiers.
       
   119     */
       
   120     enum TChunkIds
       
   121         {
       
   122         /**
       
   123         The flat data chunk ID.
       
   124         */
       
   125         EIdFlatChunk,
       
   126         
       
   127         /**
       
   128         The EStorageDescription element data chunk ID.
       
   129         */
       
   130         EIdStorageDescriptionChunk,
       
   131         
       
   132         /**
       
   133         The EVolumeIdentifier element data chunk ID.
       
   134         */
       
   135         EIdVolumeIdentifierChunk,
       
   136         
       
   137         /**
       
   138         The number of data chunks.
       
   139         */
       
   140         EIdNumChunks
       
   141         };
       
   142     
       
   143     /**
       
   144     The dataset element metadata table content.
       
   145     */
       
   146     static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[];
       
   147     
       
   148     /**
       
   149     The dataset element metadata table.
       
   150     */
       
   151     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
   152     
       
   153     /**
       
   154     The size in bytes of the flat data chunk.
       
   155     */
       
   156     static const TUint                              KFlatChunkSize;
       
   157     
       
   158     /**
       
   159     The flat data chunk comprising elements EStorageType to EFreeSpaceInObjects.
       
   160     */
       
   161     RMTPTypeCompoundFlatChunk                       iChunkFlat;
       
   162     
       
   163     /**
       
   164     The MTP string type data chunks (EStorageDescription, and 
       
   165     EVolumeIdentifier).
       
   166     */
       
   167     RPointerArray<CMTPTypeString>                   iStringChunks;
       
   168     };
       
   169     
       
   170 #endif // CMTPTYPESTORAGEINFO_H
       
   171