|
1 // Copyright (c) 2007-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 #ifndef __PRIVACYMODULE_H__ |
|
17 #define __PRIVACYMODULE_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 #include <lbs/lbsnetcommon.h> |
|
22 #include <lbs/lbsnetprotocolbase.h> |
|
23 |
|
24 #include "privacyprotocol.h" |
|
25 #include "privacyserver.h" |
|
26 #include "privacyrequestinfo.h" |
|
27 |
|
28 |
|
29 /** |
|
30 LBS Network Protocol Interface |
|
31 This class implements the LBS Network Gateway plug-in interface which |
|
32 allows the module to be accessed by, and to interact with, LBS. |
|
33 @see CLbsNetworkProtocolBase |
|
34 @see MLbsNetworkProtocolObserver |
|
35 |
|
36 The class also implements the internal MPrivacyProtocol interface |
|
37 which is used to receive calls from network privacy API clients via the server session. |
|
38 @see MPrivacyProtocol |
|
39 */ |
|
40 NONSHARABLE_CLASS(CPrivacyProtocol) : public CLbsNetworkProtocolBase, public MPrivacyProtocol |
|
41 { |
|
42 |
|
43 public: |
|
44 |
|
45 static CPrivacyProtocol* NewL(TAny* aParams); |
|
46 ~CPrivacyProtocol(); |
|
47 |
|
48 // MPrivacyProtocol methods: |
|
49 |
|
50 void CancelVerifyLocationRequest(CCancelPrivacyRequestInfo* aCancelInfo); |
|
51 void GetNextSessionId(TLbsNetSessionId& aSessionId); |
|
52 void NotifyLocationRequest(CPrivacyRequestInfo* aRequestInfo); |
|
53 void NotifyVerificationTimeout(CPrivacyRequestInfo* aRequestInfo); |
|
54 void VerifyLocationRequest(CPrivacyRequestInfo* aRequestInfo); |
|
55 void PrivacyLocationRequest(CPrivacyRequestInfo* aRequestInfo); |
|
56 void CompletePrivacyRequest(TUint32 aRequestId, TInt aReason); |
|
57 void SessionDisconnected(const CSession2* aSession); |
|
58 |
|
59 |
|
60 // CLbsNetworkProtocolBase methods: |
|
61 |
|
62 void RespondPrivacyRequest(const TLbsNetSessionId& aSessionId, |
|
63 const TLbsPrivacyResponse& aResponse); |
|
64 |
|
65 void RespondLocationRequest(const TLbsNetSessionId& aSessionId, |
|
66 TInt aReason, |
|
67 const TPositionInfoBase& aPosInfo); |
|
68 |
|
69 void RequestTransmitLocation(const TLbsNetSessionId& aSessionId, |
|
70 const TDesC& aDestination, |
|
71 TInt aPriority); |
|
72 |
|
73 void CancelTransmitLocation(const TLbsNetSessionId& aSessionId, |
|
74 TInt aReason); |
|
75 |
|
76 void RequestAssistanceData(TLbsAsistanceDataGroup aDataRequestMask); |
|
77 |
|
78 void RequestNetworkLocation(const TLbsNetSessionId& aSessionId, |
|
79 const TLbsNetPosRequestOptionsBase& aOptions); |
|
80 |
|
81 void CancelNetworkLocation(const TLbsNetSessionId& aSessionId, |
|
82 TInt aReason); |
|
83 |
|
84 void RequestSelfLocation(const TLbsNetSessionId& aSessionId, |
|
85 const TLbsNetPosRequestOptionsBase& aOptions); |
|
86 |
|
87 void CancelSelfLocation(const TLbsNetSessionId& aSessionId, |
|
88 TInt aReason); |
|
89 |
|
90 void AdviceSystemStatus(TLbsSystemStatus aStatus); |
|
91 |
|
92 private: |
|
93 |
|
94 CPrivacyProtocol(MLbsNetworkProtocolObserver& aObserver); |
|
95 |
|
96 void ConstructL(); |
|
97 |
|
98 void ProcessRequest(CPrivacyRequestInfo* aRequest); |
|
99 |
|
100 private: |
|
101 |
|
102 /** Stores the requests */ |
|
103 CPrivacyRequestBuffer* iRequestBuffer; |
|
104 |
|
105 /** Protocol manager object pointer. |
|
106 This object is created and owned by this class and represents the |
|
107 internal manager for the protocol module. The object is used to |
|
108 make requests into the module in support of LBS interactions. |
|
109 */ |
|
110 CPrivacyServer* iServer; |
|
111 |
|
112 /** Reference to this protocol module's observer. |
|
113 This is used to make callbacks into LBS from the protocol module. |
|
114 */ |
|
115 MLbsNetworkProtocolObserver& iObserver; |
|
116 |
|
117 /** ID of the next session */ |
|
118 TLbsNetSessionId iNextSessionId; |
|
119 |
|
120 /** Maximum number of requests that can be active at once */ |
|
121 TInt iMaxSimultaneousActiveRequests; |
|
122 }; |
|
123 |
|
124 |
|
125 #endif // __PRIVACYMODULE_H__ |