mmsharing/mmshavailability/inc/musavasip.h
changeset 0 f0cf47e981f9
child 22 73a1feb507fb
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  This is client interface class for SIP-server 
       
    15 *  Version     : %version: 23 % << Don't touch! Updated by Synergy at check-out.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __MUSAVASIP_H__
       
    21 #define __MUSAVASIP_H__
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 #include "musunittesting.h"
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <sip.h>
       
    29 
       
    30 class CMusAvaSipConnectionObserver;
       
    31 class CMusAvaSipObserver;
       
    32 class CMusAvaSipProfileRegistryObserver;
       
    33 class CSIP;
       
    34 class CSIPProfile;
       
    35 class CSIPProfileRegistry;
       
    36 class MMusAvaSipConnectionAdapter;
       
    37 class MMusAvaSipProfileRegistryAdapter;
       
    38 class MSIPConnectionObserver;
       
    39 class MMusAvaSipAdapter;
       
    40 class CSIPProfileRegistryBase;
       
    41 class CMusAvaClientResolverUtil;
       
    42 
       
    43 /**
       
    44  *  CMusAvaSip class represent the interface for module fetcher.
       
    45  *
       
    46  *  This interface class encapsulates module selection for availability Plug-in.
       
    47  *
       
    48  *  @lib musavailabilityplugin.lib
       
    49 
       
    50  */
       
    51 
       
    52 class CMusAvaSip : public CBase
       
    53 	{
       
    54 public:
       
    55    
       
    56    	/**
       
    57      * Two-phased constructor
       
    58      *
       
    59      * @since S60 v3.2
       
    60      * @param aCMusAvaSharedObj Pointer to CMusAvaSharedObject
       
    61      * @return Returns pointer to CMusAvaSip object
       
    62      */
       
    63 	static CMusAvaSip* NewL();
       
    64 	
       
    65 	/**
       
    66      * Destructor
       
    67      *
       
    68 
       
    69      * @param 
       
    70      * @return 
       
    71      */
       
    72 
       
    73 	~CMusAvaSip();
       
    74 	
       
    75 	protected:
       
    76 	
       
    77 	/**
       
    78      * Constructor
       
    79      *
       
    80      * @since S60 v3.2
       
    81      * @param aCMusAvaSharedObj Pointer to CMusAvaSharedObject
       
    82      * @return 
       
    83      */
       
    84 
       
    85 	CMusAvaSip();
       
    86 	
       
    87     /**
       
    88      * Perform the second phase construction of a
       
    89      *             CMusAvaSip object
       
    90      *
       
    91      * @since S60 v3.2
       
    92      * @param 
       
    93      * @return 
       
    94      */
       
    95 
       
    96 	void ConstructL();
       
    97 	
       
    98 public:
       
    99     /**
       
   100      *  
       
   101      *
       
   102 	 * @param 
       
   103      */
       
   104     void AddAdapterL( MMusAvaSipProfileRegistryAdapter& aAdapter );
       
   105 
       
   106     /**
       
   107      *  
       
   108      *
       
   109 	 * @param 
       
   110      */
       
   111     void RemoveAdapter( MMusAvaSipProfileRegistryAdapter& aAdapter );	 
       
   112 
       
   113     /**
       
   114      *  
       
   115      *
       
   116 	 * @param 
       
   117      */
       
   118     void AddAdapterL( MMusAvaSipConnectionAdapter& aAdapter, TInt aIndex = KErrNotFound );
       
   119 
       
   120 	 /**
       
   121      * Returns CSip object 
       
   122      *
       
   123 	 * @param 
       
   124      */
       
   125     void RemoveAdapter( MMusAvaSipConnectionAdapter& aAdapter );
       
   126 	
       
   127     /**
       
   128      *  
       
   129      *
       
   130 	 * @param 
       
   131      */
       
   132     void AddAdapterL( MMusAvaSipAdapter& aAdapter, TInt aIndex = KErrNotFound  );
       
   133 
       
   134 	 /**
       
   135      * Returns CSip object. 
       
   136      *
       
   137 	 * @param 
       
   138      */
       
   139     void RemoveAdapter( MMusAvaSipAdapter& aAdapter );
       
   140 
       
   141 public:	 
       
   142 
       
   143 	/**
       
   144      * Returns CSIPConnection object. 
       
   145      * Ownership is not transferred.
       
   146      * @param aForceCreation, ETrue if connection should be created
       
   147      * if it does not exists yet.
       
   148 	 * @return referense to Sip Object.
       
   149      */
       
   150 	CSIPConnection* ConnectionL( TBool aForceCreation = ETrue );
       
   151 
       
   152 	 /**
       
   153      * Returns CSIPConnection object .
       
   154      * Ownership is not transferred.
       
   155      *
       
   156 	 * @return referense to Sip Object.
       
   157      */
       
   158 	MSIPConnectionObserver& ConnectionObserver();
       
   159     	
       
   160 	 /**
       
   161      * Create Profile object.
       
   162      * 
       
   163 	 * return EFalse if Profile was not created, 
       
   164 	 * ETrue otherwise.
       
   165      */
       
   166      TBool CreateProfileL();
       
   167      
       
   168      /**
       
   169      * Create CSIPProfile object.
       
   170      * 
       
   171 	 * return EFalse if CSIPProfile was not created, 
       
   172 	 * ETrue otherwise.
       
   173      */
       
   174      TBool CreateSipProfile();
       
   175     	
       
   176 	 /**
       
   177      * Returns CSIPProfile object.
       
   178      * Ownership is not transferred.
       
   179      *
       
   180      * @since  S60 v3.2
       
   181 	 * @return referense to Sip Object.
       
   182      */
       
   183     CSIPProfile* Profile();
       
   184 
       
   185 	 /**
       
   186      * Returns CSIPProfileRegistry object.
       
   187      * Ownership is not transferred.
       
   188      *
       
   189 	 * @return reference to Sip Object.
       
   190      */
       
   191     CSIPProfileRegistry& ProfileRegistryL();
       
   192 	
       
   193 	 /**
       
   194      * Returns a buffer containing the own domain, if profile registered.
       
   195      * Ownership is transferred.
       
   196      *
       
   197 	 * @return Pointer to a buffer containing the own domain name.
       
   198      */
       
   199     HBufC* OwnDomainLC();
       
   200     
       
   201     /**
       
   202      * Returns CSip object 
       
   203      * Ownership is not transferred.
       
   204      *
       
   205 	 * @return reference to Sip Object.
       
   206      */
       
   207     CSIP& Sip();
       
   208     
       
   209     /**
       
   210      * Returns SipProfileId 
       
   211      *
       
   212 	 * @param aSipProfileId on return will contain SipProfileId value
       
   213      * @return KErrNotFound if parameter was not found, KErrNone otherwise.
       
   214      */
       
   215     TInt SipProfileId( TUint32& aSipProfileId );
       
   216     
       
   217     /**
       
   218      * Returns a pointer to utility object that handles special client resolving 
       
   219      * in __VOIP enabled terminals. In __VOIP disabled terminals this will 
       
   220      * return a NULL pointer. This function does not transfer ownership.
       
   221      *
       
   222      * @return Pointer to resolver utility object. Make sure to be prepared 
       
   223      *         that this pointer is NULL.
       
   224      */
       
   225     CMusAvaClientResolverUtil* ClientResolverUtil() const;
       
   226     
       
   227     /**
       
   228     * Deletes unnecessary CSIPConnection   
       
   229     */
       
   230     void DeleteSIPConnection();
       
   231 
       
   232 
       
   233 private:
       
   234 	
       
   235 	 /**
       
   236      * Create SIPConnection object.
       
   237      * 
       
   238      */  
       
   239 	void CreateSIPConnectionL();
       
   240         
       
   241     /**
       
   242      * Gets profile to be used with Mus.
       
   243      *
       
   244      * @param Reference to used profile registry.
       
   245      * @return Pointer to profile meant to be used with Mus. If not possible,
       
   246      *         returns poiner to default profile.  Ownership is transferred.
       
   247      * @leave KErrNotFound if not able to return even default profile.
       
   248      */		
       
   249     CSIPProfile* GetMusProfileL( CSIPProfileRegistryBase& aRegistry );
       
   250     
       
   251     
       
   252 private:
       
   253         
       
   254      /**
       
   255      * Pointer to CSIP object.
       
   256      * Owns.
       
   257      */
       
   258 	 CSIP* iSip;
       
   259 	 
       
   260      /**
       
   261       * 
       
   262       * Owns.
       
   263       */
       
   264 	 CSIPConnection* iSipConnection;
       
   265 	 
       
   266      /**
       
   267       *
       
   268       * Owns.
       
   269       */
       
   270      CSIPProfile* iSipProfile;
       
   271      
       
   272      /**
       
   273       *
       
   274       * Owns.
       
   275       */
       
   276      CSIPProfileRegistry* iSipProfileRegistry;
       
   277 
       
   278      /**
       
   279      * Pointer to CMusAvaSipObserver object.
       
   280      * Owns.
       
   281      */
       
   282      CMusAvaSipObserver* iSipObserver;
       
   283      
       
   284      /**
       
   285      * Pointer to CMusAvaSipConnectionObserver object
       
   286      * Owns.
       
   287      */
       
   288      CMusAvaSipConnectionObserver* iSipConnectionObserver;
       
   289      
       
   290      /**
       
   291      * Pointer to CMusAvaSipProfileRegistryObserver object
       
   292      * Owns.
       
   293      */
       
   294      CMusAvaSipProfileRegistryObserver* iSipProfileRegistryObserver;
       
   295      
       
   296      /**
       
   297      * Pointer to utility object that handles special client resolving in
       
   298      * __VOIP enabled terminals. In __VOIP disabled terminals creation of
       
   299      * this object will fail because of missing UID in CenRep and thus this 
       
   300      * pointer can be NULL. If this object does not exist, standard client
       
   301      * resolving will be used.
       
   302      */
       
   303      CMusAvaClientResolverUtil* iClientResolverUtil;
       
   304      
       
   305      TUint32 iIapId;
       
   306      
       
   307      MUS_UNITTEST( UT_CMusAvaOptionHandler )
       
   308      MUS_UNITTEST( UT_CMusAvaSip )
       
   309      MUS_UNITTEST( UT_CMusAvaRegisterAvailability )
       
   310      MUS_UNITTEST( UT_CMusAvaConnectionMonitor )
       
   311      MUS_UNITTEST( UT_CMusAvaCapabilitySipAgent )
       
   312      MUS_UNITTEST( UT_CMusAvaCapabilityExchange )
       
   313 	};
       
   314 
       
   315 #endif
       
   316