|
1 /* |
|
2 * Copyright (c) 2007 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 the License "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 #ifndef GPSOBSERVER_H |
|
20 #define GPSOBSERVER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <e32property.h> |
|
25 #include <npscript.h> |
|
26 #include <lbs.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CGpsPlugin; |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 // State enum and member variable |
|
34 |
|
35 // CLASS DECLARATIONS |
|
36 /** |
|
37 * CGpsObserver. |
|
38 * Controller class for handling browser widget requests |
|
39 * @lib npGpsPlugin.lib |
|
40 * @since S60 v3.2 |
|
41 */ |
|
42 NONSHARABLE_CLASS(CGpsObserver) : public CActive |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * C++ default constructor. |
|
47 */ |
|
48 static CGpsObserver* NewL( CGpsPlugin* aPlugin ); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CGpsObserver(); |
|
54 |
|
55 public: |
|
56 /** |
|
57 * Request network status change notification. |
|
58 * @since 3.2 |
|
59 * @param name of the callback |
|
60 * @return void |
|
61 */ |
|
62 void RequestNotificationL( const NPString& aEvent ); |
|
63 |
|
64 /* |
|
65 * Gets latitude |
|
66 * @since 3.2 |
|
67 * @return latitude |
|
68 */ |
|
69 TReal Latitude() const; |
|
70 |
|
71 /* |
|
72 * Gets longitude. |
|
73 * @since 3.2 |
|
74 * @return longitude |
|
75 */ |
|
76 TReal Longitude() const; |
|
77 |
|
78 /* |
|
79 * Gets altitude |
|
80 * @since 3.2 |
|
81 * @return altitude |
|
82 */ |
|
83 TReal Altitude() const; |
|
84 |
|
85 /* |
|
86 * Gets horizontal accuracy |
|
87 * @since 3.2 |
|
88 * @return horizontal accuracy |
|
89 */ |
|
90 TReal HorizontalAccuracy() const; |
|
91 |
|
92 /* |
|
93 * Gets vertical accuracy |
|
94 * @since 3.2 |
|
95 * @return vertical accuracy |
|
96 */ |
|
97 TReal VerticalAccuracy() const; |
|
98 |
|
99 /* |
|
100 * Gets tick count for the current sample |
|
101 * @since 3.2 |
|
102 * @return |
|
103 */ |
|
104 TInt TickCount() const; |
|
105 |
|
106 protected: // CActive |
|
107 /** |
|
108 * Implements cancellation of an outstanding request. |
|
109 * @param none |
|
110 * @return void |
|
111 */ |
|
112 void DoCancel(); |
|
113 |
|
114 /** |
|
115 * Handles an active object’s request completion event. |
|
116 * @param none |
|
117 * @return void |
|
118 */ |
|
119 void RunL(); |
|
120 |
|
121 /** |
|
122 * Handles an active object’s error |
|
123 * @param error |
|
124 * @return void |
|
125 */ |
|
126 TInt RunError(TInt aError); |
|
127 |
|
128 protected: |
|
129 /** |
|
130 * C++ default constructor. |
|
131 */ |
|
132 CGpsObserver(CGpsPlugin* aPlugin); |
|
133 |
|
134 /** |
|
135 * C++ default constructor. |
|
136 */ |
|
137 void ConstructL(); |
|
138 |
|
139 protected: |
|
140 CGpsPlugin* iGpsPlugin; |
|
141 |
|
142 RPositionServer iServer; |
|
143 RPositioner iPositioner; |
|
144 TPositionInfo iPositionInfo; |
|
145 TPosition iPosition; |
|
146 |
|
147 TInt iTickCount; |
|
148 HBufC8* iEventHandler; |
|
149 }; |
|
150 |
|
151 #endif // GPSOBSERVER_H |
|
152 |
|
153 // End of File |