Renamed gpspositionprivatestub enablePowerSave.
[situare] / src / gps / gpspositionprivatestub.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Jussi Laitinen - jussi.laitinen@ixonos.com
6
7    Situare is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License
9    version 2 as published by the Free Software Foundation.
10
11    Situare is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with Situare; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19    USA.
20 */
21
22 #ifndef GPSPOSITIONPRIVATESTUB_H
23 #define GPSPOSITIONPRIVATESTUB_H
24
25 #include <QObject>
26
27 #include "gpsposition.h"
28
29 class QPointF;
30 class QString;
31
32 /**
33 * @brief GPSPositionPrivate class does nothing.
34 *
35 * Class is used when compiling in desktop.
36 */
37 class GPSPositionPrivate : public QObject
38 {
39     Q_OBJECT
40
41 public:
42     /**
43     * @brief Constructor.
44     *
45     * @param parent QObject
46     */
47     GPSPositionPrivate(QObject *parent);
48
49 /******************************************************************************
50 * MEMBER FUNCTIONS AND SLOTS
51 ******************************************************************************/
52 public:
53     /**
54     * @brief Returns is GPS initialized.
55     *
56     * RETURNS FALSE
57     * @return true if initialized, false otherwise
58     */
59     bool isInitialized();
60
61     /**
62     * @brief Checks if GPS is running.
63     *
64     * RETURNS FALSE.
65     * @return true if GPS running, false otherwise
66     */
67     bool isRunning();
68
69     /**
70     * @brief Return last known position.
71     */
72     QPointF lastPosition();
73
74     /**
75     * @brief Informs gps to emit last known position.
76     */
77     void requestLastPosition();
78
79     /**
80     * @brief Requests update from GPS.
81     *
82     * Enables GPS if it is disabled
83     */
84     void requestUpdate();
85
86     /**
87     * @brief Enables power save mode.
88     *
89     * Starts GPS for position update and then stops it.
90     */
91     void setPowerSave(bool enabled);
92
93     /**
94     * @brief Set GPS update interval.
95     *
96     * DOES NOTHING.
97     * @return interval interval in milliseconds
98     */
99     void setUpdateInterval(int interval);
100
101     /**
102     * @brief Set GPS mode.
103     *
104     * DOES NOTHING
105     * @param mode GPS mode
106     * @param filePath file path to NMEA file if simulation mode is used
107     */
108     void setMode(GPSPosition::Mode mode, const QString &filePath = 0);
109
110     /**
111     * @brief Start GPS.
112     *
113     * Emits GPS initalization error.
114     */
115     void start();
116
117     /**
118     * @brief Stop GPS.
119     *
120     * DOES NOTHING.
121     */
122     void stop();
123
124 /*******************************************************************************
125  * DATA MEMBERS
126  ******************************************************************************/
127 private:
128     GPSPosition *m_parent;                      ///< Parent object
129 };
130
131 #endif // GPSPOSITIONMOCKUP_H