|
1 // Copyright (c) 2006-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 // Definition of network location channel component. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef NETLOCATIONCHANNEL_H_ |
|
25 #define NETLOCATIONCHANNEL_H_ |
|
26 |
|
27 #include "lbscommoninternaldatatypes.h" |
|
28 #include "lbsngnlmint.h" |
|
29 #include "lbsreffnpint.h" |
|
30 #include <lbs/lbsextendedsatellite.h> |
|
31 |
|
32 |
|
33 class TPositionInfoBase; |
|
34 class TLbsNetLocMsgBase; |
|
35 |
|
36 // |
|
37 // Network Location Channel |
|
38 // |
|
39 |
|
40 typedef TInt TLbsNetworkLocationRequestBase; |
|
41 |
|
42 /** Observer for the Network Location interface. |
|
43 */ |
|
44 class MNetworkLocationObserver |
|
45 { |
|
46 public: |
|
47 virtual void ProcessNetworkLocationMessage(const TLbsNetLocMsgBase& aMessage) = 0; |
|
48 }; |
|
49 |
|
50 /** Manager for the Network Location interface. |
|
51 |
|
52 This class handles sending and receiving messages on the |
|
53 Network Location interface. It is implemented as an active object |
|
54 to allow it to asnychronously wait for messages to arrive. Sending |
|
55 is synchronous. |
|
56 */ |
|
57 class CNetworkLocationChannel : public CActive |
|
58 { |
|
59 public: |
|
60 static CNetworkLocationChannel* NewL(MNetworkLocationObserver& aObserver); |
|
61 ~CNetworkLocationChannel(); |
|
62 |
|
63 // from CActive |
|
64 void RunL(); |
|
65 void DoCancel(); |
|
66 TInt RunError(TInt aError); |
|
67 |
|
68 const TPositionInfoBase & GetLastReferencePosition(); |
|
69 void SetReferencePosition(TLbsNetSessionIdInt& aSessionId, |
|
70 const TPositionInfoBase& aLocation); |
|
71 |
|
72 void SendNetworkLocationMessage(const TLbsNetLocMsgBase& aMessage); |
|
73 |
|
74 private: |
|
75 CNetworkLocationChannel(MNetworkLocationObserver& aObserver); |
|
76 void ConstructL(); |
|
77 |
|
78 void NotifyNetworkLocationRequestUpdate(); |
|
79 |
|
80 private: |
|
81 MNetworkLocationObserver& iObserver; |
|
82 RLbsNetworkLocationRequests iLocationRequests; |
|
83 RLbsNetworkLocationResponses iLocationResponses; |
|
84 RLbsNetworkPositionUpdates iPositionUpdates; |
|
85 TPositionExtendedSatelliteInfo iRefPosInfo; |
|
86 }; |
|
87 |
|
88 #endif // NETLOCATIONCHANNEL_H_ |