|
1 /* |
|
2 * Copyright (c) 2002 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: Phone status monitor and notification |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BTMCPHONESTATUS_H |
|
20 #define BTMCPHONESTATUS_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <etelmm.h> |
|
26 #include <e32property.h> |
|
27 #include "btmcactive.h" |
|
28 #include "btmcprofileid.h" |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class CBtmcProtocol; |
|
37 class RMobilePhone; |
|
38 class CBtmcVolume; |
|
39 class CBtmcSignal; |
|
40 class CBtmcBattery; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 /** |
|
45 * CBtmcPhoneStatus listens call state events (from RMobileCall) |
|
46 * and passes them to MBtmcPhoneStatusObserver |
|
47 */ |
|
48 NONSHARABLE_CLASS(CBtmcPhoneStatus) : public CBase, public MBtmcActiveObserver |
|
49 { |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 static CBtmcPhoneStatus* NewL( |
|
56 CBtmcProtocol& aProtocol, RMobilePhone& aPhone, TBtmcProfileId aProfile); |
|
57 |
|
58 /** |
|
59 * Two-phased constructor. |
|
60 */ |
|
61 static CBtmcPhoneStatus* NewLC( |
|
62 CBtmcProtocol& aProtocol, RMobilePhone& aPhone, TBtmcProfileId aProfile); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 ~CBtmcPhoneStatus(); |
|
68 |
|
69 RMobilePhone::TMobilePhoneRegistrationStatus NetworkStatus() const; |
|
70 |
|
71 void SetVolumeControlFeatureL(TBool aEnabled); |
|
72 |
|
73 void SetVoiceRecognitionControlL(TBool aEnabled); |
|
74 |
|
75 void SetSpeakerVolumeL(TInt aHfVol); |
|
76 |
|
77 void ActivateRemoteVolumeControl(); |
|
78 |
|
79 void DeActivateRemoteVolumeControl(); |
|
80 |
|
81 TInt GetSignalStrength(); |
|
82 |
|
83 TInt GetRssiStrength(); |
|
84 |
|
85 TInt GetVolumeStatus(); |
|
86 |
|
87 TInt GetBatteryCharge(); |
|
88 |
|
89 void SetRecognitionInitiator(TBTMonoVoiceRecognitionInitiator aInitiator); |
|
90 |
|
91 void HandleNetworkRegistrationEventL( |
|
92 RMobilePhone::TMobilePhoneRegistrationStatus aOldStatus, |
|
93 RMobilePhone::TMobilePhoneRegistrationStatus aNewStatus); |
|
94 |
|
95 void HandleSpeakerVolumeEventL(TInt aVol); |
|
96 |
|
97 void HandleVoiceDialEventL(TInt aEnabled); |
|
98 |
|
99 void HandleNetworkStrengthChangeL(TInt8 aStrength); |
|
100 |
|
101 void HandleBatteryChangeL(TInt aLevel); |
|
102 |
|
103 private: // From MBtmcActiveObserver |
|
104 |
|
105 void RequestCompletedL(CBtmcActive& aActive, TInt aErr); |
|
106 |
|
107 void CancelRequest(TInt aServiceId); |
|
108 |
|
109 private: |
|
110 /** |
|
111 * C++ default constructor. |
|
112 */ |
|
113 CBtmcPhoneStatus(CBtmcProtocol& aProtocol, RMobilePhone& aPhone); |
|
114 |
|
115 /** |
|
116 * By default Symbian 2nd phase constructor is private. |
|
117 */ |
|
118 void ConstructL(TBtmcProfileId aProfile); |
|
119 |
|
120 void ReportIndicatorL(TBTMonoATPhoneIndicatorId aIndicator, TInt aValue); |
|
121 |
|
122 private: |
|
123 CBtmcProtocol& iProtocol; // unowned |
|
124 RMobilePhone& iPhone; // unowned |
|
125 |
|
126 RPointerArray<CBtmcActive> iActives; // owned, Network and speed dial subscribe |
|
127 |
|
128 // for storing current network status |
|
129 RMobilePhone::TMobilePhoneRegistrationStatus iNetworkStatus; |
|
130 // for storing new network status |
|
131 RMobilePhone::TMobilePhoneRegistrationStatus iNewNetworkStatus; |
|
132 |
|
133 // Volume control |
|
134 CBtmcVolume* iVol; |
|
135 |
|
136 // Voice dial |
|
137 RProperty iVoiceDialProperty; |
|
138 |
|
139 TBool iVoiceRecognitionEnabled; |
|
140 TBTMonoVoiceRecognitionInitiator iVoiceRecogInitiator; |
|
141 |
|
142 CBtmcSignal* iSignal; // owned |
|
143 CBtmcBattery* iBattery; // owned |
|
144 }; |
|
145 |
|
146 #endif // BTMCPHONESTATUS_H |
|
147 |
|
148 // End of File |