00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Ville Tiensuu - ville.tiensuu@ixonos.com 00006 Kaj Wallin - kaj.wallin@ixonos.com 00007 Henri Lampela - henri.lampela@ixonos.com 00008 00009 Situare is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License 00011 version 2 as published by the Free Software Foundation. 00012 00013 Situare is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with Situare; if not, write to the Free Software 00020 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00021 USA. 00022 */ 00023 00024 #ifndef FACEBOOKAUTHENTICATION_H 00025 #define FACEBOOKAUTHENTICATION_H 00026 00027 #include <QUrl> 00028 #include "facebookcredentials.h" 00029 00037 class FacebookAuthentication : public QObject 00038 { 00039 Q_OBJECT 00040 00041 public: 00049 FacebookAuthentication(QObject *parent = 0); 00050 00051 /******************************************************************************* 00052 * MEMBER FUNCTIONS AND SLOTS 00053 ******************************************************************************/ 00054 00060 FacebookCredentials loginCredentials() const; 00061 00062 public slots: 00063 00069 void clearAccountInformation(bool keepUsername = false); 00070 00076 const QString loadUsername(); 00077 00083 void saveUsername(const QString &username); 00084 00090 void start(); 00091 00092 private slots: 00093 00102 bool updateCredentials(const QUrl & url); 00103 00104 /******************************************************************************* 00105 * SIGNALS 00106 ******************************************************************************/ 00107 00108 signals: 00109 00116 void error(const int context, const int error); 00117 00125 void credentialsReady(const FacebookCredentials &credentials); 00126 00132 void loginUsingCookies(); 00133 00138 void newLoginRequest(); 00139 00144 void saveCookiesRequest(); 00145 00146 /******************************************************************************* 00147 * DATA MEMBERS 00148 ******************************************************************************/ 00149 00150 private: 00151 00152 bool m_freshLogin; 00153 00160 FacebookCredentials m_loginCredentials; 00161 }; 00162 00163 #endif // FACEBOOKAUTHENTICATION_H