~dbarth/webbrowser-app/single-account-dialog

« back to all changes in this revision

Viewing changes to src/app/webcontainer/local-cookie-store.h

  • Committer: Robert Bruce Park
  • Date: 2014-08-28 20:53:02 UTC
  • mfrom: (667.6.6 webbrowser-app)
  • Revision ID: robert.park@canonical.com-20140828205302-xik6rtl2g2ekrd0j
Releasing 0.23+14.10.20140828-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2014 Canonical Ltd.
 
3
 *
 
4
 * This file is part of webbrowser-app.
 
5
 *
 
6
 * webbrowser-app is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * webbrowser-app is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
#ifndef LOCAL_COOKIE_STORE_H
 
20
#define LOCAL_COOKIE_STORE_H
 
21
 
 
22
#include "cookie-store.h"
 
23
 
 
24
#include <QSqlDatabase>
 
25
 
 
26
class LocalCookieStore : public CookieStore
 
27
{
 
28
    Q_OBJECT
 
29
    Q_PROPERTY(QString dbPath READ dbPath WRITE setDbPath NOTIFY dbPathChanged)
 
30
 
 
31
public:
 
32
    LocalCookieStore(QObject* parent = 0);
 
33
 
 
34
    void setDbPath(const QString& path);
 
35
    QString dbPath() const;
 
36
 
 
37
    QDateTime lastUpdateTimeStamp() const Q_DECL_OVERRIDE;
 
38
 
 
39
Q_SIGNALS:
 
40
    void dbPathChanged();
 
41
 
 
42
private:
 
43
    virtual void doGetCookies() Q_DECL_OVERRIDE;
 
44
    virtual void doSetCookies(const Cookies& cookies) Q_DECL_OVERRIDE;
 
45
 
 
46
    bool createDb();
 
47
 
 
48
private:
 
49
    QString m_dbPath;
 
50
    QSqlDatabase m_db;
 
51
};
 
52
 
 
53
#endif // LOCAL_COOKIE_STORE_H