imservices/imfeatureplugin/srcimdatamodel/imeventcodec.h
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Codec to pack and unpack event objects.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef IMEVENTCODEC_H
       
    19 #define IMEVENTCODEC_H
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 #include "eventcodec.h"
       
    24 
       
    25 class CXIMPApiEventBase;
       
    26 class RReadStream;
       
    27 
       
    28 
       
    29 /**
       
    30  * Codec to pack and unpack event objects.
       
    31  *
       
    32  * @lib ximpdatamodel.dll
       
    33  * @since S60 v3.2
       
    34  */
       
    35 NONSHARABLE_CLASS( CImEventCodec ): public MEventCodec
       
    36     {
       
    37     
       
    38 public:
       
    39     static CImEventCodec* NewL();
       
    40     
       
    41     ~CImEventCodec();
       
    42     
       
    43     
       
    44     /**
       
    45      * packs and allocates memory for the  
       
    46      * event object and event type
       
    47      *
       
    48      * @param aEventObj  
       
    49      * event object derived from CXIMPApiEventBase
       
    50      * 
       
    51      * @param aTypeOfEvent 
       
    52      * holds  type of the event after execution from aEventObj
       
    53      * 
       
    54      * @return
       
    55      * heap allocated which contains both
       
    56      * event and event type
       
    57      */
       
    58     HBufC8* PackL( CXIMPApiEventBase& aEventObj,
       
    59                                    TInt32& aTypeOfEvent );
       
    60                                    
       
    61     /**
       
    62      * packs  
       
    63      * event object and event type into the buffer
       
    64      *
       
    65      * @param aEventObj  
       
    66      * event object derived from CXIMPApiEventBase
       
    67      * 
       
    68      * @param aTypeOfEvent 
       
    69      * holds  type of the event after execution from aEventObj 
       
    70      * 
       
    71      * @param
       
    72      * buffer to be packed  with
       
    73      * event and event type
       
    74      */                               
       
    75                                    
       
    76     void PackL( CXIMPApiEventBase& aEventObj,
       
    77                          TInt32& aTypeOfEvent,
       
    78                          CBufFlat* aBuffer );
       
    79 
       
    80     /**
       
    81      *
       
    82      * @param aEventData
       
    83      * data desc which has the event type and id
       
    84      *
       
    85      * @param aTypeOfEvent 
       
    86      * holds  type of the event after execution from aEventData 
       
    87      *
       
    88      * @return new eventbase object constructed from aEventData
       
    89      *
       
    90      */
       
    91     CXIMPApiEventBase* UnPackL( const TDesC8& aEventData,
       
    92                                                 TInt32& aTypeOfEvent );
       
    93 protected:
       
    94     void ConstructL();
       
    95 
       
    96 private:
       
    97 
       
    98     CImEventCodec();
       
    99 
       
   100 
       
   101     };
       
   102 
       
   103 
       
   104 #endif // IMEVENTCODEC_H