|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Provides a central repository observer for telephone volume |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSVPVOLUMEOBSERVER_H |
|
20 #define CSVPVOLUMEOBSERVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <cenrepnotifyhandler.h> |
|
24 #include <MTelephonyAudioRoutingObserver.h> |
|
25 #include "svputdefs.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MSVPVolumeUpdateObserver; |
|
29 class CTelephonyAudioRouting; |
|
30 |
|
31 /** |
|
32 * Provides a telephone volume for SVP session. |
|
33 * |
|
34 * @lib svp.dll |
|
35 * @since S60 3.2 |
|
36 */ |
|
37 class CSVPVolumeObserver : public CBase, |
|
38 public MCenRepNotifyHandlerCallback, |
|
39 public MTelephonyAudioRoutingObserver |
|
40 { |
|
41 public: // default constructor and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CSVPVolumeObserver* NewL( |
|
47 MSVPVolumeUpdateObserver& aObserver ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CSVPVolumeObserver(); |
|
53 |
|
54 private: |
|
55 |
|
56 // from MTelephonyAudioRoutingObserver |
|
57 |
|
58 void AvailableOutputsChanged( |
|
59 CTelephonyAudioRouting& aTelephonyAudioRouting ); |
|
60 |
|
61 void OutputChanged( CTelephonyAudioRouting& aTelephonyAudioRouting ); |
|
62 |
|
63 void SetOutputComplete( |
|
64 CTelephonyAudioRouting& aTelephonyAudioRouting, TInt aError ); |
|
65 |
|
66 // from MCenRepNotifyHandlerCallback |
|
67 |
|
68 /** |
|
69 Notifies when a generic value has been changed |
|
70 @since S60 3.2 |
|
71 @param aId Id of the key that has changed |
|
72 */ |
|
73 void HandleNotifyGeneric( TUint32 aId ); |
|
74 |
|
75 private: |
|
76 |
|
77 /** |
|
78 * C++ default constructor. |
|
79 */ |
|
80 CSVPVolumeObserver( MSVPVolumeUpdateObserver& aObserver ); |
|
81 |
|
82 /** |
|
83 * By default Symbian 2nd phase constructor is private. |
|
84 */ |
|
85 void ConstructL(); |
|
86 |
|
87 private: // Data |
|
88 |
|
89 /** |
|
90 * Current telephone IHF volume setting |
|
91 */ |
|
92 TInt iCurrentIhfVolume; |
|
93 |
|
94 /** |
|
95 * Current telephone earpiece volume setting |
|
96 */ |
|
97 TInt iCurrentEarVolume; |
|
98 |
|
99 /** |
|
100 * Current telephone mode (IHF/EARPIECE) |
|
101 */ |
|
102 TInt iMode; |
|
103 |
|
104 /** |
|
105 * Central repository instance |
|
106 * Own. |
|
107 */ |
|
108 CRepository* iRepository; |
|
109 |
|
110 /** |
|
111 * Central repository notifier instance |
|
112 * Own. |
|
113 */ |
|
114 CCenRepNotifyHandler* iNotifier; |
|
115 |
|
116 /** |
|
117 * Instance of telephony audio routing |
|
118 * used to track mode changes between ear and Ihf |
|
119 * Own. |
|
120 */ |
|
121 CTelephonyAudioRouting* iTelephonyAudioRouting; |
|
122 |
|
123 /** |
|
124 * Reference to volume upadte observer |
|
125 * Used to inform session about volume updates |
|
126 */ |
|
127 MSVPVolumeUpdateObserver& iVolumeUpdate; |
|
128 |
|
129 |
|
130 private: |
|
131 |
|
132 // For testing |
|
133 SVP_UT_DEFS |
|
134 |
|
135 }; |
|
136 |
|
137 |
|
138 |
|
139 #endif // C_SVPVOLUMEOBSERVER_H |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |