|
1 /* |
|
2 * Copyright (c) 2002-2006 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: It manages incall indicator. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHONEAUDIOCONTROLLER_H |
|
20 #define CPHONEAUDIOCONTROLLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CPhoneStatusPane; |
|
27 class TPhoneCommandParam; |
|
28 class CPhoneTimer; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * It manages navi pane audio indicators |
|
34 * |
|
35 * @since 1.0 |
|
36 */ |
|
37 class CPhoneAudioController : public CBase, public MCoeControlObserver, |
|
38 public MCoeForegroundObserver |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * @return new instance. |
|
45 */ |
|
46 static CPhoneAudioController* NewL(); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 ~CPhoneAudioController(); |
|
52 |
|
53 public: // New functions |
|
54 |
|
55 /** |
|
56 * Activates voice volume control. |
|
57 */ |
|
58 void ActivateVolumeControlL(); |
|
59 |
|
60 /** |
|
61 * Deactivate voice volume control. |
|
62 */ |
|
63 void DeactivateVolumeControl(); |
|
64 |
|
65 /** |
|
66 * Update control using the specified data |
|
67 * @param aCommandParam command parameter |
|
68 */ |
|
69 void HandleVolumeChangeL( TPhoneCommandParam* aCommandParam ); |
|
70 |
|
71 /** |
|
72 * Update control using the specified data |
|
73 * @param aCommandParam command parameter |
|
74 */ |
|
75 void HandleIhfChange( TPhoneCommandParam* aCommandParam ); |
|
76 |
|
77 /** |
|
78 * Gets volume level from navi pane control. |
|
79 * @return Volume level. |
|
80 */ |
|
81 TInt VolumeLevelFromControl(); |
|
82 |
|
83 private: // MCoeControlObserver |
|
84 |
|
85 void HandleControlEventL( CCoeControl* aControl, |
|
86 TCoeEvent aEventType ); |
|
87 |
|
88 private: // MCoeForegroundObserver |
|
89 |
|
90 /** |
|
91 * Handles the application coming to the foreground. |
|
92 */ |
|
93 void HandleGainingForeground(); |
|
94 |
|
95 /** |
|
96 * Handles the application going into the background. |
|
97 */ |
|
98 void HandleLosingForeground(); |
|
99 |
|
100 private: |
|
101 |
|
102 /** |
|
103 * C++ constructor. |
|
104 */ |
|
105 CPhoneAudioController(); |
|
106 |
|
107 /** |
|
108 * Symbian OS constructor. |
|
109 */ |
|
110 void ConstructL(); |
|
111 |
|
112 /** |
|
113 * Update indicator. |
|
114 */ |
|
115 void ActivateL(); |
|
116 |
|
117 /** |
|
118 * Recovery system callback |
|
119 */ |
|
120 static TInt DoRecoverActivateL( TAny* aAny ); |
|
121 |
|
122 /** |
|
123 * Pushes new decorator to navi pane replacing the |
|
124 * previous one if needed. |
|
125 * @param aNew new to replace the old one. |
|
126 */ |
|
127 void PushL(CAknNavigationDecorator& aNew); |
|
128 |
|
129 /** |
|
130 * Get current volume decorator (Ihf or Ear) |
|
131 * @return Current volume decorator |
|
132 */ |
|
133 CAknNavigationDecorator& VolumeDecorator(); |
|
134 |
|
135 /** |
|
136 * Get current volume control (Ihf or Ear) |
|
137 * @return Current volume control (Ihf or Ear) |
|
138 */ |
|
139 CAknVolumeControl& VolumeControl(); |
|
140 |
|
141 /** |
|
142 * Get current volume level (Ihf or Ear) |
|
143 * @return Current Ihf or Ear volume level |
|
144 */ |
|
145 TInt VolumeLevel(); |
|
146 |
|
147 /** |
|
148 * Set volume level for given volume control |
|
149 * @param aVolumeControl Volume control |
|
150 * @param aVolumeLevel New volume level |
|
151 */ |
|
152 void SetVolumeLevel(CAknVolumeControl& aVolumeControl, TInt aVolumeLevel); |
|
153 |
|
154 private: // Data |
|
155 |
|
156 // Recovery id for activating volume control |
|
157 TInt iActivateRecoveryId; |
|
158 |
|
159 CPhoneStatusPane* iStatusPane; |
|
160 |
|
161 // Count the volume control activations |
|
162 TInt iVolumeControlCount; |
|
163 |
|
164 // Owned IHF volume control |
|
165 CAknNavigationDecorator* iIhfVolumeControl; |
|
166 |
|
167 // IHF volume, from 1 to 10 |
|
168 TInt iIhfVolume; |
|
169 |
|
170 // ETrue IHF is active |
|
171 TBool iIhfMode; |
|
172 |
|
173 // Owned non-IHF volume control. |
|
174 CAknNavigationDecorator* iEarVolumeControl; |
|
175 |
|
176 // Non-IHF volume, from 1 to 10 |
|
177 TInt iEarVolume; |
|
178 |
|
179 // Pointer the current control that is in navi pane |
|
180 CAknNavigationDecorator* iOldControl; |
|
181 |
|
182 |
|
183 /** |
|
184 * ETrue if Telephony is the foreground application, |
|
185 * otherwise EFalse. |
|
186 */ |
|
187 TBool iPhoneInForeground; |
|
188 |
|
189 }; |
|
190 |
|
191 #endif // CPHONEAUDIOCONTROLLER_H |
|
192 |
|
193 // End of File |