author | sl@SLION-WIN7.fritz.box |
Fri, 15 Jun 2012 03:10:57 +0200 | |
changeset 0 | bde4ae8d615e |
permissions | -rw-r--r-- |
sl@0 | 1 |
/* |
sl@0 | 2 |
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). |
sl@0 | 3 |
* All rights reserved. |
sl@0 | 4 |
* This component and the accompanying materials are made available |
sl@0 | 5 |
* under the terms of "Eclipse Public License v1.0" |
sl@0 | 6 |
* which accompanies this distribution, and is available |
sl@0 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
sl@0 | 8 |
* |
sl@0 | 9 |
* Initial Contributors: |
sl@0 | 10 |
* Nokia Corporation - initial contribution. |
sl@0 | 11 |
* |
sl@0 | 12 |
* Contributors: |
sl@0 | 13 |
* |
sl@0 | 14 |
* Description: This class is the main interface to the TelephonyAudioRoutingServer. |
sl@0 | 15 |
* It implements the client-side session. |
sl@0 | 16 |
* |
sl@0 | 17 |
*/ |
sl@0 | 18 |
|
sl@0 | 19 |
|
sl@0 | 20 |
|
sl@0 | 21 |
#ifndef TELEPHONYAUDIOROUTINGSESSION_H |
sl@0 | 22 |
#define TELEPHONYAUDIOROUTINGSESSION_H |
sl@0 | 23 |
|
sl@0 | 24 |
#include <e32base.h> |
sl@0 | 25 |
#include <e32std.h> |
sl@0 | 26 |
#include "TelephonyAudioRouting.h" |
sl@0 | 27 |
#include "MTelephonyAudioRoutingPolicyObserver.h" |
sl@0 | 28 |
#include "TelephonyAudioRoutingClientServer.h" |
sl@0 | 29 |
|
sl@0 | 30 |
|
sl@0 | 31 |
class CTelephonyAudioRoutingRequest; |
sl@0 | 32 |
class CTelephonyAudioRoutingManager; |
sl@0 | 33 |
|
sl@0 | 34 |
// CLASS DECLARATION |
sl@0 | 35 |
|
sl@0 | 36 |
/** |
sl@0 | 37 |
* Main interface to the TelephonyAudioRoutingServer. |
sl@0 | 38 |
* It implements the client-side session. |
sl@0 | 39 |
* |
sl@0 | 40 |
* @lib TelephonyAudioRoutingSession.lib |
sl@0 | 41 |
* @since Series 60 3.1 |
sl@0 | 42 |
*/ |
sl@0 | 43 |
|
sl@0 | 44 |
class RTelephonyAudioRoutingSession : public RSessionBase |
sl@0 | 45 |
{ |
sl@0 | 46 |
|
sl@0 | 47 |
public: |
sl@0 | 48 |
|
sl@0 | 49 |
IMPORT_C RTelephonyAudioRoutingSession(); |
sl@0 | 50 |
|
sl@0 | 51 |
public: |
sl@0 | 52 |
|
sl@0 | 53 |
/** |
sl@0 | 54 |
* Connects a client to the server. |
sl@0 | 55 |
* @since Series 60 3.1 |
sl@0 | 56 |
* @param aAudioRouting obj: client obj, aObserver: Client's observer class |
sl@0 | 57 |
* @return TInt connection success or failure |
sl@0 | 58 |
*/ |
sl@0 | 59 |
IMPORT_C TInt ConnectL(CTelephonyAudioRouting& aAudioRouting, MTelephonyAudioRoutingObserver& aObserver); |
sl@0 | 60 |
|
sl@0 | 61 |
/** |
sl@0 | 62 |
* Closes connection to the server. |
sl@0 | 63 |
* @since Series 60 3.1 |
sl@0 | 64 |
* @param none |
sl@0 | 65 |
* @return void |
sl@0 | 66 |
*/ |
sl@0 | 67 |
IMPORT_C void Close(); |
sl@0 | 68 |
|
sl@0 | 69 |
/** |
sl@0 | 70 |
* Gets the client side version number. |
sl@0 | 71 |
* @since Series 60 3.1 |
sl@0 | 72 |
* @param none |
sl@0 | 73 |
* @return TVersion: version |
sl@0 | 74 |
*/ |
sl@0 | 75 |
IMPORT_C TVersion Version() const; |
sl@0 | 76 |
|
sl@0 | 77 |
/** |
sl@0 | 78 |
* Send a SetOutput request to server. |
sl@0 | 79 |
* @since Series 60 3.1 |
sl@0 | 80 |
* @params aOutput: output value to set |
sl@0 | 81 |
* aShowNote: Boolean to indicate note option |
sl@0 | 82 |
* @return void |
sl@0 | 83 |
*/ |
sl@0 | 84 |
IMPORT_C void SetOutput(CTelephonyAudioRouting::TAudioOutput aOutput, TBool aShowNote); |
sl@0 | 85 |
|
sl@0 | 86 |
/** |
sl@0 | 87 |
* Get the available audio outputs from the server. |
sl@0 | 88 |
* @since Series 60 3.1 |
sl@0 | 89 |
* @param none |
sl@0 | 90 |
* @return void |
sl@0 | 91 |
*/ |
sl@0 | 92 |
IMPORT_C void GetAvailableOutputsL(); |
sl@0 | 93 |
|
sl@0 | 94 |
/** |
sl@0 | 95 |
* Cancel a previously send request. |
sl@0 | 96 |
* @since Series 60 3.1 |
sl@0 | 97 |
* @param aRequest: request to cancel |
sl@0 | 98 |
* @return void |
sl@0 | 99 |
*/ |
sl@0 | 100 |
IMPORT_C void CancelRequest(TTelAudRtngServRqst aRequest); |
sl@0 | 101 |
|
sl@0 | 102 |
/** |
sl@0 | 103 |
* Send a request to server to receive notification whenever current audio output changes. |
sl@0 | 104 |
* @since Series 60 3.1 |
sl@0 | 105 |
* @param none |
sl@0 | 106 |
* @return void |
sl@0 | 107 |
*/ |
sl@0 | 108 |
IMPORT_C void NotifyIfOutputChanged(); |
sl@0 | 109 |
|
sl@0 | 110 |
/** |
sl@0 | 111 |
* Send a request to server to receive notification whenever available audio output changes. |
sl@0 | 112 |
* @since Series 60 3.1 |
sl@0 | 113 |
* @param none |
sl@0 | 114 |
* @return void |
sl@0 | 115 |
*/ |
sl@0 | 116 |
IMPORT_C void NotifyIfAvailableOutputsChanged(); |
sl@0 | 117 |
|
sl@0 | 118 |
// Accessor methods: |
sl@0 | 119 |
|
sl@0 | 120 |
/** |
sl@0 | 121 |
* Provide caller with iCurrentAudioOutputPkg |
sl@0 | 122 |
* @since Series 60 3.1 |
sl@0 | 123 |
* @param none |
sl@0 | 124 |
* @return iCurrentAudioOutputPkg |
sl@0 | 125 |
*/ |
sl@0 | 126 |
IMPORT_C TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& CurrentAudioOutputPkg(); |
sl@0 | 127 |
|
sl@0 | 128 |
/** |
sl@0 | 129 |
* Provide caller with iPreviousAudioOutputPkg |
sl@0 | 130 |
* @since Series 60 3.1 |
sl@0 | 131 |
* @param none |
sl@0 | 132 |
* @return iPreviousAudioOutputPkg |
sl@0 | 133 |
*/ |
sl@0 | 134 |
IMPORT_C TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& PreviousAudioOutputPkg(); |
sl@0 | 135 |
|
sl@0 | 136 |
/** |
sl@0 | 137 |
* Provide caller with iErrPkg |
sl@0 | 138 |
* @since Series 60 3.1 |
sl@0 | 139 |
* @param none |
sl@0 | 140 |
* @return iErrPkg value |
sl@0 | 141 |
*/ |
sl@0 | 142 |
IMPORT_C TPckgBuf<TInt>& ErrPkg(); |
sl@0 | 143 |
|
sl@0 | 144 |
/** |
sl@0 | 145 |
* Provide caller with iAvailableOutputs array |
sl@0 | 146 |
* @since Series 60 3.1 |
sl@0 | 147 |
* @param none |
sl@0 | 148 |
* @return: Array of available outputs |
sl@0 | 149 |
*/ |
sl@0 | 150 |
IMPORT_C RArray<CTelephonyAudioRouting::TAudioOutput>& AvailableOutputs(); |
sl@0 | 151 |
|
sl@0 | 152 |
/** |
sl@0 | 153 |
* Sets value for iOkToGetShowNoteMode after successful completion of SetOutput call |
sl@0 | 154 |
* @since Series 60 3.1 |
sl@0 | 155 |
* @param none |
sl@0 | 156 |
* @return: none |
sl@0 | 157 |
*/ |
sl@0 | 158 |
IMPORT_C void SetShowNoteMode(); |
sl@0 | 159 |
|
sl@0 | 160 |
|
sl@0 | 161 |
/** |
sl@0 | 162 |
* Provides caller with value for iShowNoteModePkg |
sl@0 | 163 |
* @since Series 60 3.1 |
sl@0 | 164 |
* @param none |
sl@0 | 165 |
* @return: none |
sl@0 | 166 |
*/ |
sl@0 | 167 |
IMPORT_C TPckgBuf<TBool>& ShowNoteMode(); |
sl@0 | 168 |
|
sl@0 | 169 |
|
sl@0 | 170 |
/** |
sl@0 | 171 |
* Will reset iOkToGetShowNoteMode value to EFalse |
sl@0 | 172 |
* @since Series 60 3.1 |
sl@0 | 173 |
* @param none |
sl@0 | 174 |
* @return: none |
sl@0 | 175 |
*/ |
sl@0 | 176 |
IMPORT_C void ResetShowNoteMode(); |
sl@0 | 177 |
|
sl@0 | 178 |
|
sl@0 | 179 |
/** |
sl@0 | 180 |
* Provides caller with value for iOkToGetShowNoteMode |
sl@0 | 181 |
* @since Series 60 3.1 |
sl@0 | 182 |
* @param none |
sl@0 | 183 |
* @return: none |
sl@0 | 184 |
*/ |
sl@0 | 185 |
IMPORT_C TBool OkToGetShowNoteMode(); |
sl@0 | 186 |
|
sl@0 | 187 |
|
sl@0 | 188 |
/** |
sl@0 | 189 |
* Provides caller with default values from server |
sl@0 | 190 |
* @since Series 60 3.1 |
sl@0 | 191 |
* @param none |
sl@0 | 192 |
* @return: none |
sl@0 | 193 |
*/ |
sl@0 | 194 |
IMPORT_C void GetDefaultValuesL(); |
sl@0 | 195 |
|
sl@0 | 196 |
private: |
sl@0 | 197 |
|
sl@0 | 198 |
/** |
sl@0 | 199 |
* Start asynchronous request handlers. |
sl@0 | 200 |
* @since Series 60 3.1 |
sl@0 | 201 |
* @param aAudioRouting: client obj, aObserver: client's observer class for callbacks |
sl@0 | 202 |
* @return void |
sl@0 | 203 |
*/ |
sl@0 | 204 |
void StartRequestHandlersL( CTelephonyAudioRouting& aAudioRouting, MTelephonyAudioRoutingObserver& aObserver ); |
sl@0 | 205 |
|
sl@0 | 206 |
|
sl@0 | 207 |
private: |
sl@0 | 208 |
|
sl@0 | 209 |
TPckgBuf<CTelephonyAudioRouting::TAudioOutput> iCurrentAudioOutputPkg; |
sl@0 | 210 |
TPckgBuf<CTelephonyAudioRouting::TAudioOutput> iPreviousAudioOutputPkg; |
sl@0 | 211 |
TPckgBuf<TInt> iErrPkg; |
sl@0 | 212 |
TPckgBuf<TBool> iShowNoteModePkg; |
sl@0 | 213 |
TPckgBuf<TTelephonyAudioRoutingDefaultParams> iDefaultValuePkg; |
sl@0 | 214 |
RArray<CTelephonyAudioRouting::TAudioOutput> iAvailableOutputs; |
sl@0 | 215 |
|
sl@0 | 216 |
RPointerArray<CTelephonyAudioRoutingRequest> iRequests; |
sl@0 | 217 |
|
sl@0 | 218 |
TBool iConnected; |
sl@0 | 219 |
TBool iOkToGetShowNoteMode; |
sl@0 | 220 |
|
sl@0 | 221 |
|
sl@0 | 222 |
}; |
sl@0 | 223 |
|
sl@0 | 224 |
|
sl@0 | 225 |
#endif //TELEPHONYAUDIOROUTINGSESSION_H |
sl@0 | 226 |
|
sl@0 | 227 |