|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Declaration of CPhoneHandlerControl class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHONEHANDLERCONTROL_H |
|
20 #define CPHONEHANDLERCONTROL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "PhoneHandlerService.h" |
|
24 #include <RemConExtensionApi.h> |
|
25 #include <RemConCallHandlingTargetObserver.h> |
|
26 #include <e32base.h> |
|
27 #include <PhCltTypes.h> |
|
28 #include <e32property.h> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // DATA TYPES |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 |
|
40 // CLASS DECLARATION |
|
41 class CRemConInterfaceSelector; |
|
42 class CRemConCallHandlingTarget; |
|
43 class CPhoneHandlerResponse; |
|
44 class CPhoneHandlerCallState; |
|
45 |
|
46 /** |
|
47 * Receives call handling related key presses from accessories and executes |
|
48 * them. |
|
49 * |
|
50 * @lib PhoneCmdHandler |
|
51 * @since S60 3.1 |
|
52 */ |
|
53 NONSHARABLE_CLASS( CPhoneHandlerControl ) : public CBase, |
|
54 public MRemConCallHandlingTargetObserver |
|
55 { |
|
56 public: // Constructors and destructor |
|
57 |
|
58 /** |
|
59 * Two-phased constructor. |
|
60 */ |
|
61 static CPhoneHandlerControl* NewL( |
|
62 CRemConInterfaceSelector* aIfSelector = NULL ); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~CPhoneHandlerControl(); |
|
68 |
|
69 public: // New functions |
|
70 |
|
71 /** |
|
72 * Returns phone number for dial or speed dial. |
|
73 * @since S60 3.1 |
|
74 * @param void |
|
75 * @return TPhCltTelephoneNumber phone number |
|
76 */ |
|
77 const TPhCltTelephoneNumber& TelephoneNumber() const; |
|
78 |
|
79 /** |
|
80 * Returns voice dial status for voice dial. |
|
81 * @since S60 3.1 |
|
82 * @param void |
|
83 * @return TBool status |
|
84 */ |
|
85 const TBool& VoiceDialStatus() const; |
|
86 |
|
87 /** |
|
88 * Returns CHLD command for multiparty call. |
|
89 * @since S60 3.1 |
|
90 * @param void |
|
91 * @return TInt CHLD command |
|
92 */ |
|
93 const TInt& ChldCommand() const; |
|
94 |
|
95 /** |
|
96 * Returns CHLD call number for multiparty call. |
|
97 * @since S60 3.1 |
|
98 * @param void |
|
99 * @return TInt CHLD command number |
|
100 */ |
|
101 const TInt& ChldCallNumber() const; |
|
102 |
|
103 /** |
|
104 * Returns DTMF tone to be sent. |
|
105 * @since S60 3.1 |
|
106 * @param void |
|
107 * @return TChar DTMF tone |
|
108 */ |
|
109 const TChar& Tone() const; |
|
110 |
|
111 /** |
|
112 * Returns reference to API used to communicate with accessory who |
|
113 * initiated key press. |
|
114 * @since S60 3.1 |
|
115 * @param void |
|
116 * @return CRemConCallHandlingTarget& reference to API |
|
117 */ |
|
118 CRemConCallHandlingTarget& CommandInitiator() const; |
|
119 |
|
120 /** |
|
121 * Informs the latest call state. |
|
122 * @since S60 3.1 |
|
123 * @param aState Call state from KTelephonyCallState P&S key |
|
124 * @return void |
|
125 */ |
|
126 void NotifyCallState( const TInt aState ); |
|
127 |
|
128 /** |
|
129 * Get iSwitchCall flag, if this flag is ETrue, it means |
|
130 * "Send" key in remote target is pressed in multiparty call, |
|
131 * otherwise EFalse |
|
132 * @since S60 3.1 |
|
133 * @return TBool |
|
134 */ |
|
135 TBool SwitchCall(); |
|
136 |
|
137 |
|
138 public: // Functions from base classes |
|
139 |
|
140 protected: // New functions |
|
141 |
|
142 protected: // Functions from base classes |
|
143 |
|
144 private: |
|
145 |
|
146 /** |
|
147 * C++ default constructor. |
|
148 */ |
|
149 CPhoneHandlerControl(); |
|
150 |
|
151 /** |
|
152 * By default Symbian 2nd phase constructor is private. |
|
153 */ |
|
154 void ConstructL( CRemConInterfaceSelector* aIfSelector = NULL ); |
|
155 |
|
156 /** |
|
157 * From MRemConCallHandlingTargetObserver. Answer an incoming phone call. |
|
158 */ |
|
159 virtual void AnswerCall(); |
|
160 |
|
161 /** |
|
162 * From MRemConCallHandlingTargetObserver. End an incoming/ongoing |
|
163 * phone call. |
|
164 */ |
|
165 virtual void EndCall(); |
|
166 |
|
167 /** |
|
168 * From MRemConCallHandlingTargetObserver. Answer an incoming phone call, |
|
169 * or end an ongoing call according to call status. |
|
170 */ |
|
171 virtual void AnswerEndCall(); |
|
172 |
|
173 /** |
|
174 * From MRemConCallHandlingTargetObserver. Make a voice call. |
|
175 */ |
|
176 virtual void VoiceDial( const TBool aActivate ); |
|
177 |
|
178 /** |
|
179 * From MRemConCallHandlingTargetObserver. Redial last phone call. |
|
180 */ |
|
181 virtual void LastNumberRedial(); |
|
182 |
|
183 /** |
|
184 * From MRemConCallHandlingTargetObserver. Dial a phone call. |
|
185 */ |
|
186 virtual void DialCall( const TDesC8& aTelNumber ); |
|
187 |
|
188 /** |
|
189 * From MRemConCallHandlingTargetObserver. Make multiparty call. |
|
190 */ |
|
191 virtual void MultipartyCalling( const TDesC8& aData ); |
|
192 |
|
193 /** |
|
194 * Generates DTMF signal. |
|
195 */ |
|
196 virtual void GenerateDTMF( const TChar aChar ); |
|
197 |
|
198 /** |
|
199 * From MRemConCallHandlingTargetObserver. Make a speed dial call. |
|
200 */ |
|
201 virtual void SpeedDial( const TInt aIndex ); |
|
202 |
|
203 /** |
|
204 * Starts processing service corresponding to key press. |
|
205 */ |
|
206 void StartProcessing( |
|
207 const TRemConExtCallHandlingApiOperationId aOperation ); |
|
208 |
|
209 /** |
|
210 * Creates service. |
|
211 */ |
|
212 MPhoneHandlerService* CreateServiceL( |
|
213 const TRemConExtCallHandlingApiOperationId aOperation ); |
|
214 |
|
215 /** |
|
216 * Initializes speed dial. |
|
217 */ |
|
218 void InitializeSpeedDialL(); |
|
219 |
|
220 /** |
|
221 * Returns call status. |
|
222 */ |
|
223 void CallStatusL( RPhone::TLineInfo& aLineInfo ); |
|
224 |
|
225 /** |
|
226 * Returns autolock status |
|
227 */ |
|
228 TBool IsAutoLockOn() const; |
|
229 |
|
230 /** |
|
231 * Returns BT accessory command status |
|
232 */ |
|
233 TBool IsBTAccessoryCmd() const; |
|
234 |
|
235 private: // Data |
|
236 |
|
237 // Provides e.g. service to listen accessory key presses. |
|
238 CRemConInterfaceSelector* iInterfaceSelector; // owned |
|
239 |
|
240 // API notifying PhoneCmdHandler about call handling key presses. |
|
241 CRemConCallHandlingTarget* iTarget; // owned |
|
242 |
|
243 // Phone number for dial call/speed dial. |
|
244 TPhCltTelephoneNumber iTelNumber; |
|
245 |
|
246 // Voice recognition status |
|
247 TBool iActivate; |
|
248 |
|
249 // Multiparty call command |
|
250 TInt iChldCommand; |
|
251 |
|
252 // Multiparty call number |
|
253 TInt iChldCallNumber; |
|
254 |
|
255 // Type of DTMF tone |
|
256 TChar iChar; |
|
257 |
|
258 // Speed dial index. |
|
259 TInt iIndex; |
|
260 |
|
261 // Sends responses to RemCon FW |
|
262 CPhoneHandlerResponse* iResponse; |
|
263 |
|
264 // Interface to P&S key that returns call state |
|
265 RProperty iProperty; |
|
266 |
|
267 // Previous call state |
|
268 TInt iPrevState; |
|
269 |
|
270 // Number of active calls |
|
271 // Used to determine whether there's a multicall case when call state |
|
272 TInt iActiveCalls; |
|
273 |
|
274 // switch phonecall by press "Send" key |
|
275 TBool iSwitchCall; |
|
276 |
|
277 // Listens to phone call state changes. |
|
278 CPhoneHandlerCallState* iCallStateObserver; |
|
279 |
|
280 |
|
281 public: // Friend classes |
|
282 |
|
283 protected: // Friend classes |
|
284 |
|
285 private: // Friend classes |
|
286 |
|
287 }; |
|
288 |
|
289 #endif // CPHONEHANDLERCONTROL_H |
|
290 |
|
291 // End of File |