sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2006 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 TELEPHONYAUDIOROUTINGMANAGERSESSION_H
|
sl@0
|
22 |
#define TELEPHONYAUDIOROUTINGMANAGERSESSION_H
|
sl@0
|
23 |
|
sl@0
|
24 |
#include <e32base.h>
|
sl@0
|
25 |
#include <e32std.h>
|
sl@0
|
26 |
#include "MTelephonyAudioRoutingPolicyObserver.h"
|
sl@0
|
27 |
#include "TelephonyAudioRoutingClientServer.h"
|
sl@0
|
28 |
|
sl@0
|
29 |
|
sl@0
|
30 |
class CTelephonyAudioRoutingPolicyRequest;
|
sl@0
|
31 |
class CTelephonyAudioRoutingManager;
|
sl@0
|
32 |
|
sl@0
|
33 |
// CLASS DECLARATION
|
sl@0
|
34 |
|
sl@0
|
35 |
/**
|
sl@0
|
36 |
* Main interface to the TelephonyAudioRoutingServer.
|
sl@0
|
37 |
* It implements the client-side session.
|
sl@0
|
38 |
*
|
sl@0
|
39 |
* @lib TelephonyAudioRoutingManagerSession.lib
|
sl@0
|
40 |
* @since Series 60 3.1
|
sl@0
|
41 |
*/
|
sl@0
|
42 |
|
sl@0
|
43 |
class RTelephonyAudioRoutingManagerSession : public RSessionBase
|
sl@0
|
44 |
{
|
sl@0
|
45 |
|
sl@0
|
46 |
public:
|
sl@0
|
47 |
|
sl@0
|
48 |
IMPORT_C RTelephonyAudioRoutingManagerSession();
|
sl@0
|
49 |
|
sl@0
|
50 |
public:
|
sl@0
|
51 |
|
sl@0
|
52 |
/**
|
sl@0
|
53 |
* Connects a policy client to the server.
|
sl@0
|
54 |
* @since Series 60 3.1
|
sl@0
|
55 |
* @param aAudioRoutingManager: Client, aPolicyObserver: client observer class
|
sl@0
|
56 |
* @return TInt: if connection was successful
|
sl@0
|
57 |
*/
|
sl@0
|
58 |
IMPORT_C TInt Connect(CTelephonyAudioRoutingManager& aAudioRoutingManager, MTelephonyAudioRoutingPolicyObserver& aPolicyObserver);
|
sl@0
|
59 |
|
sl@0
|
60 |
/**
|
sl@0
|
61 |
* Closes connection to the server.
|
sl@0
|
62 |
* @since Series 60 3.1
|
sl@0
|
63 |
* @param none
|
sl@0
|
64 |
* @return void
|
sl@0
|
65 |
*/
|
sl@0
|
66 |
IMPORT_C void Close();
|
sl@0
|
67 |
|
sl@0
|
68 |
/**
|
sl@0
|
69 |
* Used by policy to notify server of audio output changes.
|
sl@0
|
70 |
* @since Series 60 3.1
|
sl@0
|
71 |
* @param aOutput: client obj
|
sl@0
|
72 |
* @return void
|
sl@0
|
73 |
*/
|
sl@0
|
74 |
IMPORT_C void OutputChanged(CTelephonyAudioRouting::TAudioOutput aOutput);
|
sl@0
|
75 |
|
sl@0
|
76 |
/**
|
sl@0
|
77 |
* Used by policy to notify server that requested output change completed
|
sl@0
|
78 |
* @since Series 60 3.1
|
sl@0
|
79 |
* @param aOutput: client obj, aError: error code for operation
|
sl@0
|
80 |
* @return void
|
sl@0
|
81 |
*/
|
sl@0
|
82 |
IMPORT_C void OutputChangeCompleted(CTelephonyAudioRouting::TAudioOutput aOutput, TInt aError);
|
sl@0
|
83 |
|
sl@0
|
84 |
|
sl@0
|
85 |
/**
|
sl@0
|
86 |
* Used by policy session to get notification whenever any of the clients sends
|
sl@0
|
87 |
* a SetOutput request.
|
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 MonitorOutputChangeRequest();
|
sl@0
|
93 |
|
sl@0
|
94 |
/**
|
sl@0
|
95 |
* Sets policy session Id.
|
sl@0
|
96 |
* @since Series 60 3.1
|
sl@0
|
97 |
* @param none
|
sl@0
|
98 |
* @return void
|
sl@0
|
99 |
*/
|
sl@0
|
100 |
IMPORT_C void SetPolicySessionIdL();
|
sl@0
|
101 |
|
sl@0
|
102 |
/**
|
sl@0
|
103 |
* Cancel a previously send request.
|
sl@0
|
104 |
* @since Series 60 3.1
|
sl@0
|
105 |
* @param aRequest: request to cancel
|
sl@0
|
106 |
* @return void
|
sl@0
|
107 |
*/
|
sl@0
|
108 |
IMPORT_C void CancelRequest(TTelAudRtngServRqst aRequest);
|
sl@0
|
109 |
|
sl@0
|
110 |
/**
|
sl@0
|
111 |
* Used by policy session to notify server if the available audio
|
sl@0
|
112 |
* output change.
|
sl@0
|
113 |
* @since Series 60 3.1
|
sl@0
|
114 |
* @param aOutputs: array of available outputs
|
sl@0
|
115 |
* @return void
|
sl@0
|
116 |
*/
|
sl@0
|
117 |
IMPORT_C void AvailableOutputsChangedL(const TArray<CTelephonyAudioRouting::TAudioOutput>& aOutputs);
|
sl@0
|
118 |
|
sl@0
|
119 |
/**
|
sl@0
|
120 |
* Provide caller with iAudioOutputPkg
|
sl@0
|
121 |
* @since Series 60 3.1
|
sl@0
|
122 |
* @param none
|
sl@0
|
123 |
* @return iAudioOutputPkg
|
sl@0
|
124 |
*/
|
sl@0
|
125 |
IMPORT_C TPckgBuf<CTelephonyAudioRouting::TAudioOutput>& AudioOutputPkg();
|
sl@0
|
126 |
|
sl@0
|
127 |
private:
|
sl@0
|
128 |
|
sl@0
|
129 |
/**
|
sl@0
|
130 |
* Start asynchronous request handlers.
|
sl@0
|
131 |
* @since Series 60 3.1
|
sl@0
|
132 |
* @param aAudioRoutingManager: client obj, aPolicyObserver: observer obj for callbacks
|
sl@0
|
133 |
* @return void
|
sl@0
|
134 |
*/
|
sl@0
|
135 |
void StartPolicyRequestHandlersL( CTelephonyAudioRoutingManager& aAudioRoutingManager, MTelephonyAudioRoutingPolicyObserver& aPolicyObserver );
|
sl@0
|
136 |
|
sl@0
|
137 |
private:
|
sl@0
|
138 |
|
sl@0
|
139 |
TPckgBuf<CTelephonyAudioRouting::TAudioOutput> iAudioOutputPkg;
|
sl@0
|
140 |
CTelephonyAudioRoutingPolicyRequest* iPolicyRequest;
|
sl@0
|
141 |
TBool iConnected;
|
sl@0
|
142 |
|
sl@0
|
143 |
};
|
sl@0
|
144 |
|
sl@0
|
145 |
|
sl@0
|
146 |
#endif //TELEPHONYAUDIOROUTINGSESSION_H
|
sl@0
|
147 |
|
sl@0
|
148 |
|