|
1 /* |
|
2 * Copyright (c) 2010 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: Positioning settings engine private class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef POSITIONINGSETTINGSENGINE_PRIVATE_H |
|
19 #define POSITIONINGSETTINGSENGINE_PRIVATE_H |
|
20 |
|
21 #include "possettingscommon.h" |
|
22 |
|
23 #include <epos_mposmodulesobserver.h> |
|
24 #include <lbtserver.h> |
|
25 #include <lbtmanager.h> |
|
26 |
|
27 // Forward declarations |
|
28 |
|
29 class PosSettingsEngine; |
|
30 class CPosModules; |
|
31 class CSuplSettings; |
|
32 struct TPosModulesEvent; |
|
33 |
|
34 /** |
|
35 * The class defines the interface for receiving position |
|
36 * technology change event.The class interested in position |
|
37 * technology change should inherit from this class. |
|
38 */ |
|
39 class PositionTechnologyChangeObserver |
|
40 { |
|
41 public: |
|
42 virtual void handlePositionTechnologyChange() = 0; |
|
43 }; |
|
44 |
|
45 /** |
|
46 * PositioningSettingsEnginePrivate is a class that provides implementation |
|
47 * for PositionSettingsEngine class. |
|
48 */ |
|
49 class PosSettingsEnginePrivate : public MPosModulesObserver |
|
50 { |
|
51 public: |
|
52 /** |
|
53 * Default constructor |
|
54 */ |
|
55 PosSettingsEnginePrivate( PositionTechnologyChangeObserver& |
|
56 posTechChangeObserver ); |
|
57 |
|
58 /** |
|
59 * Destructor |
|
60 */ |
|
61 ~PosSettingsEnginePrivate(); |
|
62 |
|
63 /** |
|
64 * Returns whether specified position technology is available. |
|
65 * @param[in] posTechnology Position technology of interest. |
|
66 * @return true if specified position technology is available, |
|
67 * false if it is not available. |
|
68 */ |
|
69 bool isPositionTechnologyAvailable( PositionTechnology posTechnology ); |
|
70 |
|
71 /** |
|
72 * Sets the state of position technology. |
|
73 * @param[in] posTechnologyState Resultant state of the position technology |
|
74 * after this operation. |
|
75 * @param[in] posTechnology State of position technology to be changed. |
|
76 * @return KErrNone if successful, |
|
77 * KErrNotFound if specified position technology is not available |
|
78 * Otherwise, standard error code is returned, |
|
79 * KErrServerBusy, etc.. |
|
80 */ |
|
81 int setPositionTechnologyState( State posTechnologyState, |
|
82 PositionTechnology posTechnology ); |
|
83 |
|
84 /** |
|
85 * Returns whether specified position technology is enabled. It is recemonded |
|
86 * to use this method after checking the availability of the position technology |
|
87 * using isPositionTechnologyAvailable method. |
|
88 * @param[in] posTechnology Position technology of interest. |
|
89 * @return true if specified position technology is enabled, |
|
90 * false if it is disabled. |
|
91 */ |
|
92 bool isPositionTechnologyEnabled( PositionTechnology posTechnology ); |
|
93 |
|
94 |
|
95 /** |
|
96 * Sets the state of back ground positioning. |
|
97 * @param[in] backGroundPosState Resultant state of back ground positioning. |
|
98 * @return KErrNone if successful, |
|
99 * KErrNotSupported if none of the position type are available, |
|
100 * KErrArgument if none of the position type are enabled |
|
101 * otherwise, standard error code is returned, |
|
102 * KErrServerBusy, etc.. |
|
103 */ |
|
104 int setBackGroundPositioningState( State backGroundPosState ); |
|
105 |
|
106 /** |
|
107 * Returns whether back ground positioning is enabled. It is recemonded |
|
108 * to use this method after checking the availability of the position type |
|
109 * using isPositionTypeAvailable method. |
|
110 * @return true if back ground positioning is enabled, |
|
111 * false if it is disabled. |
|
112 */ |
|
113 bool isBackGroundPositioningEnabled(); |
|
114 |
|
115 public: // from MPosModulesObserver |
|
116 virtual void HandleSettingsChangeL( TPosModulesEvent aEvent ); |
|
117 |
|
118 private: |
|
119 /** |
|
120 * Sets the state of given positioning technology. |
|
121 * @param[in] posTechnologyState Resultant State of Positioning Technology |
|
122 * StateEnable/StateDisable. |
|
123 * @param[in] posTechnology Positioning Technology Name |
|
124 * PositionTechnologyGps/PositionTechnologyNetwork. |
|
125 */ |
|
126 void setPositionTechnologyStateL( State posTechnologyState, |
|
127 PositionTechnology posTechnology ); |
|
128 /** |
|
129 * Sets the state of back ground positioning. |
|
130 * @param[in] backGroundPosState Resultant state of back ground positioning. |
|
131 */ |
|
132 void setBackGroundPositioningStateL( State backGroundPosState ); |
|
133 |
|
134 /** |
|
135 * Populates the PSY module information list. |
|
136 */ |
|
137 void populatePsyModuleInfoListL(); |
|
138 |
|
139 /** |
|
140 * Gets the state of back ground positioning. |
|
141 */ |
|
142 void GetBackGroundPositioingStateL(); |
|
143 |
|
144 private: //Data members |
|
145 |
|
146 /** |
|
147 * Reference to position technology change observer. |
|
148 */ |
|
149 PositionTechnologyChangeObserver& mPosTechChangeObserver; |
|
150 |
|
151 /** |
|
152 * Pointer to Supl settings object |
|
153 * Own |
|
154 */ |
|
155 CSuplSettings* mSuplSettings; |
|
156 |
|
157 /** |
|
158 * Pointer to lbt server |
|
159 * Own |
|
160 */ |
|
161 RLbtServer mLbtServer; |
|
162 |
|
163 /** |
|
164 * Pointer to lbt manager |
|
165 * Own |
|
166 */ |
|
167 RLbtManager mLbtManager; |
|
168 |
|
169 /** |
|
170 * Pointer to Pos module; |
|
171 * Own |
|
172 */ |
|
173 CPosModules* mPosModules; |
|
174 |
|
175 /** |
|
176 * List of PSY module info |
|
177 * Own |
|
178 */ |
|
179 RArray<PsyModuleInfo> mPsyModuleInfoList; |
|
180 |
|
181 /** |
|
182 * State of back ground positioning |
|
183 */ |
|
184 State mBackGroundPositioningState; |
|
185 |
|
186 friend class PosSettingsEngine; |
|
187 }; |
|
188 |
|
189 |
|
190 #endif /* POSITIONINGSETTINGSENGINE_PRIVATE_H */ |