Fixed some issues
[situare] / src / engine / engine.h
1  /*
2     Situare - A location system for Facebook
3     Copyright (C) 2010  Ixonos Plc. Authors:
4
5         Kaj Wallin - kaj.wallin@ixonos.com
6         Henri Lampela - henri.lampela@ixonos.com
7
8     Situare is free software; you can redistribute it and/or
9     modify it under the terms of the GNU General Public License
10     version 2 as published by the Free Software Foundation.
11
12     Situare is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with Situare; if not, write to the Free Software
19     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
20     USA.
21  */
22
23
24 #ifndef ENGINE_H
25 #define ENGINE_H
26
27 #include <QWidget>
28 #include <QtDebug>
29 #include "facebookservice/facebookauthentication.h"
30 #include "situareservice/situareservice.h"
31 #include <QNetworkAccessManager>
32 #include "../ui/mainwindow.h"
33
34 /**
35 * @brief Engine class for Situare Application
36 *
37 * This class handles all the underlaying login of the Situare
38 * application.
39 *
40 * @class SituareEngine engine.h "engine/engine.h"
41 */
42 class SituareEngine : public QObject
43 {
44     Q_OBJECT
45 public:
46     /**
47     * @brief Constructor
48     *
49     * @param parent
50     */
51     SituareEngine(QMainWindow *parent = 0);
52
53     /**
54     * @brief Destructor
55     */
56     ~SituareEngine();
57
58 /*******************************************************************************
59  * MEMBER FUNCTIONS AND SLOTS
60  ******************************************************************************/
61 public slots:
62     /**
63     * @brief Slot to intercept signal from successful login
64     */
65     void loginOk();
66
67     /**
68     * @brief Calls reverseGeo from SituareService to translate coordinates to street address
69     *
70     */
71     void requestAddress();
72
73     /**
74     * @brief Calls updateLocation from SituareService to send the location update to
75     *        Situare server.
76     *
77     * @param status Status message
78     * @param publish Publish on Facebook
79     */
80     void requestUpdateLocation(const QString &status, const bool &publish);
81
82     /**
83     * @brief Slot to initiate update friends list function
84     */
85     void updateFriendsList();
86
87 /*******************************************************************************
88  * DATA MEMBERS
89  ******************************************************************************/
90 private:
91     MainWindow *m_ui; ///< Instance of the MainWindow UI
92     FacebookAuthentication *m_facebookAuthenticator; ///< Instance for facebook authenticator
93     QNetworkAccessManager *m_networkManager; ///< NetworkManager that is passed on to SituareService
94     SituareService *m_situareService; ///< Instance of the situare server communication service
95 };
96
97 #endif // ENGINE_H