realtimenetprots/sipfw/SIP/Dialogs/src/CSigCompMgr.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          : CSigCompMgr.h
       
    16 * Part of       : Dialogs
       
    17 * Version       : SIP/4.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 
       
    29 #ifndef CSIGCOMPMGR_H
       
    30 #define CSIGCOMPMGR_H
       
    31 
       
    32 #include <e32base.h>
       
    33 #include <stringpool.h>
       
    34 #include "_sipcodecdefs.h"
       
    35 
       
    36 class MSigComp;
       
    37 class CURIContainer;
       
    38 class CSIPURI;
       
    39 class CSIPRouteHeader;
       
    40 
       
    41 
       
    42 /**
       
    43  * @brief Class for using and unusing signalling compression
       
    44  *
       
    45  */
       
    46 class CSigCompMgr : public CBase
       
    47 	{
       
    48 public:
       
    49 
       
    50 	/**
       
    51 	 * Creates a new CSigCompMgr instance
       
    52 	 * @returns a new instance of CSigCompMgr
       
    53 	 */
       
    54     static CSigCompMgr* NewL (TUint32 aIapId,
       
    55                               MSigComp& aSigComp);
       
    56 
       
    57 	/**
       
    58 	 * Creates a new CSigCompMgr instance and pushes it to CleanupStack
       
    59 	 * @returns a new instance of CSigCompMgr
       
    60 	 */
       
    61     static CSigCompMgr* NewLC (TUint32 aIapId,
       
    62                                MSigComp& aSigComp);
       
    63 
       
    64 	/**
       
    65 	 * Destructor
       
    66 	 */
       
    67     ~CSigCompMgr();
       
    68 
       
    69 	/**
       
    70 	 * Updates the compression information. This might lead into
       
    71      * deleting a used compartment or/and creation of a new one. 
       
    72 	 * @param aRemoteTarget the URI in the remote Contact
       
    73      * @param aRouteSet the dialog's current Route-set.
       
    74 	 * @param aLocalTarget the local target of the dialog.
       
    75 	 *        If not zero and compression is used contains 
       
    76 	 *        on return comp=sigcomp parameter.
       
    77 	 *        If not zero and compression is not used
       
    78 	 *        comp=sigcomp parameter is removed.
       
    79      */
       
    80     void UpdateL (const CURIContainer& aRemoteTarget,
       
    81                   const RPointerArray<CSIPRouteHeader>& aRouteSet,
       
    82 				  CSIPURI& aLocalTarget,
       
    83 				  TBool aUpdateLocalTarget=ETrue);
       
    84 	
       
    85 	/**
       
    86 	 * Gets the current compartment id
       
    87 	 * @returns zero if no compartment is used. Otherwise the compartment id.
       
    88 	 */	
       
    89 	TUint32 CompartmentId() const;
       
    90 
       
    91 private:
       
    92 
       
    93 	CSigCompMgr (TUint32 aIapId, MSigComp& aSigComp);
       
    94 
       
    95     TBool HasSigCompParameter (const CSIPURI& aURI) const;
       
    96     void UpdateL (const CSIPURI& aURI);
       
    97 	
       
    98 private: // Data
       
    99 	
       
   100     TUint32 iIapId;
       
   101     MSigComp& iSigComp;
       
   102 	RStringF iCompParamName;
       
   103 	RStringF iSigCompValue;
       
   104     TUint32 iCompartmentId;
       
   105 
       
   106 private: // For testing purposes
       
   107 
       
   108 	UNIT_TEST(CSigCompMgrTest)
       
   109 	};
       
   110 
       
   111 #endif // CSIGCOMPMGR_H
       
   112 
       
   113 // End of File