IMPSengine/client/inc/impsfundcommand.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002-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: 
       
    15 * commander for imps data accessor. AO.      
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CImpsFundCommand_H
       
    21 #define CImpsFundCommand_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "impsdataaccessorapi.h"
       
    25 #include "impsclientsrv.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CImpsKey;
       
    29 class CImpsDataAccessor;
       
    30 
       
    31 
       
    32     class CImpsFundCommand2 : public CActive
       
    33     {
       
    34     public:  // Constructors and destructor
       
    35         
       
    36         /**
       
    37         * Two-phased constructor.
       
    38         * @param aClient a client session
       
    39         */
       
    40         static CImpsFundCommand2* NewL( RImpsFundClient2& aClient );
       
    41         
       
    42         /**
       
    43         * Destructor.
       
    44         */
       
    45         virtual ~CImpsFundCommand2();
       
    46 
       
    47     public: // New functions
       
    48         
       
    49         /** 
       
    50         * Start the execution. 
       
    51         * @param aType Type of the request
       
    52         */
       
    53         void StartRunL();
       
    54         
       
    55         /*
       
    56         * Reset all member variables that the object owns
       
    57         */
       
    58         void ResetMembers();
       
    59   
       
    60         /** 
       
    61         * Initialise a request
       
    62         * @param aUserIDs User IDs to be inserted
       
    63         */
       
    64         void InitialiseL( const TImpsContent* aElementArray,
       
    65                           const TUint aArraySize );
       
    66         
       
    67         /** 
       
    68         * Set the user IDs of the request
       
    69         * @param aUserIDs User IDs to be inserted
       
    70         */
       
    71         void SetUserIDsL( const MDesCArray* aUserIDs );
       
    72         
       
    73         /** 
       
    74         * Construct a search pair list 
       
    75         * @param aSearchPairs
       
    76         */
       
    77         void MakeSearchPairListL( const CSearchPairs& aSearchPairs );
       
    78         
       
    79         /** 
       
    80         * Set the screen names of the request
       
    81         * @param aScreenNames Screen names
       
    82         * @param aGroupNames GroupIDs
       
    83         */
       
    84         void SetScreenNamesL( const MDesCArray* aScreenNames,
       
    85                               const MDesCArray* aGroupNames );
       
    86         
       
    87         /** 
       
    88         * Insert a descriptor element to the request
       
    89         * @param aElementValue Value of the element
       
    90         * @param aElementName Name of the element
       
    91         * @param aIndex Index of the element
       
    92         */
       
    93         void InsertDescriptorElementL( const TDesC& aElementValue,
       
    94                                        const TImpsContent aElementName,
       
    95                                        const TInt aIndex );
       
    96 
       
    97         /** 
       
    98         * Insert an integer element to the request
       
    99         * @param aElementValue Value of the element
       
   100         * @param aElementName Name of the element
       
   101         * @param aIndex Index of the element
       
   102         */
       
   103         void InsertIntegerElementL( const TInt aElementValue,
       
   104                                     const TImpsContent aElementName,
       
   105                                     const TInt aIndex );
       
   106 
       
   107         /*
       
   108         * Insert an empty element to the request
       
   109         * @param aElementName Name of the element
       
   110         * @param aIndex Index of the element
       
   111         */
       
   112         void InsertEmptyElementL( const TImpsContent aElementName,
       
   113                                   const TInt aIndex );
       
   114         
       
   115         /** 
       
   116         * Insert a boolean element to the request
       
   117         * @param aElementValue Value of the element
       
   118         * @param aElementName Name of the element
       
   119         * @param aIndex Index of the element
       
   120         */
       
   121         void InsertBooleanElementL( const TBool aElementValue, 
       
   122                                     const TImpsContent aElementName,
       
   123                                     const TInt aIndex );
       
   124         
       
   125         /** 
       
   126         * Pack the data for sending to the server thread 
       
   127         * @param aMessageType Type of the request
       
   128         * @param aOpId OpId of the request
       
   129         */
       
   130         void PackAndSendL( const TImpsMessageType aMessageType,
       
   131                            const TInt aOpId );
       
   132 
       
   133         /** 
       
   134         * Pop one element from the data accessor key
       
   135         * @param aCount How many to Pop();
       
   136         */
       
   137         inline void PopElementL( const TInt aCount = 0 );
       
   138 
       
   139     private:
       
   140 
       
   141         /**
       
   142         * C++ default constructor is private
       
   143         */
       
   144         CImpsFundCommand2( TInt aPriority, RImpsFundClient2& aClient );
       
   145 
       
   146         /**
       
   147         * From CActive
       
   148         */
       
   149         void RunL();
       
   150         
       
   151         /**
       
   152         * From CActive
       
   153         */
       
   154         void DoCancel();
       
   155 
       
   156         /**
       
   157         * By default Symbian OS constructor is private.
       
   158         */
       
   159         void ConstructL();
       
   160         
       
   161         /*
       
   162         * Map requests from TImpsMessageType to TImpsServRequest
       
   163         * @param aMessageType TImpsMessageType
       
   164         * @return TImpsServRequest Type of the message
       
   165         */
       
   166         TImpsServRequest ServerRequestTypeL( 
       
   167                                         const TImpsMessageType aMessageType );
       
   168 
       
   169         // By default, prohibit copy constructor
       
   170         CImpsFundCommand2( const CImpsFundCommand2& );
       
   171         // Prohibit assigment operator
       
   172         CImpsFundCommand2& operator= ( const CImpsFundCommand2& );
       
   173 
       
   174     private:    // Data
       
   175         HBufC8*                         iMessage;
       
   176         CImpsKey*                       iKey;
       
   177         CImpsFields*                    iImpsFields;
       
   178         CImpsDataAccessor*              iDataAccessor;
       
   179         RImpsFundClient2&                iClient;
       
   180         TUint                           iArraySize;
       
   181         TInt                            iOpId;
       
   182         TInt                            iState;
       
   183         TPtrC8                          iMessagePtr;
       
   184     };
       
   185 #include "ImpsFundCommand.inl"
       
   186 
       
   187 #endif  
       
   188             
       
   189 // End of File