X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Ffacebookservice%2Ffacebookauthentication.h;h=6f37c715aed94da51764111ce681a5e04d163316;hb=46bd0e94270d640b79b1d31997a875658a92a976;hp=4c0296cfb0256cb13cb986c155f9e8ceb688ffb5;hpb=752c4df0a44860ec7cda83e6794ce7d42fd5217c;p=situare diff --git a/src/facebookservice/facebookauthentication.h b/src/facebookservice/facebookauthentication.h index 4c0296c..6f37c71 100644 --- a/src/facebookservice/facebookauthentication.h +++ b/src/facebookservice/facebookauthentication.h @@ -62,6 +62,13 @@ public: public slots: /** + * @brief Clears account iformation from settings + * + * @param keepUsername keep = true, false otherwise + */ + void clearAccountInformation(bool keepUsername = false); + + /** * @brief Loads username from settings * * @return QString Loaded username @@ -82,47 +89,6 @@ public slots: */ void start(); - /** - * @brief Clears account iformation from settings - * - * @param keepUsername true = keep username - */ - void clearAccountInformation(bool keepUsername = false); - -private: - - /** - * @brief Creates login url with given parameters - * - * @param urlParts Url parts - * @return QUrl Login page url - */ - QUrl formLoginPageUrl(const QStringList & urlParts) const; - - /** - * @brief Reads previous stored credentials from file. - * - * @param credentialsFromFile This dataclass is the place where method stores credentials. - * Corrent parameter here is m_loginCredentials - */ - void readCredentials(FacebookCredentials &credentialsFromFile); - - /** - * @brief Checks expiration time of credentials and compares it to current time. - * - * @param credentials this parameter represents credentials that will be verified. - * @return bool returns true if expiration time is after current time. in other cases returns - * false. - */ - bool verifyCredentials(const FacebookCredentials &credentials) const; - - /** - * @brief Writes credentials to File - * - * @param credentials Contents of this dataclass is stored to file - */ - void writeCredentials(const FacebookCredentials &credentials); - private slots: /** @@ -142,21 +108,20 @@ private slots: signals: /** - * @brief This signal is emitted if updateCredentials method finds credentials from URL. - * Signal is also emitted at the beginning of the program if there is valid credentials - * in the file. + * @brief Signals error * - * @param freshLogin Was login done via login dialog - * @param credentials New credentials + * @param error error message */ - void credentialsReady(bool freshLogin, const FacebookCredentials &credentials); + void error(const QString &error); /** - * @brief Signals changed credentials + * @brief This signal is emitted if updateCredentials method finds credentials from URL. + * Signal is also emitted at the beginning of the program if there is valid credentials + * in the file. * * @param credentials New credentials */ - void credentialsChanged(const FacebookCredentials &credentials); + void credentialsReady(const FacebookCredentials &credentials); /** * @brief This signal is emitted if updateCredentials method can't find credentials from URL @@ -164,15 +129,23 @@ signals: */ void loginFailure(); + /** + * @brief This signal is emitted always when login is called. At first the application tries + * to login using saved cookies + * + */ void loginUsingCookies(); /** * @brief Signals when credentials are invalid new login is needed * - * @param url Login page url */ - void newLoginRequest(const QUrl &url); + void newLoginRequest(); + /** + * @brief This signal is emitted when new cookies need to be saved. + * + */ void saveCookiesRequest(); /******************************************************************************* @@ -181,6 +154,8 @@ signals: private: + bool m_freshLogin; + int m_loginAttempts; ///< Indicates login attempts /**