2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Kaj Wallin - kaj.wallin@ixonos.com
6 Henri Lampela - henri.lampela@ixonos.com
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.
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.
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,
29 #include "facebookservice/facebookauthentication.h"
30 #include "situareservice/situareservice.h"
31 #include "ui/mainwindow.h"
34 * @brief Engine class for Situare Application
36 * This class handles all the underlaying login of the Situare
39 * @class SituareEngine engine.h "engine/engine.h"
41 class SituareEngine : public QObject
50 SituareEngine(QMainWindow *parent = 0);
57 /*******************************************************************************
58 * MEMBER FUNCTIONS AND SLOTS
59 ******************************************************************************/
63 * @brief Slot to intercept error signal from ImageFetcher and SituareService
65 * @param error Error message
67 void error(const QString &error);
70 * @brief Slot to intercept signal from successful login
75 * @brief Calls reverseGeo from SituareService to translate coordinates to street address
78 void requestAddress();
81 * @brief Calls updateLocation from SituareService to send the location update to
84 * @param status Status message
85 * @param publish Publish on Facebook
87 void requestUpdateLocation(const QString &status, bool publish);
90 * @brief Slot to initiate update friends list function
92 void updateFriendsList();
95 * @brief Slot to intercept signal from successful location update
98 void updateWasSuccessful();
101 * @brief Slot to intercept signal when new user data is available.
102 * Splits User and friendsList data and emits them as two different signals.
104 * @param user instance of User
105 * @param friendsList list of User instances (friends)
107 void userDataChanged(User *user, QList<User *> &friendsList);
109 /*******************************************************************************
111 ******************************************************************************/
115 * @brief Signals when new user data is ready
117 * @param user Instance of User
119 void userLocationReady(User *user);
122 * @brief Signals when new friends data is ready
124 * @param friendList List of User instances (friends)
126 void friendsLocationsReady(QList<User *> &friendList);
128 /*******************************************************************************
130 ******************************************************************************/
132 MainWindow *m_ui; ///< Instance of the MainWindow UI
133 FacebookAuthentication *m_facebookAuthenticator; ///< Instance for facebook authenticator
134 SituareService *m_situareService; ///< Instance of the situare server communication service