|
1 /* |
|
2 * Copyright (c) 2005-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef BTGPSNOKNIGHTMODEHANDLER_H |
|
22 #define BTGPSNOKNIGHTMODEHANDLER_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32base.h> |
|
27 #include "BTGPSSettingsApi.h" |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 // MACROS |
|
32 |
|
33 // DATA TYPES |
|
34 |
|
35 // FUNCTION PROTOTYPES |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CBTGPSConnectManager; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * Handler for Nokia BT GPS night mode feature. This class will set |
|
44 * set mode to connected Nokia BT GPS device according to setting. It will |
|
45 * check the response from Nokia BT GPS device and retry to set the night |
|
46 * mode setting if not correct response is received within timeout. |
|
47 * |
|
48 */ |
|
49 class CBTGPSNokNightModeHandler: public CBase |
|
50 { |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Two-phase construction. |
|
55 * @param aConnectManager Reference to connect manager |
|
56 * @param aNightModeStatus Noght mode status in setting |
|
57 */ |
|
58 static CBTGPSNokNightModeHandler * NewL( |
|
59 CBTGPSConnectManager& aConnectManager, |
|
60 TBTGPSSettingsApi::TNightModeState aNightModeStatus); |
|
61 |
|
62 /** |
|
63 * Destructor |
|
64 */ |
|
65 virtual ~CBTGPSNokNightModeHandler(); |
|
66 |
|
67 private: |
|
68 |
|
69 /** |
|
70 * Second phase of the construction |
|
71 */ |
|
72 void ConstructL(); |
|
73 |
|
74 /** |
|
75 * Private constructor |
|
76 */ |
|
77 CBTGPSNokNightModeHandler( |
|
78 CBTGPSConnectManager& aConnectManager, |
|
79 TBTGPSSettingsApi::TNightModeState aNightModeStatus); |
|
80 |
|
81 /** |
|
82 * Timer call back |
|
83 */ |
|
84 void TimerTick(); |
|
85 |
|
86 /** |
|
87 * Static timer callback |
|
88 */ |
|
89 static TInt TimerCallback(TAny* aAny); |
|
90 |
|
91 /** |
|
92 * Send night mode setting message |
|
93 */ |
|
94 void SetNightModeSetting(); |
|
95 |
|
96 private: |
|
97 //Connect manager |
|
98 CBTGPSConnectManager& iConnectManager; |
|
99 |
|
100 //Night mode status |
|
101 TBTGPSSettingsApi::TNightModeState iNightModeStatus; |
|
102 |
|
103 //Timer |
|
104 CPeriodic* iTimer; |
|
105 }; |
|
106 #endif |
|
107 // End of File |
|
108 |