mmsharing/mmshavailability/inc/musavasip.h
changeset 22 496ad160a278
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     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: 24 % << 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 private:
       
   229 	
       
   230 	 /**
       
   231      * Create SIPConnection object.
       
   232      * 
       
   233      */  
       
   234 	void CreateSIPConnectionL();
       
   235         
       
   236     /**
       
   237      * Gets profile to be used with Mus.
       
   238      *
       
   239      * @param Reference to used profile registry.
       
   240      * @return Pointer to profile meant to be used with Mus. If not possible,
       
   241      *         returns poiner to default profile.  Ownership is transferred.
       
   242      * @leave KErrNotFound if not able to return even default profile.
       
   243      */		
       
   244     CSIPProfile* GetMusProfileL( CSIPProfileRegistryBase& aRegistry );
       
   245     
       
   246     
       
   247 private:
       
   248         
       
   249      /**
       
   250      * Pointer to CSIP object.
       
   251      * Owns.
       
   252      */
       
   253 	 CSIP* iSip;
       
   254 	 
       
   255      /**
       
   256       * 
       
   257       * Owns.
       
   258       */
       
   259 	 CSIPConnection* iSipConnection;
       
   260 	 
       
   261      /**
       
   262       *
       
   263       * Owns.
       
   264       */
       
   265      CSIPProfile* iSipProfile;
       
   266      
       
   267      /**
       
   268       *
       
   269       * Owns.
       
   270       */
       
   271      CSIPProfileRegistry* iSipProfileRegistry;
       
   272 
       
   273      /**
       
   274      * Pointer to CMusAvaSipObserver object.
       
   275      * Owns.
       
   276      */
       
   277      CMusAvaSipObserver* iSipObserver;
       
   278      
       
   279      /**
       
   280      * Pointer to CMusAvaSipConnectionObserver object
       
   281      * Owns.
       
   282      */
       
   283      CMusAvaSipConnectionObserver* iSipConnectionObserver;
       
   284      
       
   285      /**
       
   286      * Pointer to CMusAvaSipProfileRegistryObserver object
       
   287      * Owns.
       
   288      */
       
   289      CMusAvaSipProfileRegistryObserver* iSipProfileRegistryObserver;
       
   290      
       
   291      /**
       
   292      * Pointer to utility object that handles special client resolving in
       
   293      * __VOIP enabled terminals. In __VOIP disabled terminals creation of
       
   294      * this object will fail because of missing UID in CenRep and thus this 
       
   295      * pointer can be NULL. If this object does not exist, standard client
       
   296      * resolving will be used.
       
   297      */
       
   298      CMusAvaClientResolverUtil* iClientResolverUtil;
       
   299      
       
   300      TUint32 iIapId;
       
   301      
       
   302      MUS_UNITTEST( UT_CMusAvaOptionHandler )
       
   303      MUS_UNITTEST( UT_CMusAvaSip )
       
   304      MUS_UNITTEST( UT_CMusAvaRegisterAvailability )
       
   305      MUS_UNITTEST( UT_CMusAvaConnectionMonitor )
       
   306      MUS_UNITTEST( UT_CMusAvaCapabilitySipAgent )
       
   307      MUS_UNITTEST( UT_CMusAvaCapabilityExchange )
       
   308 	};
       
   309 
       
   310 #endif
       
   311