realtimenetprots/sipfw/ProfileAgent/Client/Inc/SIPProfileITCReceiver.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2003-2009 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 * Name        : sipprofileitcreceiver.h
       
    16 * Part of     : SIP Profile Client
       
    17 * Interface   : private
       
    18 * The class to receive asyncronous ITC events
       
    19 * Version     : 1.0
       
    20 *
       
    21 */
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 /**
       
    27  @internalComponent
       
    28 */
       
    29 
       
    30 #ifndef CSIPPROFILEITCRECEIVER_H
       
    31 #define CSIPPROFILEITCRECEIVER_H
       
    32 
       
    33 //  INCLUDES
       
    34 
       
    35 #include <e32base.h>
       
    36 #include <s32mem.h>
       
    37 #include "sipprofilecs.h"
       
    38 #include "sipprofileslots.h"
       
    39 
       
    40 // FORWARD DECLARATIONS
       
    41 
       
    42 class RSIPProfile;
       
    43 class MSIPConcreteProfileObserver;
       
    44 class MSipProfileAlrObserver;
       
    45 
       
    46 // CLASS DECLARATION
       
    47 
       
    48 /**
       
    49 *  The class is active object that receives asyncronous events from server
       
    50 *
       
    51 *  @lib sipprofilecli.lib
       
    52 */
       
    53 class CSIPProfileITCReceiver: public CActive
       
    54 	{
       
    55 	public:
       
    56 
       
    57 	    /**
       
    58         * Two-phased constructor.
       
    59 		* @param aSip a client providing connection to SIP profile server.
       
    60 		* @param aObserver observer that events are transferred to 
       
    61 		* @return new instance
       
    62         */
       
    63 		static CSIPProfileITCReceiver* NewL(
       
    64 			RSIPProfile& aSipProfile, MSIPConcreteProfileObserver& aObserver);
       
    65 
       
    66 	    /**
       
    67         * Two-phased constructor.
       
    68 		* @param aSip a client providing connection to SIP profile server.
       
    69 		* @param aObserver observer that events are transferred to 
       
    70 		* @return new instance
       
    71         */
       
    72 		static CSIPProfileITCReceiver* NewLC(
       
    73 			RSIPProfile& aSipProfile, MSIPConcreteProfileObserver& aObserver);
       
    74 
       
    75 	    /**
       
    76         * Destructor.
       
    77         */
       
    78 		~CSIPProfileITCReceiver();
       
    79 		
       
    80 	public: // New functions
       
    81 		
       
    82 		/**
       
    83         * Sets the observer for ALR events. 
       
    84 		* @param aAlrObserver observer that ALR events 
       
    85 		* are transferred to.
       
    86 		* @return KErrAlreadyExists if iAlrObserver already 
       
    87 		* exists, else KErrNone.
       
    88         */
       
    89 		TInt SetALRObserver(MSipProfileAlrObserver* aALRObserver);
       
    90 
       
    91 	private:
       
    92 	
       
    93 	    /**
       
    94         * Constructor.
       
    95 		* @param aSip a client providing connection to SIP profile server.
       
    96 		* @param aObserver observer that events are transferred to 
       
    97         */
       
    98 		CSIPProfileITCReceiver(
       
    99 			RSIPProfile& aSipProfile, MSIPConcreteProfileObserver& aObserver);
       
   100 
       
   101 	    /**
       
   102         * Symbian 2nd phase constructor.
       
   103         */
       
   104 		void ConstructL();
       
   105 
       
   106 	    /**
       
   107         * Method that is being called when event occurs
       
   108         */
       
   109 		void Receive();
       
   110 
       
   111 	    /**
       
   112         * Method that is being called when event occurs
       
   113 		* @param aIds class holding event data
       
   114         */
       
   115 		void IncomingEventL(TSIPProfileSlots& aIds);
       
   116 
       
   117 	    /**
       
   118         * Method that is being called when failure event occurs
       
   119 		* @param aError error id
       
   120 		* @param aIds class holding event data
       
   121 		*/
       
   122 		void ErrorOccuredL(TInt aError, TSIPProfileSlots& aIds);
       
   123 
       
   124 	private:
       
   125 
       
   126 		// From CActive:
       
   127 		void RunL();
       
   128 
       
   129 		// From CActive:
       
   130 		TInt RunError(TInt aError);
       
   131 
       
   132 		// From CActive:
       
   133 		void DoCancel();
       
   134 
       
   135 	private:
       
   136 
       
   137 		RSIPProfile& iSip;
       
   138 		MSIPConcreteProfileObserver& iObserver; 
       
   139 		TIpcArgs                      iITCMsgArgs;
       
   140 		TPckgBuf<TSIPProfileSlots>    iIdsPckg;
       
   141 		MSipProfileAlrObserver* 	  iALRObserver;
       
   142 		
       
   143 	private: // The unit test class declared as a friend
       
   144 #ifdef CPPUNIT_TEST
       
   145 	friend class CSIPProfileITCReceiverTest;	
       
   146 #endif
       
   147 	
       
   148 	};
       
   149 
       
   150 #endif