wvuing/IMPSConnectionUI/OperationStepSrc/CnUiSapDataPacker.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  SAP data packer for Connection UI.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CNUISAPDATAPACKER_H
       
    19 #define __CNUISAPDATAPACKER_H
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <E32std.h>
       
    23 #include "impspresenceconnectionuiconstsng.h"
       
    24 
       
    25 //FORWARD DECLARATION
       
    26 class CIMPSSAPSettings;
       
    27 class RWriteStream;
       
    28 class RReadStream;
       
    29 
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33  * SAP data packer.
       
    34  * @since 3.0
       
    35  */
       
    36 NONSHARABLE_CLASS( CnUiSapDataPacker )
       
    37     {
       
    38 public: // New connection related functions
       
    39 
       
    40     /**
       
    41      * Removes any previously packed SAP from
       
    42      * passed SAP.
       
    43      * @since 3.0
       
    44      * @param aSap The SAP to clear.
       
    45      */
       
    46     static void RemovePackedSapL( CIMPSSAPSettings& aSap );
       
    47 
       
    48 
       
    49     /**
       
    50      * Packs the client information inside
       
    51      * of the SAP.
       
    52      *
       
    53      * @since 3.0
       
    54      * @param aClients The clients to pack.
       
    55      * @param aContainer The container SAP where
       
    56      * to pack the clients.
       
    57      */
       
    58     static void PackAAClientsL( const RArray< TIMPSConnectionClient >& aClients,
       
    59                                 CIMPSSAPSettings& aContainer );
       
    60 
       
    61     /**
       
    62      * Extracts the packed client information from
       
    63      * the containing SAP.
       
    64      *
       
    65      * @since 3.0
       
    66      * @param aContainer SAP container where to search
       
    67      * for packed clients.
       
    68      * @param aClients On the return contains unpacked clients.
       
    69      * @return ETrue if could unpack. Else EFalse.
       
    70      */
       
    71     static TBool ExtractAAClientsL( CIMPSSAPSettings& aContainer,
       
    72                                     RArray< TIMPSConnectionClient >& aClients );
       
    73 
       
    74 
       
    75 private: //helpers
       
    76     /**
       
    77      * Writes the given mark to the given stream.
       
    78      *
       
    79      * @since 3.0
       
    80      * @param aWStream write stream
       
    81      * @param aMark the mark to write
       
    82      */
       
    83     static void WriteMarkL( RWriteStream& aWStream, TInt8 aMark );
       
    84 
       
    85     /**
       
    86      * Reads the given mark from the given stream.
       
    87      *
       
    88      * @since 3.0
       
    89      * @param aRStream read stream
       
    90      * @param aSupposedMark the mark to read
       
    91      */
       
    92     static TBool CheckMarkL( RReadStream& aRStream, TInt8 aSupposedMark );
       
    93 
       
    94     /**
       
    95      * Writes the given data to the given stream.
       
    96      *
       
    97      * @since 3.0
       
    98      * @param aWStream write stream
       
    99      * @param aClients the clients to write
       
   100      */
       
   101     static void WriteClientsL( RWriteStream& aWStream ,
       
   102                                const RArray< TIMPSConnectionClient >& aClients );
       
   103 
       
   104     /**
       
   105      * Reads the clients from the given stream.
       
   106      *
       
   107      * @since 3.0
       
   108      * @param aRStream write stream
       
   109      * @param aClients the array to read the clients into
       
   110      */
       
   111     static void ReadClientsL( RReadStream& aRStream,
       
   112                               RArray< TIMPSConnectionClient >& aClients );
       
   113 
       
   114 private: // prohibited constructor / destructor
       
   115     CnUiSapDataPacker();
       
   116     ~CnUiSapDataPacker();
       
   117 
       
   118     };
       
   119 
       
   120 
       
   121 #endif //__CNUISAPDATAPACKER_H
       
   122 
       
   123 //  End of File
       
   124