Moved creating the FacebookLoginBrowser to FacebookAuthentication.
[situare] / src / facebookservice / facebookauthentication.h
index 5c13c87..5987fee 100644 (file)
 class QNetworkReply;
 
 class FacebookLoginBrowser;
+class MainWindow;
 
 /**
-* @brief FacebookAuthentication class takes care of parsing and handling of  credentials for
-*        Facebook. Other components of Situare application needs credentials to communicate with
-*        facebook.
+* @brief FacebookAuthentication class takes care of Facebook login process. It creates
+         FacebookLoginBrowser instance and tries to login with cookies using hidden browser.
+         If failed, then visible login browser dialog is invoked. Class also does parse the
+         accuired credentials.
 *
 * @author Ville Tiensuu
+* @author Sami Rämö - sami.ramo (at) ixonos.com
 */
 class FacebookAuthentication : public QObject
 {
@@ -47,9 +50,10 @@ public:
     *
     * -Checks if there is valid credentials stored on the file. If there is emits signal.
     *
+    * @param mainWindow MainWindow instance
     * @param parent instance of parent
     */
-    FacebookAuthentication(QObject *parent = 0);
+    FacebookAuthentication(MainWindow *mainWindow, QObject *parent = 0);
 
 /*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
@@ -66,8 +70,6 @@ public slots:
     */
     void clearAccountInformation(bool keepUsername = false);
 
-    void setBrowser(FacebookLoginBrowser *browser);
-
 private:
     QString parseSession(const QUrl &url);
 
@@ -84,8 +86,6 @@ private slots:
  * SIGNALS
  ******************************************************************************/
 signals:
-    void buildLoginBrowser();
-
     /**
     * @brief Signals error
     *
@@ -101,6 +101,7 @@ signals:
  ******************************************************************************/
 private:
     FacebookLoginBrowser *m_browser;
+    MainWindow *m_mainWindow;
 };
 
 #endif // FACEBOOKAUTHENTICATION_H