Added missing files
[situare] / src / network / networkcookiejar.h
1 /*
2     Situare - A location system for Facebook
3     Copyright (C) 2010  Ixonos Plc. Authors:
4
5         Henri Lampela - henri.lampela@ixonos.com
6
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.
10
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.
15
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,
19     USA.
20 */
21
22 #ifndef NETWORKCOOKIEJAR_H
23 #define NETWORKCOOKIEJAR_H
24
25 #include <QNetworkCookieJar>
26
27 /**
28 * @brief Sub-class of QNetworkCookieJar, needed for cookie saving
29 *
30 * @author Henri Lampela
31 */
32 class NetworkCookieJar : public QNetworkCookieJar
33 {
34     Q_OBJECT
35
36 public:
37
38     /**
39     * @brief Constructor
40     *
41     * @param parent Instance of parent
42     */
43     explicit NetworkCookieJar(QObject *parent = 0);
44
45 /*******************************************************************************
46  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
47  ******************************************************************************/
48
49     /**
50     * @brief Sets all network cookies
51     *
52     * @param cookieList Network cookie list
53     */
54     void setAllCookies ( const QList<QNetworkCookie> & cookieList );
55
56     /**
57     * @brief Gets all networks cookies
58     *
59     * @return QList<QNetworkCookie> Network cookie list
60     */
61     QList<QNetworkCookie> allCookies() const;
62
63     /**
64     * @brief Sets network cookies from url
65     *
66     * @param cookieList Network cookie list
67     * @param url Url
68     * @return bool Return value
69     */
70     bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url);
71
72     /**
73     * @brief Empty implementation
74     *
75     * @param url Url
76     * @return QList<QNetworkCookie> Network cookie list
77     */
78     QList<QNetworkCookie> cookiesForUrl(const QUrl & url) const;
79
80 /*******************************************************************************
81  * DATA MEMBERS
82  ******************************************************************************/
83
84 private:
85
86     QList<QNetworkCookie> m_cookieList; ///< Placeholder for network cookies
87
88 };
89
90 #endif // NETWORKCOOKIEJAR_H