|
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 // An active object wrapper to manage the network location data bus. This is the P&S bus |
|
15 // that the network location manager publishes onto. |
|
16 // The location server and others subscribe to this bus. |
|
17 // |
|
18 // |
|
19 |
|
20 /** |
|
21 @file |
|
22 @InternalComponent |
|
23 */ |
|
24 |
|
25 #ifndef __LBSNETDATABUS_H__ |
|
26 #define __LBSNETDATABUS_H__ |
|
27 |
|
28 #include <e32base.h> |
|
29 #include "LbsInternalInterface.h" |
|
30 #include "mdatabusobserver.h" |
|
31 |
|
32 /** |
|
33 The panic codes for the location data bus object. |
|
34 */ |
|
35 enum TNetDataBusPanic |
|
36 { |
|
37 /** |
|
38 An instance of the MLocDataBusObserver has not been passed to the object. |
|
39 The panic category will be "NetDataBus". The panic value is zero. |
|
40 */ |
|
41 ENetDataBusObserverNotSet = 0 |
|
42 }; |
|
43 |
|
44 |
|
45 /** |
|
46 Sanity wrapper around the RLbsPositionUpdate |
|
47 Assume something else (root) has already called RLbsPositionUpdates::InitializeL()! |
|
48 Don't do this in the ConstructL, just call RLbsPositionUpdates::OpenL |
|
49 */ |
|
50 class CNETDataBus : public CActive |
|
51 { |
|
52 public: |
|
53 static CNETDataBus* NewL(MDataBusObserver* aObserver, const TUid& aModuleId); |
|
54 void ConstructL(); |
|
55 ~CNETDataBus(); |
|
56 void Subscribe(); |
|
57 void UnSubscribe(); |
|
58 TInt GetLastPositionInfo(TPositionInfo& aPosInfo, TTime& aActualTime); |
|
59 |
|
60 private: |
|
61 CNETDataBus(MDataBusObserver* aObserver, const TUid& aModuleId); |
|
62 |
|
63 // from CActive |
|
64 void RunL(); |
|
65 void DoCancel(); |
|
66 TInt RunError(TInt aError); |
|
67 |
|
68 private: |
|
69 MDataBusObserver* iObs; |
|
70 RLbsPositionUpdates iNETDataBus; // RProperty wrapper |
|
71 TUid iModuleId; // module id (of the netloc manager) which identifies the bus |
|
72 TPositionInfo iPositionInfo; // position info data from Network |
|
73 }; |
|
74 |
|
75 #endif // __LBSNETDATABUS_H__ |