PECengine/AttributeLibrary2/Inc/MPEngAttrFetchProcessor.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     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:  Attribute fetch processor interface.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MPENGATTRFETCHPROCESSOR_H
       
    19 #define __MPENGATTRFETCHPROCESSOR_H
       
    20 
       
    21 //INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include <BaDescA.h>
       
    24 #include "PEngWVCspVersion.h"
       
    25 
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MPEngAttrFetchProcessor;
       
    29 class MPEngPresenceAttrManager;
       
    30 class MPEngPresenceAttrModel2;
       
    31 class MPEngAdvTransactionStatus2;
       
    32 
       
    33 
       
    34 
       
    35 /**
       
    36  * Factory method to create attribute fetch processor.
       
    37  *
       
    38  * @since 3.0
       
    39  * @param aAttrManager The attribute manger to use in
       
    40  *                     attribute handling.
       
    41  * @param aFetchedPresenceIds The presence ID's to fetch.
       
    42  * @param aFetchedAttributes The presence attributes to fetch.
       
    43  * @param aDomain The user domain where the fetching happens.
       
    44  * @param aTransactionOperation The transaction operation id.
       
    45  * @param aCspVersion The CSP version to use in transaction.
       
    46  */
       
    47 IMPORT_C MPEngAttrFetchProcessor* CreateAttrFetchProcessorL(
       
    48     MPEngPresenceAttrManager& aAttrManager,
       
    49     const MDesCArray& aFetchedPresenceIds,
       
    50     const TArray< TUint32 > aFetchedAttributes,
       
    51     const TDesC& aDomain,
       
    52     TInt aTransactionOperation,
       
    53     TPEngWVCspVersion aCspVersion );
       
    54 
       
    55 
       
    56 
       
    57 //  CLASS DEFINITION
       
    58 
       
    59 /**
       
    60  * Attribute fetch processor interface.
       
    61  *
       
    62  * @since 3.0
       
    63  */
       
    64 class MPEngAttrFetchProcessor
       
    65     {
       
    66     public:  //Destructor
       
    67 
       
    68         /**
       
    69          * Destructor.
       
    70          *
       
    71          * @since 3.0
       
    72          */
       
    73         virtual ~MPEngAttrFetchProcessor() {};
       
    74 
       
    75 
       
    76     public: // Pure virtual functions
       
    77 
       
    78         /**
       
    79          * Method to generate fetch request.
       
    80          *
       
    81          * Generates attribute fetch request based on
       
    82          * attribute types and presence ID's given in
       
    83          * concrete object instantiation.
       
    84          *
       
    85          * @since 3.0
       
    86          * @param aSendBuffer The send buffer where to store the
       
    87          * request. Leaves if the request doesn't fit in the buffer.
       
    88          */
       
    89         virtual void GenerateRequestL( TDes8& aSendBuffer ) = 0;
       
    90 
       
    91 
       
    92         /**
       
    93          * Initializes the fetch response processing.
       
    94          * Further processing steps are executed
       
    95          * by calling ProcessStepL() function repeatedly
       
    96          * until it returns EFalse.
       
    97          *
       
    98          * If passed response isn't valid response
       
    99          * to Get-Presence request, leaves with KErrCorrupt.
       
   100          *
       
   101          * If network server returns errors in response
       
   102          * message, those are available to client from
       
   103          * transaction result.
       
   104          *
       
   105          * @since 3.0
       
   106          * @param aResponse The XML response from the
       
   107          *        network presence server.
       
   108          * @param aResultModels Array where to append extracted
       
   109          *        attribute models. Array is used along each result
       
   110          *        processing step and it should stay valid until
       
   111          *        all steps are processed. Array ownership remains
       
   112          *        on the client. Also generated attribute models
       
   113          *        ownership is returned to client.
       
   114          * @param aResultStatus Transaction status container where
       
   115          *        to append response status. Status container is used
       
   116          *        along each result processing step and it should stay
       
   117          *        valid until all steps are processed through.
       
   118          *        Status container ownership remains on the client.
       
   119          */
       
   120         virtual void InitResponseProcessingL(
       
   121             const TDesC8& aResponse,
       
   122             RPointerArray< MPEngPresenceAttrModel2 >& aResultModels,
       
   123             MPEngAdvTransactionStatus2& aResultStatus ) = 0;
       
   124 
       
   125 
       
   126         /**
       
   127          * Processes the next part from fetch response.
       
   128          *
       
   129          * @since 3.0
       
   130          * @return ETrue if there is further processing steps left .
       
   131          *         EFalse if no more further processing steps needed.
       
   132          */
       
   133         virtual TBool ProcessStepL() = 0;
       
   134 
       
   135 
       
   136 
       
   137     };
       
   138 
       
   139 #endif      // __MPENGATTRFETCHPROCESSOR_H
       
   140 
       
   141 //  End of File
       
   142