|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "EPos_CPosFixedDataController.h" |
|
20 |
|
21 const TReal64 KDefaultLatitude = 0.0; |
|
22 const TReal64 KDefaultLongitude = 0.0; |
|
23 const TReal32 KDefaultAltitude = 0.0; |
|
24 const TReal32 KDefaultHorzAccuracy = 0.0; |
|
25 const TReal32 KDefaultVertAccuracy = 0.0; |
|
26 |
|
27 // ================= MEMBER FUNCTIONS ======================= |
|
28 |
|
29 // C++ default constructor can NOT contain any code, that |
|
30 // might leave. |
|
31 // |
|
32 CPosFixedDataController::CPosFixedDataController():CPosControllerBase(EFalse) |
|
33 { |
|
34 CActiveScheduler::Add(this); |
|
35 } |
|
36 |
|
37 // EPOC default constructor can leave. |
|
38 void CPosFixedDataController::ConstructL() |
|
39 { |
|
40 // Left empty intentionally |
|
41 } |
|
42 |
|
43 // Two-phased constructor. |
|
44 CPosFixedDataController* CPosFixedDataController::NewL() |
|
45 { |
|
46 CPosFixedDataController* self = new (ELeave) CPosFixedDataController(); |
|
47 CleanupStack::PushL(self); |
|
48 self->ConstructL(); |
|
49 CleanupStack::Pop(self); |
|
50 return self; |
|
51 } |
|
52 |
|
53 // Destructor |
|
54 CPosFixedDataController::~CPosFixedDataController() |
|
55 { |
|
56 Cancel(); |
|
57 } |
|
58 |
|
59 // ---------------------------------------------------------------------------- |
|
60 // CPosFixedDataController::NotifyPositionUpdate |
|
61 // |
|
62 // (other items were commented in a header). |
|
63 // ---------------------------------------------------------------------------- |
|
64 // |
|
65 void CPosFixedDataController::NotifyPositionUpdate( |
|
66 TPositionInfoBase& aPosInfo, |
|
67 TRequestStatus& aStatus, |
|
68 CPosSimulationPositioner& aSimPos |
|
69 ) |
|
70 { |
|
71 aStatus = KRequestPending; |
|
72 NotifyPositionUpdateBase(aPosInfo, aStatus, aSimPos); |
|
73 |
|
74 // Here we set the default values |
|
75 TPosition pos; |
|
76 |
|
77 pos.SetCoordinate(KDefaultLatitude,KDefaultLongitude,KDefaultAltitude); |
|
78 pos.SetAccuracy(KDefaultHorzAccuracy,KDefaultVertAccuracy); |
|
79 pos.SetDatum(KPositionDatumWgs84); |
|
80 pos.SetCurrentTime(); |
|
81 |
|
82 // Now we set the |
|
83 iPosition.SetPosition(pos); |
|
84 // Complete the request which will result in the RunL being called. |
|
85 if(!IsActive()) |
|
86 { |
|
87 TRequestStatus* status = &iStatus; |
|
88 iStatus = KErrNone; |
|
89 User::RequestComplete(status, KErrNone); |
|
90 SetActive(); |
|
91 } |
|
92 } |
|
93 |
|
94 // ---------------------------------------------------------------------------- |
|
95 // CPosFixedDataController::CancelNotifyPositionUpdate |
|
96 // |
|
97 // (other items were commented in a header). |
|
98 // ---------------------------------------------------------------------------- |
|
99 // |
|
100 void CPosFixedDataController::CancelNotifyPositionUpdate() |
|
101 { |
|
102 if (IsActive()) |
|
103 { |
|
104 CompleteRequest(KErrCancel); |
|
105 Cancel(); |
|
106 } |
|
107 } |
|
108 |
|
109 // ---------------------------------------------------------------------------- |
|
110 // CPosFixedDataController::CompleteRequest |
|
111 // |
|
112 // (other items were commented in a header). |
|
113 // ---------------------------------------------------------------------------- |
|
114 // |
|
115 void CPosFixedDataController::CompleteRequest(TInt aErrorCode) |
|
116 { |
|
117 CompleteRequestBase(aErrorCode); |
|
118 } |
|
119 |
|
120 // ---------------------------------------------------------------------------- |
|
121 // CPosFixedDataController::RunL |
|
122 // |
|
123 // (other items were commented in a header). |
|
124 // ---------------------------------------------------------------------------- |
|
125 // |
|
126 void CPosFixedDataController::RunL() |
|
127 { |
|
128 CompleteRequest(iStatus.Int()); |
|
129 } |
|
130 |
|
131 // ---------------------------------------------------------------------------- |
|
132 // CPosFixedDataController::DoCancel |
|
133 // |
|
134 // (other items were commented in a header). |
|
135 // ---------------------------------------------------------------------------- |
|
136 // |
|
137 void CPosFixedDataController::DoCancel() |
|
138 { |
|
139 } |
|
140 |
|
141 // End of File |