os/mm/devsoundextensions/telephonyaudiorouting/Session/inc/TelephonyAudioRoutingManagerSession.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsoundextensions/telephonyaudiorouting/Session/inc/TelephonyAudioRoutingManagerSession.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,148 @@
1.4 +/*
1.5 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: This class is the main interface to the TelephonyAudioRoutingServer.
1.18 +* It implements the client-side session.
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +#ifndef TELEPHONYAUDIOROUTINGMANAGERSESSION_H
1.25 +#define TELEPHONYAUDIOROUTINGMANAGERSESSION_H
1.26 +
1.27 +#include <e32base.h>
1.28 +#include <e32std.h>
1.29 +#include "MTelephonyAudioRoutingPolicyObserver.h"
1.30 +#include "TelephonyAudioRoutingClientServer.h"
1.31 +
1.32 +
1.33 +class CTelephonyAudioRoutingPolicyRequest;
1.34 +class CTelephonyAudioRoutingManager;
1.35 +
1.36 +// CLASS DECLARATION
1.37 +
1.38 +/**
1.39 +* Main interface to the TelephonyAudioRoutingServer.
1.40 +* It implements the client-side session.
1.41 +*
1.42 +* @lib TelephonyAudioRoutingManagerSession.lib
1.43 +* @since Series 60 3.1
1.44 +*/
1.45 +
1.46 +class RTelephonyAudioRoutingManagerSession : public RSessionBase
1.47 + {
1.48 +
1.49 + public:
1.50 +
1.51 + IMPORT_C RTelephonyAudioRoutingManagerSession();
1.52 +
1.53 + public:
1.54 +
1.55 + /**
1.56 + * Connects a policy client to the server.
1.57 + * @since Series 60 3.1
1.58 + * @param aAudioRoutingManager: Client, aPolicyObserver: client observer class
1.59 + * @return TInt: if connection was successful
1.60 + */
1.61 + IMPORT_C TInt Connect(CTelephonyAudioRoutingManager& aAudioRoutingManager, MTelephonyAudioRoutingPolicyObserver& aPolicyObserver);
1.62 +
1.63 + /**
1.64 + * Closes connection to the server.
1.65 + * @since Series 60 3.1
1.66 + * @param none
1.67 + * @return void
1.68 + */
1.69 + IMPORT_C void Close();
1.70 +
1.71 + /**
1.72 + * Used by policy to notify server of audio output changes.
1.73 + * @since Series 60 3.1
1.74 + * @param aOutput: client obj
1.75 + * @return void
1.76 + */
1.77 + IMPORT_C void OutputChanged(CTelephonyAudioRouting::TAudioOutput aOutput);
1.78 +
1.79 + /**
1.80 + * Used by policy to notify server that requested output change completed
1.81 + * @since Series 60 3.1
1.82 + * @param aOutput: client obj, aError: error code for operation
1.83 + * @return void
1.84 + */
1.85 + IMPORT_C void OutputChangeCompleted(CTelephonyAudioRouting::TAudioOutput aOutput, TInt aError);
1.86 +
1.87 +
1.88 + /**
1.89 + * Used by policy session to get notification whenever any of the clients sends
1.90 + * a SetOutput request.
1.91 + * @since Series 60 3.1
1.92 + * @param none
1.93 + * @return void
1.94 + */
1.95 + IMPORT_C void MonitorOutputChangeRequest();
1.96 +
1.97 + /**
1.98 + * Sets policy session Id.
1.99 + * @since Series 60 3.1
1.100 + * @param none
1.101 + * @return void
1.102 + */
1.103 + IMPORT_C void SetPolicySessionIdL();
1.104 +
1.105 + /**
1.106 + * Cancel a previously send request.
1.107 + * @since Series 60 3.1
1.108 + * @param aRequest: request to cancel
1.109 + * @return void
1.110 + */
1.111 + IMPORT_C void CancelRequest(TTelAudRtngServRqst aRequest);
1.112 +
1.113 + /**
1.114 + * Used by policy session to notify server if the available audio
1.115 + * output change.
1.116 + * @since Series 60 3.1
1.117 + * @param aOutputs: array of available outputs
1.118 + * @return void
1.119 + */
1.120 + IMPORT_C void AvailableOutputsChangedL(const TArray<CTelephonyAudioRouting::TAudioOutput>& aOutputs);
1.121 +
1.122 + /**
1.123 + * Provide caller with iAudioOutputPkg
1.124 + * @since Series 60 3.1
1.125 + * @param none
1.126 + * @return iAudioOutputPkg
1.127 + */
1.128 + IMPORT_C TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& AudioOutputPkg();
1.129 +
1.130 + private:
1.131 +
1.132 + /**
1.133 + * Start asynchronous request handlers.
1.134 + * @since Series 60 3.1
1.135 + * @param aAudioRoutingManager: client obj, aPolicyObserver: observer obj for callbacks
1.136 + * @return void
1.137 + */
1.138 + void StartPolicyRequestHandlersL( CTelephonyAudioRoutingManager& aAudioRoutingManager, MTelephonyAudioRoutingPolicyObserver& aPolicyObserver );
1.139 +
1.140 + private:
1.141 +
1.142 + TPckgBuf<CTelephonyAudioRouting::TAudioOutput> iAudioOutputPkg;
1.143 + CTelephonyAudioRoutingPolicyRequest* iPolicyRequest;
1.144 + TBool iConnected;
1.145 +
1.146 + };
1.147 +
1.148 +
1.149 +#endif //TELEPHONYAUDIOROUTINGSESSION_H
1.150 +
1.151 +