|
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 // lbsnrhserver.h |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 @released |
|
22 */ |
|
23 #ifndef __LBSPRIVACYCONTROLLERSERVER_H__ |
|
24 #define __LBSPRIVACYCONTROLLERSERVER_H__ |
|
25 |
|
26 #include <e32property.h> |
|
27 #include "tserverstartparams.h" |
|
28 #include "csecureasbase.h" |
|
29 #include "csecureserverbase.h" |
|
30 #include "csecuresessionbase.h" |
|
31 #include "csecuresessionsubsessionbase.h" |
|
32 #include "csubsessionbase.h" |
|
33 #include "messageutils.h" |
|
34 #include "lbsnetworkrequesthandler.h" |
|
35 #include "privacyhandler.h" |
|
36 #include "lbsprivacycontrollerdata.h" |
|
37 #include "lbsnrhserver.h" |
|
38 |
|
39 |
|
40 /** |
|
41 The class used to correct the class type and class size when converting from TPositionCourseInfo, |
|
42 TPositionSatelliteInfo,TPositionExtendedSatelliteInfo and HPositionGenericInfo to TPositionInfo. |
|
43 |
|
44 @internalComponent |
|
45 */ |
|
46 class TPositionInfoClassTypeFixer : public TPositionInfo |
|
47 { |
|
48 public: |
|
49 TPositionInfoClassTypeFixer(const TPositionInfo& aPositionInfo); |
|
50 }; |
|
51 |
|
52 |
|
53 class CNrhPrivacyServerSubsession : public CBase, |
|
54 public MSubSessionImpl, |
|
55 public MLbsSessionObserver |
|
56 { |
|
57 public: |
|
58 static CNrhPrivacyServerSubsession* NewL(); |
|
59 ~CNrhPrivacyServerSubsession(); |
|
60 |
|
61 // from MSubSessionImpl |
|
62 void DispatchL(const RMessage2& aMessage); |
|
63 void DispatchError(const RMessage2& aMessage, TInt aError); |
|
64 void CreateSubSessionL(const RMessage2& aMessage,const CSecureServerBase* aServer); |
|
65 void CloseSubSession(); |
|
66 // via MSubSessionImpl::MRelease |
|
67 void VirtualRelease(); |
|
68 // |
|
69 // action methods. These functions pass message to the client. |
|
70 // |
|
71 void SetClientReady(const RMessage2& aMessage); |
|
72 void CancelClientReady(const RMessage2& aMessage); |
|
73 void HandlePrivacyResponse(const RMessage2& aMessage); |
|
74 void HandlePrivacyCancel(const RMessage2& aMessage); |
|
75 |
|
76 public: // From MLbsSessionObserver |
|
77 void ProcessNetworkLocationRequest(TLbsNetSessionIdInt aRequestId, |
|
78 const TLbsNetworkEnumInt::TLbsNetProtocolServiceInt aSessionType, |
|
79 const TLbsExternalRequestInfo& aRequestInfo, |
|
80 const TLbsNetPosRequestPrivacyInt& aNetPosRequestPrivacy, |
|
81 TBool aIsEmergency); |
|
82 |
|
83 void ProcessNetworkPositionUpdate(TLbsNetSessionIdInt aRequestId, |
|
84 const TPositionInfo& aPosInfo); |
|
85 void ProcessRequestComplete(TLbsNetSessionIdInt aRequestId, |
|
86 TInt aReason); |
|
87 |
|
88 protected: |
|
89 CNrhPrivacyServerSubsession(); |
|
90 void ConstructL(); |
|
91 |
|
92 private: |
|
93 TInt CheckPrivacyObserverVersion(const RMessage2& aMessage); |
|
94 |
|
95 private: |
|
96 const CNrhServer* iNrhServer; |
|
97 |
|
98 RMessage2 iPrivacyControllerMessage; |
|
99 |
|
100 // Need to be able to store instances of the message data |
|
101 // in case a message arrives before the client has indicated |
|
102 // it's ready for the next one. |
|
103 |
|
104 RArray<TNrhServerMessageType> iPendingMessage; |
|
105 |
|
106 //RArray<TPrivacyRequestParams> iPendingPrivacyRequests; |
|
107 CArrayFixSeg<TPrivacyRequestParams> iPendingPrivacyRequests; |
|
108 RArray<TLocationUpdateParams> iPendingLocationUpdates; |
|
109 RArray<TLbsSessionCompleteParams> iPendingSessionCompletes; |
|
110 }; |
|
111 |
|
112 #endif //__LBSPRIVACYCONTROLLERSERVER_H__ |