2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Henri Lampela - henri.lampela@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
23 #ifndef SITUARESERVICE_H
24 #define SITUARESERVICE_H
28 #include <QNetworkAccessManager>
29 #include <QNetworkRequest>
30 #include <QNetworkReply>
34 * @brief SituareService class for communicating with Situare server
36 * @class SituareService situareservice.h "situareservice/situareservice.h"
38 class SituareService : public QObject
45 * @brief Default constructor
48 * @param parent instance of parent
49 * @param manager instance of QNetworkAccessManager
51 SituareService(QObject *parent = 0, QNetworkAccessManager *manager = 0);
55 * @brief Updates location to the Situare server
58 * @param coordinates current cordinates
59 * @param status message
60 * @param publish publish location on Facebook wall (true/false)
62 void updateLocation(QPointF coordinates, QString status, bool publish);
65 * @brief Forms a http url
68 * @param baseUrl Server url
69 * @param phpScript Server script
70 * @param urlParameters optional parameters for url
71 * @return QUrl formed url
73 QUrl formUrl(QString baseUrl, QString phpScript, QString urlParameters = 0);
76 * @brief Forms url parameters
78 * @fn formUrlParameters
79 * @param coordinates current coordinates
80 * @param status status message
81 * @param publish publish location on Facebook wall (true/false)
84 QString formUrlParameters(QPointF coordinates, QString status, QString publish);
87 * @brief Forms a http cookie
90 * @param apiKeyValue application key
91 * @param expiresValue session expire date&time from Facebook
92 * @param userValue user id from Facebook
93 * @param sessionKeyValue session key from Facebook
94 * @param sessionSecretValue session secret from Facebook
95 * @param signatureValue md5 generated signature
96 * @param localeValue used locale
97 * @return QString formed cookie
99 //QString formCookie(QString apiKeyValue, QString expiresValue, QString userValue, QString sessionKeyValue, QString sessionSecretValue, QString signatureValue, QString localeValue);
102 * @brief Sends http request
105 * @param url destination
106 * @param cookie http cookie
108 void sendRequest(QUrl url, QString cookie);
113 * @brief Public slot, which indicates when http request has been completed
115 * @fn requestFinished
116 * @param reply storage for http reply
118 void requestFinished(QNetworkReply *reply);
121 QNetworkAccessManager *m_manager;
122 QList<QNetworkReply *> currentRequests;
125 #endif // SITUARESERVICE_H