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
31 class FacebookLoginBrowser;
34 * @brief FacebookAuthentication class takes care of parsing and handling of credentials for
35 * Facebook. Other components of Situare application needs credentials to communicate with
38 * @author Ville Tiensuu
40 class FacebookAuthentication : public QObject
46 * @brief FacebookAuthentication constructor
48 * -Checks if there is valid credentials stored on the file. If there is emits signal.
50 * @param parent instance of parent
52 FacebookAuthentication(QObject *parent = 0);
54 /*******************************************************************************
55 * MEMBER FUNCTIONS AND SLOTS
56 ******************************************************************************/
63 * @brief Clears account iformation from settings
65 * @param keepUsername keep = true, false otherwise
67 void clearAccountInformation(bool keepUsername = false);
69 void setBrowser(FacebookLoginBrowser *browser);
72 QString parseSession(const QUrl &url);
75 void browserDestroyed();
77 void loadFinished(bool ok);
79 void networkReplyHandler(QNetworkReply *reply);
81 void urlChanged(const QUrl &url);
83 /*******************************************************************************
85 ******************************************************************************/
87 void buildLoginBrowser();
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 ******************************************************************************/
103 FacebookLoginBrowser *m_browser;
106 #endif // FACEBOOKAUTHENTICATION_H