|
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 // client side exmaple of how to use the abstract server framework |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef __LBSPRIVACYCONTROLLERIMPL_H__ |
|
25 #define __LBSPRIVACYCONTROLLERIMPL_H__ |
|
26 |
|
27 #include "lbscommoninternaldatatypes.h" // for TLbsNetSessionIdInt |
|
28 #include "rsecuresessionbase.h" |
|
29 #include "tserverstartparams.h" |
|
30 #include "opensessionparams.h" |
|
31 // jcm not nedded now uses INT #include "lbsloccommon.h" // For TLbsExternalRequestInfo |
|
32 #include "lbsnrhserverdata.h" // For server name and filename |
|
33 #include <lbs/lbsprivacycontroller.h> // For MLbsPrivacyObserver |
|
34 #include "lbsprivacycontrollerdata.h" |
|
35 #include "lbsrootapi.h" |
|
36 |
|
37 |
|
38 // this s really a session with server |
|
39 NONSHARABLE_CLASS(RNrhServer) : public RSecureSessionBase |
|
40 { |
|
41 public: |
|
42 RNrhServer(); |
|
43 ~RNrhServer(); |
|
44 TVersion Version(); |
|
45 TInt StartServer(TServerStartParams& aParams); |
|
46 |
|
47 void StartLbsL(); |
|
48 }; |
|
49 |
|
50 // this is really a subsession of the above |
|
51 NONSHARABLE_CLASS(RNrhSession) : public RSecureSubSessionBase |
|
52 { |
|
53 public: |
|
54 RNrhSession(); |
|
55 ~RNrhSession(); |
|
56 TVersion Version(); |
|
57 void RegisterForServerMessages(TRequestStatus& aTrs); |
|
58 TInt SendPrivacyResponse(TLbsNetSessionIdInt aSessionId, |
|
59 CLbsPrivacyController::TRequestVerificationResult aResult); |
|
60 TInt SendPrivacyCancel(TLbsNetSessionIdInt aSessionId); |
|
61 |
|
62 TInt CancelRequest(); |
|
63 |
|
64 public: |
|
65 TPckgBuf<TPrivacyRequestParams> iPrivacyRequestParamsBuf; |
|
66 TPckgBuf<TLocationUpdateParams> iLocationUpdateParamsBuf; |
|
67 TPckgBuf<TLbsSessionCompleteParams> iLbsSessionCompleteParamsBuf; |
|
68 }; |
|
69 |
|
70 NONSHARABLE_CLASS(CLbsPrivacyControllerImpl) : public CActive, |
|
71 public MLbsProcessCloseDown |
|
72 { |
|
73 public: |
|
74 static CLbsPrivacyControllerImpl* NewL(MLbsPrivacyObserver* aObserver); |
|
75 void RespondNetworkLocationRequest(TUint aRequestId, |
|
76 CLbsPrivacyController::TRequestVerificationResult aResult); |
|
77 void CancelNetworkLocationRequest(TUint aRequestId); |
|
78 ~CLbsPrivacyControllerImpl(); |
|
79 |
|
80 protected: |
|
81 CLbsPrivacyControllerImpl(MLbsPrivacyObserver* aObserver); |
|
82 void ConstructL(); |
|
83 |
|
84 protected: // From CActive |
|
85 void RunL(); |
|
86 void DoCancel(); |
|
87 |
|
88 private: |
|
89 void HandlePrivacyRequest(); |
|
90 void HandleLocationUpdate(); |
|
91 void HandleLbsSessionComplete(); |
|
92 |
|
93 private: |
|
94 // from MLbsProcessCloseDown |
|
95 void OnProcessCloseDown(); |
|
96 |
|
97 private: |
|
98 MLbsPrivacyObserver* iObserver; |
|
99 |
|
100 RNrhServer iServer; |
|
101 RNrhSession iSession; |
|
102 TServerStartParams iParams; // MUST live for as long as the client |
|
103 |
|
104 // Details of request received back from server |
|
105 TLbsNetSessionIdInt iSessionId; |
|
106 |
|
107 #if defined(SYMBIAN_LOCATION_PRIVACY_V2) |
|
108 CLbsCloseDownRequestDetector* iCloseDownRequestor; |
|
109 #endif // SYMBIAN_LOCATION_PRIVACY_V2 |
|
110 }; |
|
111 |
|
112 #endif // __LBSPRIVACYCONTROLLERIMPL_H__ |