|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CPOSSUBSESSION_H |
|
22 #define CPOSSUBSESSION_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <lbs.h> |
|
27 #include <lbs/lbsadmin.h> |
|
28 #include "EPos_MPosParameterObserver.h" |
|
29 #include "lbsnetinternalapi.h" // for RLbsNetworkRegistrationStatus |
|
30 #include "lbsnetregstatusint.h" // for RLbsNetworkRegistrationStatus |
|
31 |
|
32 // CONSTANTS |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 struct TPosModulesEvent; |
|
36 class CPosModuleSettings; |
|
37 class CPositioner; |
|
38 class CPositionRequest; |
|
39 class MPosStatusObserver; |
|
40 class MPosModuleStatusManager; |
|
41 class CPosLocMonitorReqHandlerHub; |
|
42 // TODO Verify |
|
43 class CPosLastPositionAreaRequest; |
|
44 // TODO to be removed - included to compile code before completion of |
|
45 // location monitor |
|
46 |
|
47 |
|
48 // CLASS DECLARATION |
|
49 |
|
50 /** |
|
51 * This class provides functionality common to all EPos subsessions. |
|
52 */ |
|
53 class CPosSubSession : public CObject, public MPosParameterObserver |
|
54 { |
|
55 public: // Constructor & Destructor |
|
56 static CPosSubSession* NewLC( |
|
57 CPosModuleSettings& aModuleSettings, |
|
58 CPosLocMonitorReqHandlerHub& aLocMonitorReqHandlerHub, |
|
59 TUid aImplementationUid, |
|
60 TBool aIsProxy, |
|
61 MPosStatusObserver* aStatusObserver, |
|
62 MPosModuleStatusManager* aModuleStatusManager); |
|
63 virtual ~CPosSubSession(); |
|
64 |
|
65 public: // New functions |
|
66 void ServiceL(const RMessage2& aMessage); |
|
67 void HandleSettingsChangeL(TPosModulesEvent aEvent); |
|
68 void NotifyServerShutdown(); |
|
69 |
|
70 protected: // Functions from MPosParameterObserver |
|
71 TInt GetRequiredPositionQuality(TPositionQuality& aPositionQuality) const; |
|
72 void GetMaxAge(TTime& aMaxAge) const; |
|
73 TBool IsPartialUpdateAllowed() const; |
|
74 |
|
75 virtual void GetUpdateTimeOut(TTimeIntervalMicroSeconds& aUpdateTimeOut) const; |
|
76 virtual void SetPsyDefaultUpdateTimeOut(const TTimeIntervalMicroSeconds& aUpdateTimeOut); |
|
77 virtual void ExtendUpdateTimeOut(const TTimeIntervalMicroSeconds& aAdditionalTime); |
|
78 |
|
79 private: |
|
80 CPosSubSession(); |
|
81 |
|
82 void ConstructL( |
|
83 CPosModuleSettings& aModuleSettings, |
|
84 CPosLocMonitorReqHandlerHub& aLocMonitorReqHandlerHub, |
|
85 TPositionModuleId aImplementationUid, |
|
86 MPosStatusObserver* aStatusObserver, |
|
87 MPosModuleStatusManager* aModuleStatusManager, |
|
88 TBool aIsProxy); |
|
89 |
|
90 CPosSubSession( const CPosSubSession& ); |
|
91 CPosSubSession& operator= ( const CPosSubSession& ); |
|
92 |
|
93 void HandleSetRequestorL(const RMessage2& aMessage); |
|
94 void HandleSetRequestorStackL(const RMessage2& aMessage); |
|
95 void HandleSetUpdateOptionsL(const RMessage2& aMessage); |
|
96 void HandleGetUpdateOptionsL(const RMessage2& aMessage); |
|
97 void HandleGetLastKnownPositionL(const RMessage2& aMessage); |
|
98 void HandleNotifyPositionUpdateL(const RMessage2& aMessage); |
|
99 void HandleGetLastKnownPositionAreaL(const RMessage2& aMessage); // TODO Verify |
|
100 void HandleNotifyPositionUpdateCancelL(const RMessage2& aMessage); |
|
101 void HandleGetLastKnownPositionCancelL(const RMessage2& aMessage); |
|
102 void HandleGetLastKnownPositionAreaCancelL(const RMessage2& aMessage); // TODO Verify |
|
103 void HandleCancelAsyncRequestL(const RMessage2& aMessage); |
|
104 |
|
105 void ReadModuleInfoL(); |
|
106 |
|
107 void ValidateRequestorL(CRequestor* aRequestor); |
|
108 |
|
109 void RequestComplete(const RMessage2& aMessage, TInt aCompleteCode); |
|
110 |
|
111 TBool IsSelfLocateEnabled(); |
|
112 |
|
113 private: // Data |
|
114 RRequestorStack iRequestors; |
|
115 CPositionRequest* iPositionRequest; |
|
116 TBool iWaitingForFirstTrackingRequest; |
|
117 TTimeIntervalMicroSeconds iMaxUpdateAge; |
|
118 TUid iImplementationUid; |
|
119 TUint32 iClassesSupported; |
|
120 TBool iAcceptPartialUpdates; |
|
121 TBool iTracking; |
|
122 CPosLocMonitorReqHandlerHub* iLocMonitorReqHandlerHub; |
|
123 |
|
124 TTimeIntervalMicroSeconds iUpdateTimeOut; |
|
125 TTimeIntervalMicroSeconds iPsyDefaultUpdateTimeOut; |
|
126 TBool iLocationManagementSupported; |
|
127 CLbsAdmin* iAdmin; |
|
128 /** internal interface used to broadcast the network registration (roaming) status */ |
|
129 RLbsNetworkRegistrationStatus iNetRegStatus; |
|
130 }; |
|
131 |
|
132 |
|
133 #endif // CPOSSUBSESSION_H |
|
134 |
|
135 // End of File |