mmsharing/mmshavailability/inc/musavaconnectionmonitor.h
changeset 0 f0cf47e981f9
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:  Provide interface for the client requestin network availability.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __MUSAVACONNECTIONMONITOR_H__
       
    20 #define __MUSAVACONNECTIONMONITOR_H__
       
    21 
       
    22 #include "musavaavailability.h"
       
    23 #include "musunittesting.h"
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <rconnmon.h>
       
    27 #include <sipprofileregistryobserver.h>
       
    28 
       
    29 
       
    30 class MMusAvaAvailabilityObserver;
       
    31 class MMusAvaObserver;
       
    32 class CMusAvaSharedObject;
       
    33 class CMusAvaPhoneStatus;
       
    34 class CConnMonEventBase;
       
    35 class MMusAvaConnectionMonitorObserver;
       
    36 
       
    37 /**
       
    38  *  Implemets register vailability. 
       
    39  *
       
    40  *  Provide interface for the client to availability class.
       
    41  *
       
    42  *  @lib musavailabilityplugin.lib
       
    43  *  @since S60 v3.2
       
    44  */
       
    45 
       
    46  
       
    47 
       
    48 class CMusAvaConnectionMonitor : public CBase,
       
    49                                  public MConnectionMonitorObserver
       
    50 	{
       
    51 	public:
       
    52 	/**
       
    53      * Two-phased constructor
       
    54      *
       
    55      * @since S60 v3.2
       
    56      * @param aSharedObject reference to CMusAvaSharedObject
       
    57      * @return Returns pointer to CMusAvaInterface object
       
    58      */
       
    59      
       
    60 	static CMusAvaConnectionMonitor* NewL( CMusAvaSharedObject& aSharedObject );
       
    61 	
       
    62 	/**
       
    63      * Destructor
       
    64      *
       
    65      * @since S60 v3.2
       
    66      * @param 
       
    67      * @return 
       
    68      */
       
    69 
       
    70     ~CMusAvaConnectionMonitor();
       
    71 	
       
    72 	protected:
       
    73 	
       
    74 	/**
       
    75      * Constructor
       
    76      *
       
    77      * @since S60 v3.2
       
    78      * @param aSharedObject reference to CMusAvaSharedObject
       
    79      * @return 
       
    80      */
       
    81 
       
    82 	CMusAvaConnectionMonitor( CMusAvaSharedObject& aSharedObject );
       
    83 	
       
    84 	                                        
       
    85 	
       
    86 	/**
       
    87      * Perform the second phase construction of a
       
    88      *             CMusAvaConnectionMonitor object
       
    89      *
       
    90      * @since S60 v3.2
       
    91      * @param 
       
    92      * @return 
       
    93      */
       
    94 
       
    95 	void ConstructL();
       
    96 	
       
    97 public: // from MConnectionMonitorObserver 
       
    98 	
       
    99 	/**
       
   100 	 * Event from connection monitor server
       
   101 	 *
       
   102 	 */   
       
   103     void EventL(const CConnMonEventBase& aConnMonEvent); 
       
   104     
       
   105 public:
       
   106 
       
   107     /**
       
   108      *  
       
   109      *
       
   110      * @since  S60 v3.2
       
   111 	 * @param 
       
   112      */
       
   113     void AddAdapterL( MMusAvaConnectionMonitorObserver& aAdapter );
       
   114 	  
       
   115     /**
       
   116 	 * Test Current bearer type 
       
   117 	 *
       
   118 	 * @since S60 v3.2
       
   119      * @return ETrue if bearer type is activated, 
       
   120      * EFalse otherwise
       
   121 	 */
       
   122     TBool BearerType( TInt aBearer  = EBearerWCDMA );
       
   123     
       
   124 
       
   125 	/**
       
   126 	 * Created connection ID for multimedia sharing is returned 
       
   127 	 *
       
   128 	 * @since S60 v3.2
       
   129      * @return KErrNone if parameter was not found, 
       
   130      * Connection ID otherwise
       
   131 	 */
       
   132 	TUint CreatedConnectionID();
       
   133    
       
   134 
       
   135 	/**
       
   136 	 * Store connection ID  
       
   137 	 *
       
   138 	 * @since S60 v3.2
       
   139 	 */
       
   140 	void SetConnectionID( TUint aConnectionID );
       
   141    
       
   142      /**
       
   143 	 * Active connection ID for multimedia sharing is returned. 
       
   144 	 *
       
   145 	 * @since S60 v3.2
       
   146      * @return KErrNotFound if parameter was not found, 
       
   147      * Connection ID otherwise
       
   148 	 */
       
   149     TUint ConnectionIDL();
       
   150   
       
   151     /**
       
   152      *  
       
   153      *
       
   154      * @since  S60 v3.2
       
   155 	 * @param 
       
   156      */
       
   157      TBool KillPdpContext();
       
   158       
       
   159      /**
       
   160      *  
       
   161      *
       
   162      * @since  S60 v3.2
       
   163 	 * @param 
       
   164      */
       
   165     void RemoveAdapter( MMusAvaConnectionMonitorObserver& aAdapter );
       
   166     
       
   167     /**
       
   168      *  
       
   169      *
       
   170      * @since  S60 v3.2
       
   171 	 * @param 
       
   172      */
       
   173     void NotifyEventL();
       
   174     
       
   175     /**
       
   176 	 * Active connection count for multimedia sharing is returned. 
       
   177 	 *
       
   178 	 * @since S60 v3.2
       
   179      * @return KErrNotFound if parameter was not found, 
       
   180      * Connection count otherwise
       
   181 	 */
       
   182 	 
       
   183     TUint ConnectionCount();
       
   184    
       
   185 	 /**
       
   186 	 * Active Access Point ID for multimedia sharing is returned 
       
   187 	 *
       
   188 	 * @since S60 v3.2
       
   189      * @return KErrNotFound if parameter was not found, 
       
   190      * Access Point ID otherwise
       
   191 	 */
       
   192     TUint MultimediaSharingAccessPointID();
       
   193     
       
   194 private:
       
   195     
       
   196     
       
   197     /**
       
   198      * Session to connection monitor server
       
   199      */ 
       
   200     RConnectionMonitor iConnectionMonitor;
       
   201      
       
   202      /**
       
   203      * Array of MMusAvaConnectionMonitorObserver instances
       
   204      */
       
   205     RPointerArray<MMusAvaConnectionMonitorObserver> iConnectionMonitorObserver;
       
   206     
       
   207      /**
       
   208      * Pointer to CMusAvaSharedObject
       
   209      */ 
       
   210     CMusAvaSharedObject* iSharedObj;
       
   211     
       
   212      /**
       
   213      * Connection ID
       
   214      */
       
   215     TUint iConnectionID;
       
   216     
       
   217     /**
       
   218      * Profile ID
       
   219      */
       
   220     TUint32 iProfileId;
       
   221     
       
   222     MUS_UNITTEST( UT_CMusAvaConnectionMonitor )
       
   223     MUS_UNITTEST( UT_CMusAvaConnectionAvailability )
       
   224     };
       
   225 
       
   226 
       
   227 #endif // __MUSAVACONNECTIONMONITOR_H__