os/mm/devsoundextensions/telephonyaudiorouting/Session/inc/TelephonyAudioRoutingSession.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsoundextensions/telephonyaudiorouting/Session/inc/TelephonyAudioRoutingSession.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,227 @@
1.4 +/*
1.5 +* Copyright (c) 2002-2004 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 TELEPHONYAUDIOROUTINGSESSION_H
1.25 +#define TELEPHONYAUDIOROUTINGSESSION_H
1.26 +
1.27 +#include <e32base.h>
1.28 +#include <e32std.h>
1.29 +#include "TelephonyAudioRouting.h"
1.30 +#include "MTelephonyAudioRoutingPolicyObserver.h"
1.31 +#include "TelephonyAudioRoutingClientServer.h"
1.32 +
1.33 +
1.34 +class CTelephonyAudioRoutingRequest;
1.35 +class CTelephonyAudioRoutingManager;
1.36 +
1.37 +// CLASS DECLARATION
1.38 +
1.39 +/**
1.40 +* Main interface to the TelephonyAudioRoutingServer.
1.41 +* It implements the client-side session.
1.42 +*
1.43 +* @lib TelephonyAudioRoutingSession.lib
1.44 +* @since Series 60 3.1
1.45 +*/
1.46 +
1.47 +class RTelephonyAudioRoutingSession : public RSessionBase
1.48 + {
1.49 +
1.50 + public:
1.51 +
1.52 + IMPORT_C RTelephonyAudioRoutingSession();
1.53 +
1.54 + public:
1.55 +
1.56 + /**
1.57 + * Connects a client to the server.
1.58 + * @since Series 60 3.1
1.59 + * @param aAudioRouting obj: client obj, aObserver: Client's observer class
1.60 + * @return TInt connection success or failure
1.61 + */
1.62 + IMPORT_C TInt ConnectL(CTelephonyAudioRouting& aAudioRouting, MTelephonyAudioRoutingObserver& aObserver);
1.63 +
1.64 + /**
1.65 + * Closes connection to the server.
1.66 + * @since Series 60 3.1
1.67 + * @param none
1.68 + * @return void
1.69 + */
1.70 + IMPORT_C void Close();
1.71 +
1.72 + /**
1.73 + * Gets the client side version number.
1.74 + * @since Series 60 3.1
1.75 + * @param none
1.76 + * @return TVersion: version
1.77 + */
1.78 + IMPORT_C TVersion Version() const;
1.79 +
1.80 + /**
1.81 + * Send a SetOutput request to server.
1.82 + * @since Series 60 3.1
1.83 + * @params aOutput: output value to set
1.84 + * aShowNote: Boolean to indicate note option
1.85 + * @return void
1.86 + */
1.87 + IMPORT_C void SetOutput(CTelephonyAudioRouting::TAudioOutput aOutput, TBool aShowNote);
1.88 +
1.89 + /**
1.90 + * Get the available audio outputs from the server.
1.91 + * @since Series 60 3.1
1.92 + * @param none
1.93 + * @return void
1.94 + */
1.95 + IMPORT_C void GetAvailableOutputsL();
1.96 +
1.97 + /**
1.98 + * Cancel a previously send request.
1.99 + * @since Series 60 3.1
1.100 + * @param aRequest: request to cancel
1.101 + * @return void
1.102 + */
1.103 + IMPORT_C void CancelRequest(TTelAudRtngServRqst aRequest);
1.104 +
1.105 + /**
1.106 + * Send a request to server to receive notification whenever current audio output changes.
1.107 + * @since Series 60 3.1
1.108 + * @param none
1.109 + * @return void
1.110 + */
1.111 + IMPORT_C void NotifyIfOutputChanged();
1.112 +
1.113 + /**
1.114 + * Send a request to server to receive notification whenever available audio output changes.
1.115 + * @since Series 60 3.1
1.116 + * @param none
1.117 + * @return void
1.118 + */
1.119 + IMPORT_C void NotifyIfAvailableOutputsChanged();
1.120 +
1.121 + // Accessor methods:
1.122 +
1.123 + /**
1.124 + * Provide caller with iCurrentAudioOutputPkg
1.125 + * @since Series 60 3.1
1.126 + * @param none
1.127 + * @return iCurrentAudioOutputPkg
1.128 + */
1.129 + IMPORT_C TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& CurrentAudioOutputPkg();
1.130 +
1.131 + /**
1.132 + * Provide caller with iPreviousAudioOutputPkg
1.133 + * @since Series 60 3.1
1.134 + * @param none
1.135 + * @return iPreviousAudioOutputPkg
1.136 + */
1.137 + IMPORT_C TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& PreviousAudioOutputPkg();
1.138 +
1.139 + /**
1.140 + * Provide caller with iErrPkg
1.141 + * @since Series 60 3.1
1.142 + * @param none
1.143 + * @return iErrPkg value
1.144 + */
1.145 + IMPORT_C TPckgBuf<TInt>& ErrPkg();
1.146 +
1.147 + /**
1.148 + * Provide caller with iAvailableOutputs array
1.149 + * @since Series 60 3.1
1.150 + * @param none
1.151 + * @return: Array of available outputs
1.152 + */
1.153 + IMPORT_C RArray<CTelephonyAudioRouting::TAudioOutput>& AvailableOutputs();
1.154 +
1.155 + /**
1.156 + * Sets value for iOkToGetShowNoteMode after successful completion of SetOutput call
1.157 + * @since Series 60 3.1
1.158 + * @param none
1.159 + * @return: none
1.160 + */
1.161 + IMPORT_C void SetShowNoteMode();
1.162 +
1.163 +
1.164 + /**
1.165 + * Provides caller with value for iShowNoteModePkg
1.166 + * @since Series 60 3.1
1.167 + * @param none
1.168 + * @return: none
1.169 + */
1.170 + IMPORT_C TPckgBuf<TBool>& ShowNoteMode();
1.171 +
1.172 +
1.173 + /**
1.174 + * Will reset iOkToGetShowNoteMode value to EFalse
1.175 + * @since Series 60 3.1
1.176 + * @param none
1.177 + * @return: none
1.178 + */
1.179 + IMPORT_C void ResetShowNoteMode();
1.180 +
1.181 +
1.182 + /**
1.183 + * Provides caller with value for iOkToGetShowNoteMode
1.184 + * @since Series 60 3.1
1.185 + * @param none
1.186 + * @return: none
1.187 + */
1.188 + IMPORT_C TBool OkToGetShowNoteMode();
1.189 +
1.190 +
1.191 + /**
1.192 + * Provides caller with default values from server
1.193 + * @since Series 60 3.1
1.194 + * @param none
1.195 + * @return: none
1.196 + */
1.197 + IMPORT_C void GetDefaultValuesL();
1.198 +
1.199 + private:
1.200 +
1.201 + /**
1.202 + * Start asynchronous request handlers.
1.203 + * @since Series 60 3.1
1.204 + * @param aAudioRouting: client obj, aObserver: client's observer class for callbacks
1.205 + * @return void
1.206 + */
1.207 + void StartRequestHandlersL( CTelephonyAudioRouting& aAudioRouting, MTelephonyAudioRoutingObserver& aObserver );
1.208 +
1.209 +
1.210 + private:
1.211 +
1.212 + TPckgBuf<CTelephonyAudioRouting::TAudioOutput> iCurrentAudioOutputPkg;
1.213 + TPckgBuf<CTelephonyAudioRouting::TAudioOutput> iPreviousAudioOutputPkg;
1.214 + TPckgBuf<TInt> iErrPkg;
1.215 + TPckgBuf<TBool> iShowNoteModePkg;
1.216 + TPckgBuf<TTelephonyAudioRoutingDefaultParams> iDefaultValuePkg;
1.217 + RArray<CTelephonyAudioRouting::TAudioOutput> iAvailableOutputs;
1.218 +
1.219 + RPointerArray<CTelephonyAudioRoutingRequest> iRequests;
1.220 +
1.221 + TBool iConnected;
1.222 + TBool iOkToGetShowNoteMode;
1.223 +
1.224 +
1.225 + };
1.226 +
1.227 +
1.228 +#endif //TELEPHONYAUDIOROUTINGSESSION_H
1.229 +
1.230 +