Emit error signal when login fails
[situare] / src / network / networkhandlerprivate.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 NETWORKHANDLERPRIVATE_H
23 #define NETWORKHANDLERPRIVATE_H
24
25 #include <QtDBus>
26
27 class NetworkHandler;
28
29 /**
30 * @brief NetworkHandlerPrivate class.
31 *
32 * This class handles network connection. Class notifies about
33 * network connection states.
34 */
35 class NetworkHandlerPrivate : public QObject
36 {
37     Q_OBJECT
38
39 public:
40     /**
41     * @brief Constructor.
42     *
43     * Creates ICD D-Bus interface.
44     */
45     NetworkHandlerPrivate(QObject *parent);
46
47 /*******************************************************************************
48  * MEMBER FUNCTIONS AND SLOTS
49  ******************************************************************************/
50 public:
51     /**
52     * @brief Requests network connection.
53     *
54     * Request is done via ICD D-Bus.
55     */
56     void connect();
57
58     /**
59     * @brief Requests to disconnect a connection.
60     *
61     * Request is done via ICD D-Bus.
62     */
63     void disconnect();
64
65     /**
66     * @brief Checks if connected to network.
67     *
68     * @return true if connected, false otherwise
69     */
70     bool isConnected();
71
72     /**
73     * @brief Requests network state.
74     */
75     void state();
76
77 private slots:
78     /**
79     * @brief Slot for ICD D-Bus state change.
80     *
81     * @param message received D-Bus message
82     */
83     void stateChanged(const QDBusMessage &message);
84
85 /*******************************************************************************
86  * DATA MEMBERS
87  ******************************************************************************/
88 private:
89     QDBusInterface *dBusInterface;  ///< D-Bus interface
90     bool m_connected;               ///< Connection state variable
91     bool m_connecting;              ///< Connecting state variable
92
93     NetworkHandler *m_parent;       ///< Parent object
94 };
95
96 #endif // NETWORKHANDLERPRIVATE_H