os/mm/devsoundextensions/telephonyaudiorouting/Session/inc/TelephonyAudioRoutingSession.h
Update contrib.
2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This class is the main interface to the TelephonyAudioRoutingServer.
15 * It implements the client-side session.
21 #ifndef TELEPHONYAUDIOROUTINGSESSION_H
22 #define TELEPHONYAUDIOROUTINGSESSION_H
26 #include "TelephonyAudioRouting.h"
27 #include "MTelephonyAudioRoutingPolicyObserver.h"
28 #include "TelephonyAudioRoutingClientServer.h"
31 class CTelephonyAudioRoutingRequest;
32 class CTelephonyAudioRoutingManager;
37 * Main interface to the TelephonyAudioRoutingServer.
38 * It implements the client-side session.
40 * @lib TelephonyAudioRoutingSession.lib
41 * @since Series 60 3.1
44 class RTelephonyAudioRoutingSession : public RSessionBase
49 IMPORT_C RTelephonyAudioRoutingSession();
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
59 IMPORT_C TInt ConnectL(CTelephonyAudioRouting& aAudioRouting, MTelephonyAudioRoutingObserver& aObserver);
62 * Closes connection to the server.
63 * @since Series 60 3.1
67 IMPORT_C void Close();
70 * Gets the client side version number.
71 * @since Series 60 3.1
73 * @return TVersion: version
75 IMPORT_C TVersion Version() const;
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
84 IMPORT_C void SetOutput(CTelephonyAudioRouting::TAudioOutput aOutput, TBool aShowNote);
87 * Get the available audio outputs from the server.
88 * @since Series 60 3.1
92 IMPORT_C void GetAvailableOutputsL();
95 * Cancel a previously send request.
96 * @since Series 60 3.1
97 * @param aRequest: request to cancel
100 IMPORT_C void CancelRequest(TTelAudRtngServRqst aRequest);
103 * Send a request to server to receive notification whenever current audio output changes.
104 * @since Series 60 3.1
108 IMPORT_C void NotifyIfOutputChanged();
111 * Send a request to server to receive notification whenever available audio output changes.
112 * @since Series 60 3.1
116 IMPORT_C void NotifyIfAvailableOutputsChanged();
121 * Provide caller with iCurrentAudioOutputPkg
122 * @since Series 60 3.1
124 * @return iCurrentAudioOutputPkg
126 IMPORT_C TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& CurrentAudioOutputPkg();
129 * Provide caller with iPreviousAudioOutputPkg
130 * @since Series 60 3.1
132 * @return iPreviousAudioOutputPkg
134 IMPORT_C TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& PreviousAudioOutputPkg();
137 * Provide caller with iErrPkg
138 * @since Series 60 3.1
140 * @return iErrPkg value
142 IMPORT_C TPckgBuf<TInt>& ErrPkg();
145 * Provide caller with iAvailableOutputs array
146 * @since Series 60 3.1
148 * @return: Array of available outputs
150 IMPORT_C RArray<CTelephonyAudioRouting::TAudioOutput>& AvailableOutputs();
153 * Sets value for iOkToGetShowNoteMode after successful completion of SetOutput call
154 * @since Series 60 3.1
158 IMPORT_C void SetShowNoteMode();
162 * Provides caller with value for iShowNoteModePkg
163 * @since Series 60 3.1
167 IMPORT_C TPckgBuf<TBool>& ShowNoteMode();
171 * Will reset iOkToGetShowNoteMode value to EFalse
172 * @since Series 60 3.1
176 IMPORT_C void ResetShowNoteMode();
180 * Provides caller with value for iOkToGetShowNoteMode
181 * @since Series 60 3.1
185 IMPORT_C TBool OkToGetShowNoteMode();
189 * Provides caller with default values from server
190 * @since Series 60 3.1
194 IMPORT_C void GetDefaultValuesL();
199 * Start asynchronous request handlers.
200 * @since Series 60 3.1
201 * @param aAudioRouting: client obj, aObserver: client's observer class for callbacks
204 void StartRequestHandlersL( CTelephonyAudioRouting& aAudioRouting, MTelephonyAudioRoutingObserver& aObserver );
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;
216 RPointerArray<CTelephonyAudioRoutingRequest> iRequests;
219 TBool iOkToGetShowNoteMode;
225 #endif //TELEPHONYAUDIOROUTINGSESSION_H