source: SMSSender/lib/libdatatypes/src/shttpcookiemanager.h @ 71:415b45c71663

3.0
Last change on this file since 71:415b45c71663 was 71:415b45c71663, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Reorganized all the libraries. libinterfaces and libgateways are removed now and libdatatypes contains now all these files.
File size: 1.2 KB
Line 
1/*
2 * AbstractAccount.h
3 *
4 *  Created on: Jul 9, 2009
5 *      Author: saemy
6 */
7
8#ifndef SHTTPCOOKIEMANAGER_H_
9#define SHTTPCOOKIEMANAGER_H_
10
11#include <QObject>
12#include <QDateTime>
13#include <QHttp>
14#include <QString>
15#include <QUrl>
16
17class SHttpCookie: public QObject {
18    Q_OBJECT
19
20public:
21    SHttpCookie()
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 SHttpCookieManager: public QObject {
39    Q_OBJECT
40
41public:
42    SHttpCookieManager(QHttp* http);
43    virtual ~SHttpCookieManager();
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, SHttpCookie*> cookies_;
54    QHttp*                     http_;
55
56private slots:
57     void parseResponseHeader(const QHttpResponseHeader& responseHeader);
58};
59
60#endif /* SHTTPCOOKIEMANAGER_H_ */
Note: See TracBrowser for help on using the repository browser.