source: SMSSender/lib/libgateway/src/business/HttpCookieManager.h @ 41:680c6a482e9d

3.0
Last change on this file since 41:680c6a482e9d was 41:680c6a482e9d, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
File size: 1.2 KB
Line 
1/*
2 * AbstractAccount.h
3 *
4 *  Created on: Jul 9, 2009
5 *      Author: saemy
6 */
7
8#ifndef HTTPCOOKIEMANAGER_H_
9#define HTTPCOOKIEMANAGER_H_
10
11#include <QObject>
12#include <QDateTime>
13#include <QHttp>
14#include <QString>
15#include <QUrl>
16
17class HttpCookie: public QObject {
18    Q_OBJECT
19
20public:
21    HttpCookie()
22        : value ("")
23        , path ("/")
24        , secure(false)
25        , domain("*")
26        , expiresOn(QDateTime::currentDateTime().addYears(1)) // To never reach this...
27    {}
28
29    QString value;
30    QString path;
31    bool secure;
32    QString domain;
33    QDateTime expiresOn;
34
35    virtual bool isApplicable(const QUrl& url) const;
36};
37
38class HttpCookieManager: QObject {
39    Q_OBJECT
40
41public:
42    HttpCookieManager(QHttp* http);
43    virtual ~HttpCookieManager();
44
45    virtual void    addCookieToHeader(QHttpRequestHeader* header, const QUrl& url) const;
46
47    virtual bool    isCookieSet() const;
48    virtual void    clearCookies();
49
50    virtual void    processResponseHeader(const QHttpResponseHeader& responseHeader);
51
52private:
53    QMap<QString, HttpCookie*> cookies_;
54    QHttp*                     http_;
55
56private slots:
57     void parseResponseHeader(const QHttpResponseHeader& responseHeader);
58};
59
60#endif /* HTTPCOOKIEMANAGER_H_ */
Note: See TracBrowser for help on using the repository browser.