sl@0: /* sl@0: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: This class is the main interface to the TelephonyAudioRoutingServer. sl@0: * It implements the client-side session. sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #ifndef TELEPHONYAUDIOROUTINGMANAGERSESSION_H sl@0: #define TELEPHONYAUDIOROUTINGMANAGERSESSION_H sl@0: sl@0: #include sl@0: #include sl@0: #include "MTelephonyAudioRoutingPolicyObserver.h" sl@0: #include "TelephonyAudioRoutingClientServer.h" sl@0: sl@0: sl@0: class CTelephonyAudioRoutingPolicyRequest; sl@0: class CTelephonyAudioRoutingManager; sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /** sl@0: * Main interface to the TelephonyAudioRoutingServer. sl@0: * It implements the client-side session. sl@0: * sl@0: * @lib TelephonyAudioRoutingManagerSession.lib sl@0: * @since Series 60 3.1 sl@0: */ sl@0: sl@0: class RTelephonyAudioRoutingManagerSession : public RSessionBase sl@0: { sl@0: sl@0: public: sl@0: sl@0: IMPORT_C RTelephonyAudioRoutingManagerSession(); sl@0: sl@0: public: sl@0: sl@0: /** sl@0: * Connects a policy client to the server. sl@0: * @since Series 60 3.1 sl@0: * @param aAudioRoutingManager: Client, aPolicyObserver: client observer class sl@0: * @return TInt: if connection was successful sl@0: */ sl@0: IMPORT_C TInt Connect(CTelephonyAudioRoutingManager& aAudioRoutingManager, MTelephonyAudioRoutingPolicyObserver& aPolicyObserver); sl@0: sl@0: /** sl@0: * Closes connection to the server. sl@0: * @since Series 60 3.1 sl@0: * @param none sl@0: * @return void sl@0: */ sl@0: IMPORT_C void Close(); sl@0: sl@0: /** sl@0: * Used by policy to notify server of audio output changes. sl@0: * @since Series 60 3.1 sl@0: * @param aOutput: client obj sl@0: * @return void sl@0: */ sl@0: IMPORT_C void OutputChanged(CTelephonyAudioRouting::TAudioOutput aOutput); sl@0: sl@0: /** sl@0: * Used by policy to notify server that requested output change completed sl@0: * @since Series 60 3.1 sl@0: * @param aOutput: client obj, aError: error code for operation sl@0: * @return void sl@0: */ sl@0: IMPORT_C void OutputChangeCompleted(CTelephonyAudioRouting::TAudioOutput aOutput, TInt aError); sl@0: sl@0: sl@0: /** sl@0: * Used by policy session to get notification whenever any of the clients sends sl@0: * a SetOutput request. sl@0: * @since Series 60 3.1 sl@0: * @param none sl@0: * @return void sl@0: */ sl@0: IMPORT_C void MonitorOutputChangeRequest(); sl@0: sl@0: /** sl@0: * Sets policy session Id. sl@0: * @since Series 60 3.1 sl@0: * @param none sl@0: * @return void sl@0: */ sl@0: IMPORT_C void SetPolicySessionIdL(); sl@0: sl@0: /** sl@0: * Cancel a previously send request. sl@0: * @since Series 60 3.1 sl@0: * @param aRequest: request to cancel sl@0: * @return void sl@0: */ sl@0: IMPORT_C void CancelRequest(TTelAudRtngServRqst aRequest); sl@0: sl@0: /** sl@0: * Used by policy session to notify server if the available audio sl@0: * output change. sl@0: * @since Series 60 3.1 sl@0: * @param aOutputs: array of available outputs sl@0: * @return void sl@0: */ sl@0: IMPORT_C void AvailableOutputsChangedL(const TArray& aOutputs); sl@0: sl@0: /** sl@0: * Provide caller with iAudioOutputPkg sl@0: * @since Series 60 3.1 sl@0: * @param none sl@0: * @return iAudioOutputPkg sl@0: */ sl@0: IMPORT_C TPckgBuf& AudioOutputPkg(); sl@0: sl@0: private: sl@0: sl@0: /** sl@0: * Start asynchronous request handlers. sl@0: * @since Series 60 3.1 sl@0: * @param aAudioRoutingManager: client obj, aPolicyObserver: observer obj for callbacks sl@0: * @return void sl@0: */ sl@0: void StartPolicyRequestHandlersL( CTelephonyAudioRoutingManager& aAudioRoutingManager, MTelephonyAudioRoutingPolicyObserver& aPolicyObserver ); sl@0: sl@0: private: sl@0: sl@0: TPckgBuf iAudioOutputPkg; sl@0: CTelephonyAudioRoutingPolicyRequest* iPolicyRequest; sl@0: TBool iConnected; sl@0: sl@0: }; sl@0: sl@0: sl@0: #endif //TELEPHONYAUDIOROUTINGSESSION_H sl@0: sl@0: