2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Ville Tiensuu - ville.tiensuu@ixonos.com
6 Kaj Wallin - kaj.wallin@ixonos.com
7 Henri Lampela - henri.lampela@ixonos.com
9 Situare is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 version 2 as published by the Free Software Foundation.
13 Situare is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with Situare; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
24 #ifndef FACEBOOKAUTHENTICATION_H
25 #define FACEBOOKAUTHENTICATION_H
35 * @brief FacebookAuthentication class takes care of Facebook login process. It creates
36 QWebView instance and tries to login with cookies using hidden browser.
37 If failed, then visible login browser dialog is invoked. Class also does parse the
40 * @author Ville Tiensuu
41 * @author Sami Rämö - sami.ramo (at) ixonos.com
43 class FacebookAuthentication : public QObject
49 * @brief FacebookAuthentication constructor
51 * -Checks if there is valid credentials stored on the file. If there is emits signal.
53 * @param mainWindow MainWindow instance
54 * @param parent instance of parent
56 FacebookAuthentication(MainWindow *mainWindow, QObject *parent = 0);
58 /*******************************************************************************
59 * MEMBER FUNCTIONS AND SLOTS
60 ******************************************************************************/
67 * @brief Clears account iformation from settings
69 * @param keepUsername keep = true, false otherwise
71 void clearAccountInformation(bool keepUsername = false);
74 QString parseSession(const QUrl &url);
77 void browserDestroyed();
79 void loadFinished(bool ok);
81 void networkReplyHandler(QNetworkReply *reply);
83 void urlChanged(const QUrl &url);
85 /*******************************************************************************
87 ******************************************************************************/
90 * @brief Signals error
92 * @param context error context
93 * @param error error code
95 void error(const int context, const int error);
97 void loggedIn(const QString session);
99 /*******************************************************************************
101 ******************************************************************************/
104 MainWindow *m_mainWindow;
107 #endif // FACEBOOKAUTHENTICATION_H