author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:31:22 +0300 | |
branch | RCL_3 |
changeset 81 | c26cc2a7c548 |
parent 62 | 5266b1f337bd |
permissions | -rw-r--r-- |
62 | 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 ); |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
76 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
77 |
/** |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
78 |
* Update control using the specified data |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
79 |
* @param aCommandParam command parameter |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
80 |
*/ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
81 |
void HandleMuteChange( TPhoneCommandParam* aCommandParam ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
82 |
|
62 | 83 |
/** |
84 |
* Gets volume level from navi pane control. |
|
85 |
* @return Volume level. |
|
86 |
*/ |
|
87 |
TInt VolumeLevelFromControl(); |
|
88 |
||
89 |
private: // MCoeControlObserver |
|
90 |
||
91 |
void HandleControlEventL( CCoeControl* aControl, |
|
92 |
TCoeEvent aEventType ); |
|
93 |
||
94 |
private: // MCoeForegroundObserver |
|
95 |
||
96 |
/** |
|
97 |
* Handles the application coming to the foreground. |
|
98 |
*/ |
|
99 |
void HandleGainingForeground(); |
|
100 |
||
101 |
/** |
|
102 |
* Handles the application going into the background. |
|
103 |
*/ |
|
104 |
void HandleLosingForeground(); |
|
105 |
||
106 |
private: |
|
107 |
||
108 |
/** |
|
109 |
* C++ constructor. |
|
110 |
*/ |
|
111 |
CPhoneAudioController(); |
|
112 |
||
113 |
/** |
|
114 |
* Symbian OS constructor. |
|
115 |
*/ |
|
116 |
void ConstructL(); |
|
117 |
||
118 |
/** |
|
119 |
* Update indicator. |
|
120 |
*/ |
|
121 |
void ActivateL(); |
|
122 |
||
123 |
/** |
|
124 |
* Recovery system callback |
|
125 |
*/ |
|
126 |
static TInt DoRecoverActivateL( TAny* aAny ); |
|
127 |
||
128 |
/** |
|
129 |
* Pushes new decorator to navi pane replacing the |
|
130 |
* previous one if needed. |
|
131 |
* @param aNew new to replace the old one. |
|
132 |
*/ |
|
133 |
void PushL(CAknNavigationDecorator& aNew); |
|
134 |
||
135 |
/** |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
136 |
* Callback function. Called when navi pane should be updated |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
137 |
* back to default. |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
138 |
* @param aAny pointer to instance of this class. |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
139 |
* @return KErrNone always. |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
140 |
*/ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
141 |
static TInt DoUpdateNaviPaneToDefault( TAny* aAny ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
142 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
143 |
/** |
62 | 144 |
* Get current volume decorator (Ihf or Ear) |
145 |
* @return Current volume decorator |
|
146 |
*/ |
|
147 |
CAknNavigationDecorator& VolumeDecorator(); |
|
148 |
||
149 |
/** |
|
150 |
* Get current volume control (Ihf or Ear) |
|
151 |
* @return Current volume control (Ihf or Ear) |
|
152 |
*/ |
|
153 |
CAknVolumeControl& VolumeControl(); |
|
154 |
||
155 |
/** |
|
156 |
* Get current volume level (Ihf or Ear) |
|
157 |
* @return Current Ihf or Ear volume level |
|
158 |
*/ |
|
159 |
TInt VolumeLevel(); |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
160 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
161 |
/** |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
162 |
* Select decorator based on current audio status |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
163 |
* @return Selected decorator (Ihf, Ear or Muted). |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
164 |
*/ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
165 |
CAknNavigationDecorator& SelectDecoratorL(); |
62 | 166 |
|
167 |
/** |
|
168 |
* Set volume level for given volume control |
|
169 |
* @param aVolumeControl Volume control |
|
170 |
* @param aVolumeLevel New volume level |
|
171 |
*/ |
|
172 |
void SetVolumeLevel(CAknVolumeControl& aVolumeControl, TInt aVolumeLevel); |
|
173 |
||
174 |
private: // Data |
|
175 |
||
176 |
// Recovery id for activating volume control |
|
177 |
TInt iActivateRecoveryId; |
|
178 |
||
179 |
CPhoneStatusPane* iStatusPane; |
|
180 |
||
181 |
// Count the volume control activations |
|
182 |
TInt iVolumeControlCount; |
|
183 |
||
184 |
// Owned IHF volume control |
|
185 |
CAknNavigationDecorator* iIhfVolumeControl; |
|
186 |
||
187 |
// IHF volume, from 1 to 10 |
|
188 |
TInt iIhfVolume; |
|
189 |
||
190 |
// ETrue IHF is active |
|
191 |
TBool iIhfMode; |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
192 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
193 |
// ETrue if transfer to or from IHF pending |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
194 |
TBool iIhfTransferPending; |
62 | 195 |
|
196 |
// Owned non-IHF volume control. |
|
197 |
CAknNavigationDecorator* iEarVolumeControl; |
|
198 |
||
199 |
// Non-IHF volume, from 1 to 10 |
|
200 |
TInt iEarVolume; |
|
201 |
||
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
202 |
// Owned muted indicator |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
203 |
CAknNavigationDecorator* iMutedControl; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
204 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
205 |
// ETrue phone is muted |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
206 |
TBool iMuted; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
207 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
208 |
// ETrue if timed control transfer to muted is pending |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
209 |
TBool iTimedMuteTransferPending; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
210 |
|
62 | 211 |
// Pointer the current control that is in navi pane |
212 |
CAknNavigationDecorator* iOldControl; |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
213 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
214 |
// Owned timer to update navi pane |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
215 |
CPhoneTimer* iNaviPaneUpdateTimer; |
62 | 216 |
|
217 |
/** |
|
218 |
* ETrue if Telephony is the foreground application, |
|
219 |
* otherwise EFalse. |
|
220 |
*/ |
|
221 |
TBool iPhoneInForeground; |
|
222 |
||
223 |
}; |
|
224 |
||
225 |
#endif // CPHONEAUDIOCONTROLLER_H |
|
226 |
||
227 |
// End of File |