1 /* |
|
2 * Copyright (c) 2008-2009 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: Accessory and Bluetooth handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHONEACCESSORYBTHANDLER_H_ |
|
20 #define CPHONEACCESSORYBTHANDLER_H_ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <pevirtualengine.h> |
|
25 #include <mphoneneclearedhandler.h> |
|
26 #include <mphonestatemachine.h> |
|
27 #include <mphoneviewcommandhandle.h> |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * It waits for bluetooth audio disconnection and |
|
33 * shows query when it happens. |
|
34 * |
|
35 */ |
|
36 NONSHARABLE_CLASS( CPhoneAccessoryBTHandler ) : public CBase |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Two-phased constructor |
|
42 * @param aViewCommandHandle reference to View Command Handler |
|
43 * @param aStateMachine: reference to Phone UI state machine |
|
44 * @return an instance of class CPhoneAccessoryBTHandler |
|
45 */ |
|
46 static CPhoneAccessoryBTHandler* NewLC( MPhoneViewCommandHandle* aViewCommandHandle, |
|
47 MPhoneStateMachine* aStateMachine, MPhoneNEClearedHandler* aNEClearedHandler ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 ~CPhoneAccessoryBTHandler(); |
|
53 |
|
54 |
|
55 /** |
|
56 * Sets BT debug mode on. |
|
57 */ |
|
58 void SetBTDebugModeL(); |
|
59 |
|
60 /** |
|
61 * Set the BT handsfree mode |
|
62 * @param aHandsfreeMode ETrue to activate BT, EFalse to deactivate |
|
63 * @return ETrue if allowed |
|
64 */ |
|
65 TBool SetBTHandsfreeModeL( TBool aHandsfreeMode ); |
|
66 |
|
67 /** |
|
68 * Set the handsfree mode |
|
69 * @param aHandsfreeMode ETrue to activate IHF, EFalse to deactivate |
|
70 * @return ETrue if allowed |
|
71 */ |
|
72 TBool SetHandsfreeModeL( TBool aHandsfreeMode ); |
|
73 |
|
74 /** |
|
75 * Shows BT address |
|
76 */ |
|
77 void ShowBTAddressL(); |
|
78 |
|
79 /** |
|
80 * Shows BT loopback status note |
|
81 */ |
|
82 void ShowBTLoopbackL(); |
|
83 |
|
84 /** |
|
85 * Shows BT activated note |
|
86 */ |
|
87 void ShowBTActivatedL(); |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 * C++ constructor. |
|
93 */ |
|
94 CPhoneAccessoryBTHandler( MPhoneViewCommandHandle* aViewCommandHandle, |
|
95 MPhoneStateMachine* aStateMachine, MPhoneNEClearedHandler* aNEClearedHandler ); |
|
96 |
|
97 /** |
|
98 * Set the handsfree mode |
|
99 * @param aHandsfreeMode ETrue to activate, EFalse to deactivate |
|
100 * @param aAudioOutput audio output |
|
101 * @return ETrue if allowed |
|
102 */ |
|
103 TBool DoSetHandsfreeModeL( TBool aHandsfreeMode, TPEAudioOutput aAudioOutput ); |
|
104 |
|
105 private: // Data |
|
106 |
|
107 /** |
|
108 * Reference to the Phone UI View command handle |
|
109 */ |
|
110 MPhoneViewCommandHandle* iViewCommandHandle; |
|
111 |
|
112 /** |
|
113 * Reference to State machine |
|
114 */ |
|
115 MPhoneStateMachine* iStateMachine; |
|
116 |
|
117 /** |
|
118 * Reference to handler for Number Entry cleared event |
|
119 */ |
|
120 MPhoneNEClearedHandler* iNEClearedHandler; |
|
121 |
|
122 }; |
|
123 |
|
124 |
|
125 #endif /*CPHONEACCESSORYBTHANDLER_H_*/ |
|