#include <QUrl>
class QNetworkReply;
+class QSslError;
class QWebView;
class MainWindow;
/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
-public:
+public slots:
+ /**
+ * @brief Clears account information from settings
+ *
+ * @param keepUsername keep = true, false otherwise
+ */
+ void clearAccountInformation(bool keepUsername = false);
+
+ /**
+ * @brief Is the user currently logged in
+ *
+ * @returns True if the user is logged in, otherwise false
+ */
+ bool isLoggedIn();
+
/**
* @brief Initiate login process
*
*/
void login();
-public slots:
-
/**
- * @brief Clears account information from settings
- *
- * @param keepUsername keep = true, false otherwise
- */
- void clearAccountInformation(bool keepUsername = false);
+ * @brief Log out
+ */
+ void logOut();
private:
/**
void networkReplyHandler(QNetworkReply *reply);
/**
+ * @brief Handler for SSL errors, ignores the error
+ */
+ void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
+
+ /**
* @brief Handler for browser URL changes
*
* Does check the new URL and based on that invokes the login dialog with visible browser view
/**
* @brief Emitted when logged in successfully
*
+ * All login related actions should be connected to this signal.
+ *
* @param session Session data
*/
void loggedIn(const QString session);
+ /**
+ * @brief Emitted when logged out
+ *
+ * All logout related actions should be connected to this signal.
+ */
+ void loggedOut();
+
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
private:
+ bool m_loggedIn; ///< Is the user currently logged in
QWebView *m_browser; ///< Login browser
MainWindow *m_mainWindow; ///< MainWindow
};