#include "../user/user.h"
#include "imagefetcher.h"
-class QNetworkAccessManager;
+class NetworkAccessManager;
class QNetworkReply;
class QNetworkRequest;
class QPointF;
public slots:
/**
- * @brief Public slot, which indicates when http request has been completed
+ * @brief Public slot, to clear user data
*
- * @param reply storage for http reply
*/
- void requestFinished(QNetworkReply *reply);
+ void clearUserData();
/**
* @brief Public slot, which indicates when facebook credentials are ready
*
- * @param freshLogin Was login done via login dialog
* @param credentials New credentials
*/
- void credentialsReady(bool freshLogin, const FacebookCredentials &credentials);
+ void credentialsReady(const FacebookCredentials &credentials);
+
+ /**
+ * @brief Public slot, which indicates when http request has been completed
+ *
+ * @param reply storage for http reply
+ */
+ void requestFinished(QNetworkReply *reply);
private:
/**
+ * @brief Requests ImageFetcher if user/friend has a profile image
+ * uses members: m_user and m_friendsList
+ *
+ */
+ void addProfileImages();
+
+ /**
* @brief Forms a http cookie
*
* @param apiKeyValue application key
* @param urlParameters optional parameters for url
* @return QUrl formed url
*/
- QUrl formUrl(const QString &baseUrl, const QString &phpScript, QString urlParameters = QString());
+ QUrl formUrl(const QString &baseUrl, const QString &phpScript,
+ QString urlParameters = QString());
/**
* @brief Forms url parameters
* @param publish optional publish location on Facebook wall (true/false)
* @return QString
*/
- QString formUrlParameters(const QPointF &coordinates, QString status = QString(), QString publish = QString());
+ QString formUrlParameters(const QPointF &coordinates, QString status = QString(),
+ QString publish = QString());
/**
* @brief Parses user and friend data from JSON string
*/
void sendRequest(const QUrl &url, const QString &cookieType, const QString &cookie);
- /**
- * @brief Requests ImageFetcher if user/friend has a profile image
- * uses members: m_user and m_friendsList
- *
- */
- void addProfileImages();
-
private slots:
/**
void fetchImage(const QUrl &url);
/**
+ * @brief Signals when credentials are invalid
+ *
+ */
+ void invalidSessionCredentials();
+
+ /**
* @brief Signals when address data is retrieved
*
* @param address Street address
private:
- FacebookCredentials m_credentials; ///< handle for FacebookCredentials
- QList<QNetworkReply *> m_currentRequests; ///< List of current http requests
- QNetworkAccessManager *m_networkManager; ///< Pointer to QNetworkAccessManager
- ImageFetcher *m_imageFetcher; ///< Instance of the image fetcher
+ int m_nbrOfImages; ///< Indicates number of friends whose images has been downloaded
+ int m_visited; ///< Indicates number of friends with images
+
+ bool m_defaultImage; ///< Indicates if some of the friends/user doesn't have a image
+
+ QList<QNetworkReply *> m_currentRequests; ///< List of current http requests
+ QList<User *> m_friendsList; ///< List of friends(User)
+
+ NetworkAccessManager *m_networkManager; ///< Pointer to QNetworkAccessManager
+
+ FacebookCredentials m_credentials; ///< handle for FacebookCredentials
+ ImageFetcher *m_imageFetcher; ///< Instance of the image fetcher
+ User *m_user; ///< Pointer to User
+
+
- User *m_user; ///< Pointer to User
- QList<User *> m_friendsList; ///< List of friends(User)
- int m_visited; ///< Indicates number of friends with profile images
- int m_nbrOfImages; ///< Indicates number of friends whose profile images have been downloaded
- bool m_defaultImage; ///< Indicates if some of the friends or the user does not have a profile image
};
#endif // SITUARESERVICE_H