PECengine/CoreUtilsLib2/Src/CPEngDataResultEntry.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Data entry implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CPENGDATARESULTENTRY_H__
       
    19 #define __CPENGDATARESULTENTRY_H__
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include "CPEngDataResultEntry.h"
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 //FORWARD DECLARATION
       
    29 class RReadStream;
       
    30 class RWriteStream;
       
    31 class CPEngTransactionStatus;
       
    32 
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  * Data entry implementation.
       
    38  *
       
    39  * @since 3.0
       
    40  */
       
    41 NONSHARABLE_CLASS( CPEngDataResultEntry ) : public CBase
       
    42     {
       
    43 public:  // Constructors and destructor
       
    44 
       
    45     /**
       
    46     * Two-phased constructor.
       
    47     * Leaves object to CleanupStack.
       
    48     *
       
    49     * @since 3.0
       
    50     * @param aOperationID Operation ID.
       
    51     * @param aData The data. Takes the ownership in full success.
       
    52     * @return New CPEngDataResultEntry object.
       
    53     */
       
    54     static CPEngDataResultEntry* NewLC( TInt aOperationID,
       
    55     HBufC* aData );
       
    56 
       
    57     /**
       
    58      * Two-phased constructor, initialises this object from
       
    59      * given stream and leaves object to CleanupStack.
       
    60      *
       
    61      * @since 3.0
       
    62      * @aStream The read stream where from to initialize object.
       
    63      */
       
    64     static CPEngDataResultEntry* NewLC( RReadStream& aStream );
       
    65 
       
    66 
       
    67     /**
       
    68      * Two-phased constructor, initialises this object from
       
    69      * given existing detailed result entry. Leaves object
       
    70      * to CleanupStack.
       
    71      *
       
    72      * @since 3.0
       
    73      * @aStream The detailed result where from to initialize object.
       
    74      */
       
    75     static CPEngDataResultEntry* NewLC( const CPEngDataResultEntry& aEntry );
       
    76 
       
    77 
       
    78     /**
       
    79      * Destructor.
       
    80      */
       
    81     virtual ~CPEngDataResultEntry();
       
    82 
       
    83 
       
    84 
       
    85 private: //constructors
       
    86 
       
    87     /**
       
    88      * C++ default constructor.
       
    89      */
       
    90     CPEngDataResultEntry();
       
    91 
       
    92 
       
    93     /**
       
    94      * Symbian constructor.
       
    95      */
       
    96     void ConstructL( const CPEngDataResultEntry& aEntry );
       
    97 
       
    98 
       
    99 
       
   100 public: // New functions
       
   101 
       
   102     /**
       
   103      * Gets the operation id.
       
   104      *
       
   105      * @return The operation id.
       
   106      */
       
   107     TInt Operation() const;
       
   108 
       
   109 
       
   110     /**
       
   111      * Gets the result data.
       
   112      *
       
   113      * @return The result data.
       
   114      */
       
   115     const TDesC16& Data() const;
       
   116 
       
   117 
       
   118 
       
   119 public: //Streaming support
       
   120 
       
   121     /**
       
   122      * Internalizes this objects state from given
       
   123      * read stream.
       
   124      *
       
   125      * @since 3.0
       
   126      * @param aStream The stream to read from.
       
   127      */
       
   128     void InternalizeL( RReadStream& aStream );
       
   129 
       
   130 
       
   131     /**
       
   132      * Externalizes this objects state to given write stream.
       
   133      *
       
   134      * @since 3.0
       
   135      * @param aStream The stream to write to.
       
   136      */
       
   137     void ExternalizeL( RWriteStream& aStream ) const;
       
   138 
       
   139 
       
   140     /**
       
   141      * Approximates the needed stream length needed to
       
   142      * externalize the container data.
       
   143      *
       
   144      * @since 3.0
       
   145      * @return Returns approximation of needed space in bytes.
       
   146      */
       
   147     TInt ExternalizeSize() const;
       
   148 
       
   149 
       
   150 
       
   151 private:    // Friend declarations
       
   152 
       
   153     /**
       
   154      * Friend class.
       
   155      * @since 3.0
       
   156      */
       
   157     friend class CPEngTransactionStatus;        // CSI: 36 #
       
   158 
       
   159 
       
   160 
       
   161 
       
   162 private:    // Data
       
   163 
       
   164     //OWN: Link
       
   165     TSglQueLink iLink;
       
   166 
       
   167     //OWN: Operation id
       
   168     TInt    iOperationID;
       
   169 
       
   170     //OWN: Data result
       
   171     HBufC16*    iData;
       
   172 
       
   173     };
       
   174 
       
   175 
       
   176 #endif      //  __CPENGDATARESULTENTRY_H__
       
   177 
       
   178 
       
   179 // End of File
       
   180 
       
   181