os/mm/devsoundextensions/telephonyaudiorouting/Session/inc/TelephonyAudioRoutingSession.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2002-2004 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 class is the main interface to the TelephonyAudioRoutingServer. 
    15 *				 It implements the client-side session.
    16 *
    17 */
    18 
    19                                       
    20                                                                                  
    21 #ifndef TELEPHONYAUDIOROUTINGSESSION_H                                                
    22 #define TELEPHONYAUDIOROUTINGSESSION_H                                                  
    23                                                                                  
    24 #include <e32base.h>
    25 #include <e32std.h>     
    26 #include "TelephonyAudioRouting.h" 
    27 #include "MTelephonyAudioRoutingPolicyObserver.h"
    28 #include "TelephonyAudioRoutingClientServer.h"
    29   
    30   
    31 class CTelephonyAudioRoutingRequest;
    32 class CTelephonyAudioRoutingManager;
    33 
    34 // CLASS DECLARATION
    35 
    36 /**
    37 *  Main interface to the TelephonyAudioRoutingServer. 
    38 *  It implements the client-side session.
    39 *
    40 *  @lib TelephonyAudioRoutingSession.lib
    41 *  @since Series 60 3.1
    42 */                                     
    43                                                                               
    44 class RTelephonyAudioRoutingSession : public RSessionBase                                   
    45     { 
    46                                                                                
    47 	public:                                                                          
    48                                                                         
    49     	IMPORT_C RTelephonyAudioRoutingSession();    
    50     
    51     public:                                                    
    52          
    53         /**
    54         * Connects a client to the  server.
    55         * @since Series 60 3.1
    56         * @param aAudioRouting obj: client obj, aObserver: Client's observer class
    57         * @return TInt connection success or failure
    58         */                                                                        
    59     	IMPORT_C TInt ConnectL(CTelephonyAudioRouting& aAudioRouting, MTelephonyAudioRoutingObserver& aObserver);        
    60     	
    61         /**
    62         * Closes connection to the server.
    63         * @since Series 60 3.1
    64         * @param none
    65         * @return void
    66         */
    67         IMPORT_C void Close();                                                      
    68                                                                        
    69 	    /**
    70         * Gets the client side version number.
    71         * @since Series 60 3.1
    72         * @param none
    73         * @return TVersion: version
    74         */
    75 	    IMPORT_C TVersion Version() const;                                                    
    76                                                                                  
    77 	    /**
    78         * Send a SetOutput request to server.
    79         * @since Series 60 3.1
    80         * @params aOutput: output value to set
    81         *		  aShowNote: Boolean to indicate note option
    82         * @return void
    83         */
    84 	    IMPORT_C void SetOutput(CTelephonyAudioRouting::TAudioOutput aOutput, TBool aShowNote); 
    85 
    86     	/**
    87         * Get the available audio outputs from the server.
    88         * @since Series 60 3.1
    89         * @param none
    90         * @return void
    91         */
    92     	IMPORT_C void GetAvailableOutputsL();
    93     	
    94     	/**
    95         * Cancel a previously send request.
    96         * @since Series 60 3.1
    97         * @param aRequest: request to cancel
    98         * @return void
    99         */
   100     	IMPORT_C void CancelRequest(TTelAudRtngServRqst aRequest);
   101     	
   102       	/**
   103         * Send a request to server to receive notification whenever current audio output changes.
   104         * @since Series 60 3.1
   105         * @param none
   106         * @return void
   107         */
   108     	IMPORT_C void NotifyIfOutputChanged();
   109     	
   110     	/**
   111         * Send a request to server to receive notification whenever available audio output changes.
   112         * @since Series 60 3.1
   113         * @param none
   114         * @return void
   115         */
   116     	IMPORT_C void NotifyIfAvailableOutputsChanged();
   117     	
   118     	// Accessor methods:
   119     	
   120      	/**
   121         * Provide caller with iCurrentAudioOutputPkg
   122         * @since Series 60 3.1
   123         * @param none
   124         * @return iCurrentAudioOutputPkg
   125         */
   126     	IMPORT_C  TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& CurrentAudioOutputPkg();   	
   127     	  	
   128      	/**
   129         * Provide caller with iPreviousAudioOutputPkg
   130         * @since Series 60 3.1
   131         * @param none
   132         * @return iPreviousAudioOutputPkg
   133         */
   134     	IMPORT_C  TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& PreviousAudioOutputPkg();  
   135 
   136      	/**
   137         * Provide caller with iErrPkg
   138         * @since Series 60 3.1
   139         * @param none
   140         * @return iErrPkg value
   141         */
   142     	IMPORT_C  TPckgBuf<TInt>& ErrPkg();
   143     	
   144      	/**
   145         * Provide caller with iAvailableOutputs array
   146         * @since Series 60 3.1
   147         * @param none
   148         * @return: Array of available outputs
   149         */
   150     	IMPORT_C RArray<CTelephonyAudioRouting::TAudioOutput>& AvailableOutputs();  
   151     	
   152       	/**
   153         * Sets value for iOkToGetShowNoteMode after successful completion of SetOutput call
   154         * @since Series 60 3.1
   155         * @param none
   156         * @return: none
   157         */
   158     	IMPORT_C void SetShowNoteMode();  
   159     	
   160     	
   161       	/**
   162         * Provides caller with value for iShowNoteModePkg
   163         * @since Series 60 3.1
   164         * @param none
   165         * @return: none
   166         */
   167     	IMPORT_C TPckgBuf<TBool>& ShowNoteMode(); 
   168     	
   169     	
   170       	/**
   171         * Will reset iOkToGetShowNoteMode value to EFalse
   172         * @since Series 60 3.1
   173         * @param none
   174         * @return: none
   175         */
   176     	IMPORT_C void ResetShowNoteMode();   
   177     	
   178       	
   179       	/**
   180         * Provides caller with value for iOkToGetShowNoteMode
   181         * @since Series 60 3.1
   182         * @param none
   183         * @return: none
   184         */
   185     	IMPORT_C TBool OkToGetShowNoteMode();  
   186     	
   187     	
   188       	/**
   189         * Provides caller with default values from server
   190         * @since Series 60 3.1
   191         * @param none
   192         * @return: none
   193         */    	
   194     	IMPORT_C void GetDefaultValuesL();    	     	       	    	    	
   195 
   196 	private:
   197 
   198    		/**
   199         * Start asynchronous request handlers.
   200         * @since Series 60 3.1
   201         * @param aAudioRouting: client obj, aObserver: client's observer class for callbacks
   202         * @return void
   203         */
   204    		void StartRequestHandlersL( CTelephonyAudioRouting& aAudioRouting, MTelephonyAudioRoutingObserver& aObserver );
   205 
   206  
   207 	private:
   208 
   209  		TPckgBuf<CTelephonyAudioRouting::TAudioOutput> iCurrentAudioOutputPkg;  		
   210   		TPckgBuf<CTelephonyAudioRouting::TAudioOutput> iPreviousAudioOutputPkg; 
   211   		TPckgBuf<TInt> iErrPkg;   
   212    		TPckgBuf<TBool> iShowNoteModePkg; 
   213    		TPckgBuf<TTelephonyAudioRoutingDefaultParams> iDefaultValuePkg;
   214  	    RArray<CTelephonyAudioRouting::TAudioOutput> iAvailableOutputs;
   215       
   216 		RPointerArray<CTelephonyAudioRoutingRequest> iRequests;  
   217 	
   218 		TBool 	iConnected; 
   219 		TBool	iOkToGetShowNoteMode;
   220 
   221                                                                              
   222     };                                                                           
   223                                       
   224                                                                                  
   225 #endif         //TELEPHONYAUDIOROUTINGSESSION_H                                
   226                                                                                  
   227