|
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 #ifndef CPOSSIMULATIONPOSITIONER_H |
|
21 #define CPOSSIMULATIONPOSITIONER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <lbs.h> |
|
25 #include <lbs/epos_cpositioner.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CPosControllerBase; |
|
29 class CPosControllerManager; |
|
30 /** |
|
31 * Used to get simulated position info. |
|
32 */ |
|
33 class CPosSimulationPositioner : public CPositioner |
|
34 { |
|
35 public: // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 */ |
|
40 static CPosSimulationPositioner* NewL(TAny* aConstructionParameters); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 ~CPosSimulationPositioner(); |
|
46 |
|
47 public: // New functions |
|
48 |
|
49 /** |
|
50 * Completes an ongoing request. |
|
51 * |
|
52 * @param aStatus The request status. |
|
53 * @param aCompleteCode The code to complete the request with. |
|
54 */ |
|
55 void CompleteRequest( |
|
56 /* IN */ TRequestStatus& aStatus, |
|
57 /* IN */ TInt aCompleteCode |
|
58 ); |
|
59 |
|
60 /** |
|
61 * Reports status back to MLFW. |
|
62 * |
|
63 * @param aDeviceStatus A device status to report. |
|
64 * @param aDataQualityStatus A quality status to report. |
|
65 */ |
|
66 void ReportStatus( |
|
67 /* IN */ TInt aDeviceStatus = KErrNotFound, |
|
68 /* IN */ TInt aDataQualityStatus = KErrNotFound |
|
69 ); |
|
70 |
|
71 /** |
|
72 * Partial updates allowed from requestor. |
|
73 * |
|
74 * @return ETrue if requester allow partial updates, |
|
75 * EFalse otherwise. |
|
76 */ |
|
77 TBool PartialUpdateAllowed() const; |
|
78 |
|
79 /** |
|
80 * Clears position info and |
|
81 * sets correct module ID and correct update type. |
|
82 * |
|
83 * @param aPosInfo Position info object to clear. |
|
84 */ |
|
85 static void ClearAndSetDefaultPositionData( |
|
86 /* IN/OUT */ TPositionInfoBase& aPosInfo |
|
87 ); |
|
88 |
|
89 protected: // Functions from base classes |
|
90 |
|
91 /** |
|
92 * From CPositioner. Requests position info asynchronously. |
|
93 * |
|
94 * @param aPosInfo A reference to a position info object. This object |
|
95 * must be in scope until the request has completed. |
|
96 * @param aStatus The request status |
|
97 */ |
|
98 void NotifyPositionUpdate( |
|
99 /* IN/OUT */ TPositionInfoBase& aPosInfo, |
|
100 /* OUT */ TRequestStatus& aStatus |
|
101 ); |
|
102 |
|
103 /** |
|
104 * From CPositioner. Cancels position info request. |
|
105 */ |
|
106 void CancelNotifyPositionUpdate(); |
|
107 |
|
108 private: |
|
109 |
|
110 /** |
|
111 * C++ default constructor. |
|
112 */ |
|
113 CPosSimulationPositioner(); |
|
114 |
|
115 /** |
|
116 * By default EPOC constructor is private. |
|
117 */ |
|
118 void ConstructL(TAny* aConstructionParameters); |
|
119 |
|
120 /** |
|
121 * Set the device status. |
|
122 * |
|
123 * @param aStatus The device status. |
|
124 */ |
|
125 void SetDeviceStatus( |
|
126 /* IN */ TPositionModuleStatus::TDeviceStatus aStatus |
|
127 ); |
|
128 |
|
129 /** |
|
130 * Set the data quality status. |
|
131 * |
|
132 * @param aStatus The data quality status to set. |
|
133 */ |
|
134 void SetDataQualityStatus( |
|
135 /* IN */ TPositionModuleStatus::TDataQualityStatus aStatus |
|
136 ); |
|
137 |
|
138 // By default, prohibit copy constructor |
|
139 CPosSimulationPositioner( const CPosSimulationPositioner& ); |
|
140 // Prohibit assigment operator |
|
141 CPosSimulationPositioner& operator= ( const CPosSimulationPositioner& ); |
|
142 |
|
143 /** |
|
144 * Retrieve max fix age and check if the previously stored fix can be used. |
|
145 * |
|
146 * @return ETrue if the stored fix is within max fix age, EFalse otherwise |
|
147 * or if there is no previously stored fix. |
|
148 */ |
|
149 TBool CanUseLastFix() const; |
|
150 |
|
151 private: // Data |
|
152 CPosControllerBase* iController; |
|
153 CPosControllerManager* iControllerManager; |
|
154 TPositionModuleStatus iModuleStatus; |
|
155 TPositionInfoBase* iPosInfo; |
|
156 |
|
157 }; |
|
158 |
|
159 #endif // CPOSSIMULATIONPOSITIONER_H |
|
160 |
|
161 // End of File |
|
162 |