|
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: Implementation of positioning settings engine class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef POSITIONINGSETTINGS_ENGINE_H |
|
19 #define POSITIONINGSETTINGS_ENGINE_H |
|
20 |
|
21 |
|
22 #include "possettingscommon.h" |
|
23 #include "possettingsengineprivate.h" |
|
24 #include <QObject> |
|
25 #include <qglobal.h> |
|
26 |
|
27 /** |
|
28 * PositioningSettingsEngine class provides an interface that abstracts client |
|
29 * from different GPS and wireless positioning techniques. This exposes methods |
|
30 * to perform operations on the positioning techniques. |
|
31 */ |
|
32 |
|
33 class PosSettingsEngine : public QObject, |
|
34 public PositionTechnologyChangeObserver |
|
35 { |
|
36 Q_OBJECT |
|
37 public: |
|
38 /** |
|
39 * Default constructor |
|
40 * This throws an error if construction fails. |
|
41 */ |
|
42 PosSettingsEngine(); |
|
43 |
|
44 /** |
|
45 * Destructor |
|
46 */ |
|
47 ~PosSettingsEngine(); |
|
48 |
|
49 /** |
|
50 * Returns whether specified position technology is available. |
|
51 * @param[in] posTechnology Position technology of interest. |
|
52 * @return true if specified position technology is available, |
|
53 * false if it is not available. |
|
54 */ |
|
55 bool isPositionTechnologyAvailable( PositionTechnology posTechnology ); |
|
56 |
|
57 /** |
|
58 * Sets the state of position technology. |
|
59 * @param[in] posTechnologyState Resultant state of the position technology |
|
60 * after this operation. |
|
61 * @param[in] posTechnology State of position technology to be changed. |
|
62 * @return KErrNone if successful, |
|
63 * KErrNotFound if specified position technology is not available |
|
64 * Otherwise, standard error code is returned, |
|
65 * KErrServerBusy, etc.. |
|
66 */ |
|
67 int setPositionTechnologyState( State posTechnologyState, |
|
68 PositionTechnology posTechnology ); |
|
69 |
|
70 /** |
|
71 * Returns whether specified position technology is enabled. It is recemonded |
|
72 * to use this method after checking the availability of the position technology |
|
73 * using isPositionTechnologyAvailable method. |
|
74 * @param[in] posTechnology Position technology of interest. |
|
75 * @return true if specified position technology is enabled, |
|
76 * false if it is disabled. |
|
77 */ |
|
78 bool isPositionTechnologyEnabled( PositionTechnology posTechnology ); |
|
79 |
|
80 /** |
|
81 * Sets the state of back ground positioning. |
|
82 * @param[in] backGroundPosState Resultant state of back ground positioning. |
|
83 * @return KErrNone if successful, |
|
84 * KErrNotSupported if none of the position type are available, |
|
85 * KErrArgument if none of the position type are enabled |
|
86 * otherwise, standard error code is returned, |
|
87 * KErrServerBusy, etc.. |
|
88 */ |
|
89 int setBackGroundPositioningState( State backGroundPosState ); |
|
90 |
|
91 /** |
|
92 * Returns whether back ground positioning is enabled. It is recemonded |
|
93 * to use this method after checking the availability of the position type |
|
94 * using isPositionTypeAvailable method. |
|
95 * @return true if back ground positioning is enabled, |
|
96 * false if it is disabled. |
|
97 */ |
|
98 bool isBackGroundPositioningEnabled(); |
|
99 |
|
100 /** |
|
101 * It will set status of background positioning in CR key |
|
102 * It is required to retain old status when checkbox is inserted/removed |
|
103 * |
|
104 * status [in] - The status of the background positioning in CR key |
|
105 */ |
|
106 void setCRBackgroundPositioningStatus(State backGroundPosState); |
|
107 |
|
108 /** |
|
109 * It will return status of background positioning in CR key |
|
110 * It is required to retain old status when checkbox is inserted/removed. |
|
111 * |
|
112 * returns true if enabled or false if disabled |
|
113 */ |
|
114 bool cRBackgroundPositioningStatus(); |
|
115 |
|
116 public: // from PositionTechnologyChangeObserver |
|
117 void handlePositionTechnologyChange(); |
|
118 |
|
119 private: |
|
120 signals: |
|
121 /** |
|
122 * This signal is emitted when there is change in any of position |
|
123 * technology wrt to its availabilty, state etc.. |
|
124 */ |
|
125 void positionTechnologyChange(); |
|
126 |
|
127 private: |
|
128 Q_DECLARE_PRIVATE_D(d_ptr, PosSettingsEngine) |
|
129 private: // data member |
|
130 /** |
|
131 * Pointer to private implementation. |
|
132 * Own |
|
133 */ |
|
134 PosSettingsEnginePrivate* d_ptr; |
|
135 }; |
|
136 |
|
137 #endif /* POSITIONINGSETTINGS_ENGINE_H */ |