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