|
1 // Copyright (c) 2008-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 @file |
|
18 @internalTechnology |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef LOCATIONUPDATEMONITOR_H_ |
|
23 #define LOCATIONUPDATEMONITOR_H_ |
|
24 |
|
25 #include <e32std.h> |
|
26 #include <lbs/lbsextendedsatellite.h> |
|
27 #include "LbsInternalInterface.h" |
|
28 |
|
29 /** |
|
30 */ |
|
31 class MLbsLocUpdateObserver |
|
32 { |
|
33 public: |
|
34 virtual void OnPositionUpdate( |
|
35 TBool aConflictControl, |
|
36 TInt aReason, |
|
37 const TPositionExtendedSatelliteInfo& aPosInfo, |
|
38 const TTime& aActualTime) = 0; |
|
39 }; |
|
40 |
|
41 /** |
|
42 */ |
|
43 class CLbsLocUpdateMonitor : public CActive |
|
44 { |
|
45 public: |
|
46 static CLbsLocUpdateMonitor* NewL( |
|
47 MLbsLocUpdateObserver& aObserver); |
|
48 ~CLbsLocUpdateMonitor(); |
|
49 |
|
50 public: |
|
51 void StartMonitor(); |
|
52 void StopMonitor(); |
|
53 |
|
54 void SendLocationRequest( |
|
55 TLbsPositionUpdateRequestBase::TPowerAdvice aPowerAdvice, |
|
56 const TLbsNetPosRequestMethodInt& aMethod, |
|
57 const TLbsLocRequestQualityInt& aQuality); |
|
58 void SendCancelRequest( |
|
59 TLbsPositionUpdateRequestBase::TPowerAdvice aPowerAdvice); |
|
60 void SendPowerAdviceRequest( |
|
61 TLbsPositionUpdateRequestBase::TPowerAdvice aPowerAdvice); |
|
62 |
|
63 void GetPosition( |
|
64 TBool& aConflictControl, |
|
65 TInt& aReason, |
|
66 TPositionExtendedSatelliteInfo& aPosInfo, |
|
67 TTime& aActualTime); |
|
68 |
|
69 protected: |
|
70 CLbsLocUpdateMonitor(); |
|
71 CLbsLocUpdateMonitor(MLbsLocUpdateObserver& aObserver); |
|
72 void ConstructL(); |
|
73 |
|
74 protected: // From CActive |
|
75 void RunL(); |
|
76 TInt RunError(TInt aError); |
|
77 void DoCancel(); |
|
78 |
|
79 private: |
|
80 MLbsLocUpdateObserver& iObserver; |
|
81 RLbsPositionUpdates iLbsPositionUpdateMonitor; |
|
82 RLbsPositionUpdateRequests iLbsPositionUpdateRequestor; |
|
83 }; |
|
84 |
|
85 #endif /*LOCATIONUPDATEMONITOR_H_*/ |