realtimenetprots/sipfw/SIP/SigCompController/DefaultPlugin/inc/sipsigcompcompartmentctx.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2005-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          : sipsigcompcompartmentctx.h
       
    16 * Part of       : SIPSigComp
       
    17 * Version       : SIP/4.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef __SIPSIGCOMPCOMPARTMENTCTX_H__
       
    29 #define __SIPSIGCOMPCOMPARTMENTCTX_H__
       
    30 
       
    31 #include <in_sock.h>
       
    32 #include <e32base.h>
       
    33 #include "sigcomp.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class MCompartmentCtxOwner;
       
    37 class MCompartmentCtxUser;
       
    38 
       
    39 
       
    40 // CLASS DEFINITION
       
    41 class CSipSigCompCompartmentCtx : public CBase
       
    42 {
       
    43 public: // Constructors and destructor
       
    44 
       
    45 	enum TState
       
    46 		{
       
    47 		EAlive = 100,
       
    48 		EIdle
       
    49 		};
       
    50 
       
    51 	static CSipSigCompCompartmentCtx* NewL( MCompartmentCtxOwner& aMyOwner,
       
    52 	                                        const CSigComp& aSigComp, 
       
    53 	                                        const TInetAddr& aAddress,
       
    54 								            TUint32 aIapId,
       
    55 								            TBool aDynamicCompression=ETrue );
       
    56 
       
    57 	
       
    58 
       
    59 	static CSipSigCompCompartmentCtx* NewLC( MCompartmentCtxOwner& aMyOwner,
       
    60 	                                         const CSigComp& aSigComp, 
       
    61 	                                         const TInetAddr& aAddress,
       
    62 								             TUint32 aIapId,
       
    63 								             TBool aDynamicCompression=ETrue );
       
    64 	
       
    65 
       
    66     ~CSipSigCompCompartmentCtx();
       
    67 
       
    68 public:
       
    69 
       
    70 	CSigCompCompartment* Compartment();
       
    71 
       
    72 	void AttachCompartmentUserL( MCompartmentCtxUser* aUser );
       
    73 	
       
    74 	void DetachCompartmentUser( MCompartmentCtxUser* aUser );
       
    75 
       
    76 	TBool Match( const TInetAddr& aAddress, TUint32 aIapId ) const;
       
    77 	
       
    78 	void SetCurrentState( CSipSigCompCompartmentCtx::TState aCurrentState );
       
    79 	
       
    80 	void SendFailedL();
       
    81 	
       
    82 	static const TInt iOffset;
       
    83 	
       
    84 protected: // 2nd phase constructor
       
    85 
       
    86 	void ConstructL();
       
    87 
       
    88 private:
       
    89 
       
    90 	CSipSigCompCompartmentCtx( MCompartmentCtxOwner& aMyOwner,
       
    91 	                           const CSigComp& aSigComp, 
       
    92 	                           const TInetAddr& aAddress,
       
    93 							   TUint32 aIapId,
       
    94     						   TBool aDynamicCompression );
       
    95     						   
       
    96     void NotifyUsersAboutSelfDestruction();
       
    97     
       
    98 	void ResetCompartmentL();
       
    99 
       
   100 private: // data
       
   101 
       
   102     TSglQueLink iLink;
       
   103     
       
   104 	MCompartmentCtxOwner& iMyOwner;
       
   105 	const CSigComp& iSigComp;
       
   106 	TInetAddr iAddress;
       
   107 	TUint32 iIapId;
       
   108 	TBool iDynamicCompression;
       
   109 	RPointerArray<MCompartmentCtxUser> iUserArray;
       
   110 	CSipSigCompCompartmentCtx::TState iCurrentState;
       
   111 	
       
   112 	CSigCompCompartment* iSigCompCompartment;
       
   113 	
       
   114 private: //For testing purposes
       
   115 #ifdef CPPUNIT_TEST	
       
   116 	friend class CSigCompTest;
       
   117 #endif
       
   118 };
       
   119 
       
   120 #endif // end of __SIPSIGCOMPCOMPARTMENTCTX_H__