|
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 BTGPSINITMANAGER_H |
|
22 #define BTGPSINITMANAGER_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32base.h> |
|
27 #include "BTGPSDeviceListener.h" |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 // MACROS |
|
32 |
|
33 // DATA TYPES |
|
34 |
|
35 // FUNCTION PROTOTYPES |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CBTGPSConnectManager; |
|
39 class CBTGPSDeviceManager; |
|
40 class CBTGPSNokGpsDetector; |
|
41 class CBTGPSNokGpsInitialiser; |
|
42 class CBTGPSNormalGpsInitialiser; |
|
43 class CBTGPSSettingManager; |
|
44 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 /** |
|
48 * This class defines manager that controls device initialisation. When |
|
49 * this manager get device connect status from device manager that device |
|
50 * is connected it will start initialisation procedure. If device type is |
|
51 * unkown, it will first detect BT device type by sending PNok message and |
|
52 * detect if message received from BT device is valid NMEA sentence. After |
|
53 * the connected device is initialised, it will update device status from |
|
54 * device manager. |
|
55 * |
|
56 */ |
|
57 class CBTGPSInitManager: public CBase, private MBTGPSDeviceListener |
|
58 { |
|
59 public: |
|
60 |
|
61 /** |
|
62 * Two-phase construction. |
|
63 * @param aConnectManager Reference to connect manager |
|
64 * @param aDeviceManager Reference to device manager |
|
65 * @param aSettingManager Reference to setting manager |
|
66 */ |
|
67 static CBTGPSInitManager * NewL( |
|
68 CBTGPSConnectManager& aConnectManager, |
|
69 CBTGPSDeviceManager& aDeviceManager, |
|
70 CBTGPSSettingManager& aSettingManager); |
|
71 |
|
72 /** |
|
73 * Destructor |
|
74 */ |
|
75 virtual ~CBTGPSInitManager(); |
|
76 |
|
77 private: |
|
78 /** |
|
79 * From MBTGPSDeviceListener |
|
80 */ |
|
81 virtual void BTDeviceStatusChanged( |
|
82 TInt aConnectStatus, |
|
83 TInt aDeviceType, |
|
84 TInt aErr=KErrNone); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * Second phase of the construction |
|
90 */ |
|
91 void ConstructL(); |
|
92 |
|
93 /** |
|
94 * Private constructor |
|
95 */ |
|
96 CBTGPSInitManager( |
|
97 CBTGPSConnectManager& aConnectManager, |
|
98 CBTGPSDeviceManager& aDeviceManager, |
|
99 CBTGPSSettingManager& aSettingManager); |
|
100 |
|
101 private: |
|
102 //Connect Manager |
|
103 CBTGPSConnectManager& iConnectManager; |
|
104 |
|
105 //Device manager |
|
106 CBTGPSDeviceManager& iDeviceManager; |
|
107 |
|
108 //Setting manager |
|
109 CBTGPSSettingManager& iSettingManager; |
|
110 |
|
111 //Nok GPS detector |
|
112 CBTGPSNokGpsDetector* iNokGpsDetector; |
|
113 |
|
114 //Nok GPS Initialiser |
|
115 CBTGPSNokGpsInitialiser* iNokGpsInitialiser; |
|
116 |
|
117 //Normal GPS Initialiser |
|
118 CBTGPSNormalGpsInitialiser* iNormalGpsInitialiser; |
|
119 |
|
120 }; |
|
121 #endif |
|
122 // End of File |
|
123 |