realtimenetprots/sipfw/SIP/ConnectionMgr/inc/CSender.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004-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          : CSender.h
       
    16 * Part of       : ConnectionMgr
       
    17 * Version       : SIP/4.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef __CSENDER_H__
       
    29 #define __CSENDER_H__
       
    30 
       
    31 #include <e32base.h>
       
    32 #include "COutgoingData.h"
       
    33 #include "MContext.h"
       
    34 #include "TSIPTransportParams.h"
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 //
       
    38 class COwnerSettingsList;
       
    39 
       
    40 // CLASS DEFINITION
       
    41 //
       
    42 class CSender : public CActive
       
    43 	{
       
    44 public:
       
    45 
       
    46 	virtual ~CSender ();
       
    47 
       
    48 	static TUint IpAddrType( const TInetAddr& aAddr );
       
    49 	virtual TBool SendL (const TSIPTransportParams& aTransportParams,
       
    50 	                     CSIPMessage& aMessage,
       
    51 		                 const TInetAddr& aAddr,
       
    52 						 TUint aOrigTransport,
       
    53 						 TRequestStatus& aStat,
       
    54 						 TBool aStore,
       
    55 						 TBool aForceUDP) = 0;
       
    56 
       
    57 	virtual void SendNextL () = 0;
       
    58 
       
    59 	virtual void SendL (const TSIPTransportParams& aTransportParams,
       
    60 	                    CSIPMessage& aMessage,
       
    61 		                TRequestStatus& aStat);
       
    62 
       
    63 	virtual void SendL (COutgoingData* aData);
       
    64 
       
    65 	virtual COutgoingData* StoredData ();
       
    66 	
       
    67 	virtual COutgoingData* Data ();
       
    68 
       
    69 	TBool FindAndCancel (TRequestStatus& aStat);
       
    70 
       
    71 	void CancelAllRequests (TInt aReason);
       
    72 
       
    73     static void CleanCurrentDataOnLeave( TAny* aSelf );
       
    74 	
       
    75 protected:
       
    76 
       
    77 	CSender (MContext& aContext,COwnerSettingsList& aSettingsList);
       
    78 
       
    79     COutgoingData* CurrentData();
       
    80 
       
    81 	void WriteToLog (const TDesC8& aMessage);  
       
    82     
       
    83 protected:	//Data
       
    84 
       
    85     MContext& iContext;
       
    86     COwnerSettingsList& iSettingsList;
       
    87 	TPtrC8 iOutgoingMessage;
       
    88 	TSglQue<COutgoingData> iList;
       
    89 	TSglQueIter<COutgoingData> iListIter;
       
    90 	TBool iContinueSending;
       
    91 
       
    92 private:
       
    93 
       
    94 	void RunL ();
       
    95 	void DoCancel ();
       
    96 	TInt RunError (TInt aError);
       
    97 	void RemoveCurrentData(TInt aReason);
       
    98 	void CompleteRequest (TRequestStatus* aStatus, TInt aReason);
       
    99 
       
   100 private: //For testing purposes
       
   101 #ifdef CPPUNIT_TEST
       
   102 	friend class CSenderTest;
       
   103 	friend class CServerTest;
       
   104 #endif
       
   105 	};
       
   106 
       
   107 #endif // end of __CSENDER_H__
       
   108 
       
   109 // End of File