mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemanager.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     1 /*
       
     2 * Copyright (c) 2005 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMCEMANAGER_H
       
    20 #define CMCEMANAGER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h> 
       
    24 #include <badesca.h>  
       
    25 //#include <mcedefs.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MMceInSessionObserver;
       
    29 class MMceInEventObserver;
       
    30 class MMceInReferObserver;
       
    31 class MMceSessionObserver;
       
    32 class MMceEventObserver;
       
    33 class MMceReferObserver;
       
    34 class MMceStreamObserver;
       
    35 class MMceRtpObserver;
       
    36 class CMceSession;
       
    37 class CMceEvent;
       
    38 class CMceRefer;
       
    39 class TMceMediaId;
       
    40 class CMceAudioCodec;
       
    41 class CMceVideoCodec;
       
    42 class TMceTransactionDataContainer;
       
    43 class CMusTestSessionSimulator;
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48 *  Class for connecting to MCE server.
       
    49 *
       
    50 *  This class provides the connection to the MCE server and
       
    51 *  provides functions for setting observers for asynchronous
       
    52 *  events.
       
    53 * 
       
    54 *  The user should create only one instance of this class.
       
    55 *
       
    56 * @lib mceclient.lib
       
    57 */
       
    58 class CMceManager : public CBase
       
    59 	{
       
    60 
       
    61 	public: // Constructors and destructor
       
    62 
       
    63 	    /**
       
    64 	    * Two-phased constructor.
       
    65 	    * @param aAppUid, uid of the application.
       
    66 	    * @param aContainer, if set, detailed data provided in observers.
       
    67 	    */
       
    68 		IMPORT_C static CMceManager* NewL(
       
    69 	                            	const TUid& aAppUid, 
       
    70 	                            	TMceTransactionDataContainer* aContainer = 0);
       
    71 
       
    72 	    /**
       
    73 	    * Destructor.
       
    74 	    */
       
    75 		IMPORT_C ~CMceManager();
       
    76 
       
    77 	public: // Functions
       
    78 
       
    79 	    /**
       
    80 	    * Set observer for incoming sessions.
       
    81 	    * @param aInSessionObserver, observer of the sessions.
       
    82 	    */
       
    83 		IMPORT_C void SetInSessionObserver( 
       
    84 		             MMceInSessionObserver* aInSessionObserver );
       
    85 		             
       
    86 	    /**
       
    87 	    * Set observer for incoming events.
       
    88 	    * @param aInEventObserver, observer of the events.
       
    89 	    */
       
    90 		IMPORT_C void SetInEventObserver( 
       
    91 		             MMceInEventObserver* aInEventObserver );
       
    92 		             
       
    93 	    /**
       
    94 	    * Set observer for incoming refers.
       
    95 	    * @param aInReferObserver, observer of the refers.
       
    96 	    */
       
    97 		IMPORT_C void SetInReferObserver( 
       
    98 		             MMceInReferObserver* aInReferObserver );
       
    99 		             
       
   100 	    /**
       
   101 	    * Set observer for sessions.
       
   102 	    * @param aSessionObserver, observer of the sessions.
       
   103 	    */
       
   104 		IMPORT_C void SetSessionObserver( 
       
   105 		             MMceSessionObserver* aSessionObserver );
       
   106 
       
   107 	    /**
       
   108 	    * Set observer for medias
       
   109 	    * @param aMediaObserver, observer of medias.
       
   110 	    */
       
   111 		IMPORT_C void SetMediaObserver( 
       
   112 		             MMceStreamObserver* aMediaObserver );
       
   113 
       
   114 	    /**
       
   115 	    * Set observer for rtp
       
   116 	    * @param aRtpObserver, observer of rtp
       
   117 	    */
       
   118 		IMPORT_C void SetRtpObserver( 
       
   119 		             MMceRtpObserver* aRtpObserver );
       
   120 
       
   121         /**
       
   122         * Sets observer for incoming events.
       
   123         * @param aEventObserver, observer of the event. Ownership is
       
   124 		*	     not transferred.
       
   125         */
       
   126 		IMPORT_C void SetEventObserver(
       
   127 					 MMceEventObserver* aEventObserver);
       
   128 					 
       
   129         /**
       
   130         * Sets observer for incoming REFER events.
       
   131         * @param aReferObserver, observer of the event. Ownership is
       
   132 		*	     not transferred.
       
   133         */
       
   134 		IMPORT_C void SetReferObserver(
       
   135 					 MMceReferObserver* aReferObserver);
       
   136 		
       
   137 	    /**
       
   138 	    * Gets currently ongoing sessions
       
   139 	    * @return RPointerArray array of sessions.
       
   140 	    */
       
   141 		IMPORT_C const RPointerArray< CMceSession >& Sessions() const;
       
   142 
       
   143         /**
       
   144         * Gets currently ongoing events
       
   145         * @return RPointerArray array of events.
       
   146         */
       
   147 		IMPORT_C const RPointerArray< CMceEvent >& Events() const;
       
   148 
       
   149         /**
       
   150         * Sets observer for incoming SUBSCRIBE events.
       
   151         * @param aObserver, observer of the event. Ownership is
       
   152 		*	     not transferred.
       
   153         */
       
   154 		IMPORT_C const RPointerArray< CMceRefer >& Refers() const;
       
   155 						
       
   156 	    /**
       
   157 	    * Returns supported audio codecs of the system.
       
   158 	    * @return supported audio codecs of the system.
       
   159 	    */
       
   160 	    IMPORT_C const RPointerArray<const CMceAudioCodec>& SupportedAudioCodecs() const;
       
   161 	    
       
   162 	    /**
       
   163 	    * Returns supported video codecs of the system.
       
   164 	    * @return supported video codecs of the system.
       
   165 	    */
       
   166 	    IMPORT_C const RPointerArray<const CMceVideoCodec>& SupportedVideoCodecs() const;
       
   167 	    
       
   168 	    /*
       
   169 		* Set default headers for the method. The headers will always be added
       
   170 		* to the given SIP methods unless overwritten with
       
   171 		* headers given as parameter for the API method triggering the 
       
   172 		* sending of request/response.
       
   173 		* @param aMethods, the SIP methods the headers are added to.
       
   174 		* @param aHeaders, the default headers, ownership is transferred.
       
   175 		*/
       
   176 		IMPORT_C void SetDefaultHeadersL( CDesC8Array* aMethods, CDesC8Array* aHeaders );
       
   177         
       
   178         /*
       
   179         * Get the default headers assigned for the given method.
       
   180         * If none is assigned, and empty array is returned.
       
   181         * @param aMethod, the method for which the headers are queried.
       
   182         * @return the default headers, ownership is transfered.
       
   183         */	    
       
   184 	    IMPORT_C CDesC8Array* DefaultHeadersL( const TDesC8& aMethod ) const;
       
   185 
       
   186 	    
       
   187 	public: // Functions
       
   188 
       
   189 	    /**
       
   190 	    * Gets observer for incoming sessions
       
   191 	    * @return incoming session observer
       
   192 	    */
       
   193 	    MMceInSessionObserver* InSessionObserver() const;
       
   194 	    
       
   195 	    /**
       
   196 	    * Gets session observer
       
   197 	    * @return session observer
       
   198 	    */
       
   199 	    MMceSessionObserver* SessionObserver() const;
       
   200 
       
   201 	    /**
       
   202 	    * Gets media observer
       
   203 	    * @return media observer
       
   204 	    */
       
   205 	    MMceStreamObserver* MediaObserver() const;
       
   206 
       
   207 	    /**
       
   208 	    * Gets rtp observer
       
   209 	    * @return rtp observer
       
   210 	    */
       
   211 	    MMceRtpObserver* RtpObserver() const;
       
   212 
       
   213 	    	    
       
   214         /**
       
   215         * Returs transaction container for detailed data. 
       
   216         * Returns NULL, if none exists.
       
   217         */
       
   218 		TMceTransactionDataContainer* TransactionContainer() const;        
       
   219 	    
       
   220 	private:
       
   221 
       
   222 	    /**
       
   223 	    * C++ default constructor.
       
   224 	    * @param aAppUid, uid of the application.
       
   225 	    * @param aContainer, if set, detailed data provided in observers.
       
   226 	    */
       
   227 	    CMceManager( const TUid& aAppUid, 
       
   228 	                 TMceTransactionDataContainer* aContainer = 0);
       
   229 
       
   230 	    /**
       
   231 	     * By default Symbian 2nd phase constructor is private.
       
   232 	     */
       
   233 	    void ConstructL();	
       
   234 	    
       
   235         
       
   236 	public: // Stub data
       
   237 
       
   238 	    /**
       
   239 	     * detailed callbacks wanted
       
   240 	     */
       
   241 	    TBool iDetailedCallbacks;    
       
   242 		
       
   243 	    /**
       
   244 	     * sessions
       
   245 	     */
       
   246 	    RPointerArray<CMceSession> iSessions;
       
   247         
       
   248 	    /**
       
   249 	     * supported audio codecs
       
   250 	     */
       
   251 	    RPointerArray<const CMceAudioCodec> iSupportedAudioCodecs;
       
   252 
       
   253         /**
       
   254 	     * supported audio codecs
       
   255 	     */
       
   256 	    RPointerArray<const CMceVideoCodec> iSupportedVideoCodecs;
       
   257 	
       
   258     	MMceSessionObserver* iSessionObserver;
       
   259 	    MMceStreamObserver* iMediaObserver;
       
   260 	    MMceRtpObserver* iRtpObserver;
       
   261 	    MMceInSessionObserver* iInSessionObserver;
       
   262 	    
       
   263         TMceTransactionDataContainer* iContainer;
       
   264         
       
   265 	private: // Data
       
   266 	        CMusTestSessionSimulator* iSessionSimulator; 
       
   267           
       
   268 	    friend class CMceSession;
       
   269 	};
       
   270 
       
   271 #endif