mtpfws/mtpfw/datatypes/interface/cmtptypeopaquedata.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 #ifndef CMTPTYPEOPAQUEDATA_H_
       
    22 #define CMTPTYPEOPAQUEDATA_H_
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <mtp/mmtptype.h>
       
    26 
       
    27 class CMTPTypeOpaqueData : public CBase, public MMTPType
       
    28     {
       
    29 public:
       
    30     IMPORT_C static CMTPTypeOpaqueData* NewL();
       
    31     IMPORT_C static CMTPTypeOpaqueData* NewLC();
       
    32     IMPORT_C static CMTPTypeOpaqueData* NewL(const TDesC8 &aDes);
       
    33     IMPORT_C static CMTPTypeOpaqueData* NewLC(const TDesC8 &aDes);
       
    34     IMPORT_C ~CMTPTypeOpaqueData();
       
    35     
       
    36 public: //MMTPType
       
    37     IMPORT_C virtual TInt FirstReadChunk(TPtrC8& aChunk) const;
       
    38     IMPORT_C virtual TInt NextReadChunk(TPtrC8& aChunk) const;
       
    39     IMPORT_C virtual TInt FirstWriteChunk(TPtr8& aChunk);
       
    40     IMPORT_C virtual TInt NextWriteChunk(TPtr8& aChunk);
       
    41     IMPORT_C virtual TBool CommitRequired() const;
       
    42     IMPORT_C virtual MMTPType* CommitChunkL(TPtr8& aChunk);
       
    43     IMPORT_C virtual TUint64 Size() const;
       
    44     IMPORT_C virtual TUint Type() const;
       
    45     IMPORT_C virtual TInt FirstWriteChunk(TPtr8& aChunk, TUint aDataLength);
       
    46 
       
    47 public:
       
    48     IMPORT_C TInt Read(TPtrC8 &aDes) const;
       
    49     IMPORT_C TInt Write(const TPtrC8 &aDes);
       
    50     
       
    51 private:
       
    52     void ConstructL();
       
    53     void ConstructL(const TDesC8 &aDes);
       
    54     CMTPTypeOpaqueData();
       
    55     TInt CreateBuffer( const TInt aMaxSize );
       
    56 
       
    57     
       
    58 private:
       
    59     RBuf8    iBuffer;
       
    60     TPtr8    iPtrBuffer;
       
    61     };
       
    62 
       
    63 
       
    64 #endif /* CMTPTYPEOPAQUEDATA_H_ */