applayerprotocols/httptransportfw/Test/T_HttpIntegration/CEventDispatcher.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // $Header$
       
    15 // The header file introducing the basic event management control (active
       
    16 // objects) for our domain command supprt.
       
    17 // based loosely on the WSP version...
       
    18 // Note: you must derive from this for the domain you require, providing the
       
    19 // appropriate callbacks - this way reuse and oo is maintained.
       
    20 // 
       
    21 //
       
    22 
       
    23 #ifndef __CEVENTDISPATCHER_H__
       
    24 #define __CEVENTDISPATCHER_H__
       
    25 
       
    26 //-----------------------------------------------------------------------------
       
    27 //  Include Files  
       
    28 
       
    29 #include <e32base.h>
       
    30 
       
    31 //-----------------------------------------------------------------------------
       
    32 
       
    33 #include "MTimeoutCallback.h"
       
    34 #include "MHTTPEventCallback.h"
       
    35 
       
    36 //-----------------------------------------------------------------------------
       
    37 
       
    38 class CTimeoutTimer;
       
    39 
       
    40 //-----------------------------------------------------------------------------
       
    41 
       
    42 class CEventDispatcher : public CActive, 
       
    43 												 public MTimeoutCallback
       
    44 {
       
    45 public:	// Methods
       
    46 
       
    47 	static CEventDispatcher *NewL(MHTTPEventCallback &aCallback);
       
    48 	~CEventDispatcher();
       
    49 
       
    50 	virtual void WaitForHTTPEvent(RHTTPSession *aObj, TInt aTimeoutValueSeconds);
       
    51 	virtual void CancelWait();
       
    52 
       
    53 
       
    54 private:	// Methods from CActive
       
    55 
       
    56 	virtual void RunL();
       
    57 	virtual void DoCancel();
       
    58 
       
    59 private:	// Methods from MTimeoutCallback
       
    60 
       
    61 	virtual void Timeout();
       
    62 
       
    63 private:	// Methods
       
    64 
       
    65 	CEventDispatcher(MHTTPEventCallback & aCallback);
       
    66 	void ConstructL();
       
    67 
       
    68 private:	// Attributes
       
    69 
       
    70 	CTimeoutTimer *iTimer;
       
    71 	MHTTPEventCallback &iCallback;
       
    72 	THTTPEvent iEvent;
       
    73 	RHTTPSession *iSession;
       
    74 	RHTTPTransaction *iTransaction;
       
    75 };
       
    76 
       
    77 #endif	// __CEVENTDISPATCHER_H__