os/mm/devsoundextensions/telephonyaudiorouting/Session/inc/TelephonyAudioRoutingManagerSession.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 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 class is the main interface to the TelephonyAudioRoutingServer. 
    15 *				 It implements the client-side session.
    16 *
    17 */
    18 
    19                                       
    20                                                                                  
    21 #ifndef TELEPHONYAUDIOROUTINGMANAGERSESSION_H                                                
    22 #define TELEPHONYAUDIOROUTINGMANAGERSESSION_H                                                  
    23                                                                                  
    24 #include <e32base.h>
    25 #include <e32std.h>     
    26 #include "MTelephonyAudioRoutingPolicyObserver.h"
    27 #include "TelephonyAudioRoutingClientServer.h"
    28   
    29 
    30 class CTelephonyAudioRoutingPolicyRequest;
    31 class CTelephonyAudioRoutingManager;
    32 
    33 // CLASS DECLARATION
    34 
    35 /**
    36 *  Main interface to the TelephonyAudioRoutingServer. 
    37 *  It implements the client-side session.
    38 *
    39 *  @lib TelephonyAudioRoutingManagerSession.lib
    40 *  @since Series 60 3.1
    41 */                                     
    42                                                                               
    43 class RTelephonyAudioRoutingManagerSession : public RSessionBase                                   
    44     { 
    45                                                                                
    46 	public:                                                                          
    47                                                                         
    48     	IMPORT_C RTelephonyAudioRoutingManagerSession();    
    49     
    50     public:                                                    
    51          
    52     	/**
    53         * Connects a policy client to the server.
    54         * @since Series 60 3.1
    55         * @param aAudioRoutingManager: Client, aPolicyObserver: client observer class
    56         * @return TInt: if connection was successful
    57         */
    58     	IMPORT_C TInt Connect(CTelephonyAudioRoutingManager& aAudioRoutingManager, MTelephonyAudioRoutingPolicyObserver& aPolicyObserver);
    59     	
    60         /**
    61         * Closes connection to the server.
    62         * @since Series 60 3.1
    63         * @param none
    64         * @return void
    65         */
    66         IMPORT_C void Close();                                                      
    67                                       
    68 	    /**
    69         * Used by policy to notify server of audio output changes.
    70         * @since Series 60 3.1
    71         * @param aOutput: client obj
    72         * @return void
    73         */
    74 	    IMPORT_C void OutputChanged(CTelephonyAudioRouting::TAudioOutput aOutput); 
    75 	    
    76 	    /**
    77         * Used by policy to notify server that requested output change completed
    78         * @since Series 60 3.1
    79         * @param aOutput: client obj, aError: error code for operation
    80         * @return void
    81         */
    82 	    IMPORT_C void OutputChangeCompleted(CTelephonyAudioRouting::TAudioOutput aOutput, TInt aError); 
    83 	    	    
    84 	    
    85     	/**
    86         * Used by policy session to get notification whenever any of the clients sends
    87         * a SetOutput request.
    88         * @since Series 60 3.1
    89         * @param none
    90         * @return void
    91         */
    92     	IMPORT_C void MonitorOutputChangeRequest();
    93     	
    94     	/**
    95         * Sets policy session Id.
    96         * @since Series 60 3.1
    97         * @param none
    98         * @return void
    99         */
   100     	IMPORT_C void SetPolicySessionIdL();
   101     	
   102     	/**
   103         * Cancel a previously send request.
   104         * @since Series 60 3.1
   105         * @param aRequest: request to cancel
   106         * @return void
   107         */
   108     	IMPORT_C void CancelRequest(TTelAudRtngServRqst aRequest);
   109     	
   110     	/**
   111         * Used by policy session to notify server if the available audio
   112         * output change.
   113         * @since Series 60 3.1
   114         * @param aOutputs: array of available outputs
   115         * @return void
   116         */
   117     	IMPORT_C void AvailableOutputsChangedL(const TArray<CTelephonyAudioRouting::TAudioOutput>& aOutputs);
   118     	
   119      	/**
   120         * Provide caller with iAudioOutputPkg
   121         * @since Series 60 3.1
   122         * @param none
   123         * @return iAudioOutputPkg
   124         */
   125     	IMPORT_C  TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& AudioOutputPkg();    	 
   126     	 
   127 	private:
   128 
   129    		/**
   130         * Start asynchronous request handlers.
   131         * @since Series 60 3.1
   132         * @param aAudioRoutingManager: client obj, aPolicyObserver: observer obj for callbacks
   133         * @return void
   134         */
   135    		void StartPolicyRequestHandlersL( CTelephonyAudioRoutingManager& aAudioRoutingManager, MTelephonyAudioRoutingPolicyObserver& aPolicyObserver );
   136      
   137 	private:
   138 
   139   		TPckgBuf<CTelephonyAudioRouting::TAudioOutput> iAudioOutputPkg;      
   140 		CTelephonyAudioRoutingPolicyRequest* iPolicyRequest;	
   141 		TBool iConnected;  
   142                                                                              
   143     };                                                                           
   144                                       
   145                                                                                  
   146 #endif         //TELEPHONYAUDIOROUTINGSESSION_H                                
   147                                                                                  
   148