mtpfws/mtpfw/datatypes/interface/cmtptypeserviceevent.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 @publishedPartner
       
    19 @released
       
    20 */
       
    21 
       
    22 #ifndef CMTPTYPESERVICEEVENT_H_
       
    23 #define CMTPTYPESERVICEEVENT_H_
       
    24 
       
    25 #include <e32std.h>
       
    26 #include <mtp/cmtptypecompoundbase.h>
       
    27 #include <mtp/cmtptypelist.h>
       
    28 
       
    29 class CMTPTypeArray;
       
    30 class CMTPTypeString;
       
    31 class CMTPTypeServiceEventElement;
       
    32 
       
    33 class CMTPTypeServiceEventList : public CMTPTypeList
       
    34 	{
       
    35 public:
       
    36     
       
    37 	IMPORT_C static CMTPTypeServiceEventList* NewL();
       
    38 	IMPORT_C static CMTPTypeServiceEventList* NewLC();
       
    39 
       
    40 	IMPORT_C virtual ~CMTPTypeServiceEventList();  
       
    41     
       
    42     IMPORT_C void AppendL(CMTPTypeServiceEventElement* aElement);
       
    43     IMPORT_C CMTPTypeServiceEventElement& ElementL(TUint aIndex) const; 
       
    44     
       
    45 private:
       
    46 
       
    47 	CMTPTypeServiceEventList();
       
    48     void ConstructL();
       
    49     
       
    50 	};
       
    51 
       
    52 class CMTPTypeServiceEventElement : public CMTPTypeCompoundBase
       
    53 	{
       
    54 public:
       
    55 	
       
    56 	enum TMTPServiceEventElement
       
    57 		{
       
    58 		EEventCode,
       
    59 		EEventGUID,
       
    60 		EEventName,
       
    61 		ENumElements
       
    62 		};
       
    63 	
       
    64 public:
       
    65     
       
    66 	IMPORT_C static CMTPTypeServiceEventElement* NewL();
       
    67 	IMPORT_C static CMTPTypeServiceEventElement* NewLC();
       
    68 	IMPORT_C static CMTPTypeServiceEventElement* NewL(const TUint16 aEventCode,const TMTPTypeGuid& aEventGUID,const TDesC& aEventName);
       
    69 	IMPORT_C static CMTPTypeServiceEventElement* NewLC(const TUint16 aEventCode,const TMTPTypeGuid& aEventGUID,const TDesC& aEventName);
       
    70     
       
    71 	IMPORT_C virtual ~CMTPTypeServiceEventElement();   
       
    72      
       
    73 public: // From CMTPTypeCompoundBase
       
    74 
       
    75     IMPORT_C TUint Type() const;
       
    76         
       
    77 private: // From CMTPTypeCompoundBase
       
    78     
       
    79     const TElementInfo& ElementInfo(TInt aElementId) const;
       
    80 
       
    81 private:
       
    82 
       
    83 	CMTPTypeServiceEventElement();
       
    84     void ConstructL();
       
    85     void ConstructL(const TUint16 aEventCode,const TMTPTypeGuid& aEventGUID,const TDesC& aEventName);
       
    86     MMTPType* NewFlatChunkL();
       
    87     
       
    88 private:
       
    89     
       
    90 	/**
       
    91     Data chunk identifiers.
       
    92     */
       
    93     enum TChunkIds
       
    94     	{
       
    95     	/**
       
    96         The flat data chunk ID.
       
    97         */
       
    98         EIdFlatChunk,
       
    99                
       
   100         EIdServiceEventNameChunk,
       
   101         
       
   102         /**
       
   103         The number of data chunks.
       
   104         */
       
   105         EIdNumChunks
       
   106     	};	
       
   107     
       
   108     
       
   109     /**
       
   110    	The dataset element metadata table content.
       
   111     */
       
   112     static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[];
       
   113        
       
   114     /**
       
   115     The dataset element metadata table.
       
   116     */
       
   117     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
   118        
       
   119    	/**
       
   120     The size in bytes of the flat data chunk.
       
   121     */
       
   122     static const TUint                              KFlatChunkSize;
       
   123        
       
   124     /**
       
   125     The flat data chunk comprising elements EStorageType to EFreeSpaceInObjects.
       
   126     */
       
   127     RMTPTypeCompoundFlatChunk                       iChunkFlat;
       
   128        
       
   129     /**
       
   130     The MTP string type data chunks (EStorageDescription, and EVolumeIdentifier).
       
   131     */
       
   132     CMTPTypeString*           						iChunkString;  
       
   133 
       
   134 	};
       
   135 
       
   136 #endif /*CMTPTYPESERVICEEVENT_H_*/