PECengine/PresenceServer2/ServerSrc/CPEngIncomingDataHandler.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Incoming data handler
       
    15 *                it handles incoming data from the network server
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __CPENGINCOMINGDATAHANDLER_H__
       
    22 #define __CPENGINCOMINGDATAHANDLER_H__
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MPEngPureDataHandler;
       
    29 class MPEngIncomingTransactionHandler;
       
    30 class MPEngTransactionFactory;
       
    31 class MPEngRequestHandlerObserver;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35  *  Incoming data handler
       
    36  *  it handles incoming data from the network server
       
    37  *
       
    38  *  @lib PEngServer2
       
    39  *  @since 3.0
       
    40  */
       
    41 NONSHARABLE_CLASS( CPEngIncomingDataHandler ) :
       
    42         public CActive
       
    43     {
       
    44 public:  // Constructors and destructor
       
    45 
       
    46     /**
       
    47      *  Two-phased constructor.
       
    48      *  @since 3.0
       
    49      *  @param aPureDataHandler pure data handler
       
    50      *  @param aTransactionFactories transaction factories od CPS session
       
    51      *  @param aRequestHandlerObserver request handler observer
       
    52      */
       
    53     static CPEngIncomingDataHandler* NewL(
       
    54         MPEngPureDataHandler& aPureDataHandler,
       
    55         RPointerArray<MPEngTransactionFactory>&
       
    56         aTransactionFactories,
       
    57         MPEngRequestHandlerObserver& aRequestHandlerObserver );
       
    58 
       
    59     static CPEngIncomingDataHandler* NewLC(
       
    60         MPEngPureDataHandler& aPureDataHandler,
       
    61         RPointerArray<MPEngTransactionFactory>&
       
    62         aTransactionFactories,
       
    63         MPEngRequestHandlerObserver& aRequestHandlerObserver );
       
    64 
       
    65     /**
       
    66      *  Destructor.
       
    67      */
       
    68     virtual ~CPEngIncomingDataHandler();
       
    69 
       
    70 public: // New functions
       
    71 
       
    72     /**
       
    73      *  Start listener
       
    74      *
       
    75      *  @since 3.0
       
    76      */
       
    77     void StartListeningL();
       
    78 
       
    79 public:		// Function from the CActive
       
    80 
       
    81     /**
       
    82      * CActive RunL()
       
    83      * @since 3.0
       
    84      */
       
    85     void RunL();
       
    86 
       
    87     /**
       
    88      * CActive RunError()
       
    89      * @since 3.0
       
    90      * @param aError The leave code
       
    91      * @return KErrNone
       
    92      */
       
    93     TInt RunError( TInt aError );
       
    94 
       
    95     /**
       
    96      * Implements cancellation of an outstanding request.
       
    97      * This function is called as part of the active object’s Cancel()
       
    98      * @since 3.0
       
    99      */
       
   100     void DoCancel();
       
   101 
       
   102 private:  // New functions
       
   103     /**
       
   104      * Handle new incoming data from the VW server
       
   105      * @since 3.0
       
   106      */
       
   107     void HandleIncomingDataL();
       
   108 
       
   109 
       
   110 private:
       
   111 
       
   112     /**
       
   113      * C++ default constructor.
       
   114      */
       
   115     CPEngIncomingDataHandler(
       
   116         MPEngPureDataHandler& aPureDataHandler,
       
   117         RPointerArray<MPEngTransactionFactory>&
       
   118         aTransactionFactories,
       
   119         MPEngRequestHandlerObserver& aRequestHandlerObserver );
       
   120 
       
   121     /**
       
   122      * By default Symbian 2nd phase constructor is private.
       
   123      */
       
   124     void ConstructL();
       
   125 
       
   126 private:    // Data
       
   127 
       
   128 
       
   129     /// REF: Pure data handler
       
   130     MPEngPureDataHandler&						iPureDataHandler;
       
   131 
       
   132     /// REF: Transaction factories
       
   133     RPointerArray<MPEngTransactionFactory>&		iTransactionFactories;
       
   134 
       
   135     /// REF: Request handler observer
       
   136     MPEngRequestHandlerObserver&				iRequestHandlerObserver;
       
   137 
       
   138     /// OWN: Incoming transaction handler
       
   139     MPEngIncomingTransactionHandler*			iTransactionHandler;
       
   140     };
       
   141 
       
   142 #endif      // __CPENGINCOMINGDATAHANDLER_H__
       
   143 
       
   144 // End of File