|
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 // locationdatabus.h |
|
15 // An ative object wrapper to managed the location data bus. This is the P&S bus |
|
16 // that the location managers (e.g. the AGPS manager and network manager) |
|
17 // publish onto. The location server and others subscribe to this bus. |
|
18 // |
|
19 // |
|
20 |
|
21 /** |
|
22 @file |
|
23 @InternalComponent |
|
24 */ |
|
25 |
|
26 #ifndef __LBSLOCATIONDATABUS_H__ |
|
27 #define __LBSLOCATIONDATABUS_H__ |
|
28 |
|
29 #include <e32base.h> |
|
30 #include "LbsInternalInterface.h" |
|
31 #include <lbssatellite.h> |
|
32 |
|
33 class MDataBusObserver; |
|
34 |
|
35 /** |
|
36 The panic codes for the location data bus object. |
|
37 */ |
|
38 enum TLocDataBusPanic |
|
39 { |
|
40 /** |
|
41 An instance of the MLocDataBusObserver has not been passed to the object. |
|
42 The panic category will be "LocDataBus". The panic value is zero. |
|
43 */ |
|
44 ELocDataBusObserverNotSet = 0 |
|
45 }; |
|
46 |
|
47 |
|
48 /** |
|
49 Sanity wrapper around the RLbsPositionUpdate |
|
50 Assume something else has already called RLbsPositionUpdates::InitializeL()! |
|
51 Don't do this in the ConstructL, just call RLbsPositionUpdates::OpenL |
|
52 */ |
|
53 class CAgpsDataBus : public CActive |
|
54 { |
|
55 public: |
|
56 static CAgpsDataBus* NewL(MDataBusObserver& aObserver, const TUid& aModuleId); |
|
57 ~CAgpsDataBus(); |
|
58 void Subscribe(); |
|
59 void UnSubscribe(); |
|
60 TInt GetLastPositionInfo(TPositionSatelliteInfo& satelliteInfo, TTime& actualTime, TUint& aAttributes, TUint& aMode); |
|
61 |
|
62 private: |
|
63 CAgpsDataBus(MDataBusObserver& aObserver, const TUid& aModuleId); |
|
64 void ConstructL(); |
|
65 |
|
66 // from CActive |
|
67 void RunL(); |
|
68 void DoCancel(); |
|
69 TInt RunError(TInt aError); |
|
70 |
|
71 private: |
|
72 TUid iModuleId; |
|
73 MDataBusObserver& iObs; |
|
74 RLbsPositionUpdates iAGPSDataBus; // RProperty wrapper |
|
75 }; |
|
76 |
|
77 #endif // __LBSLOCATIONDATABUS__ |