2 * Copyright 2022-2023 Soren Stoutner <soren@stoutner.com>.
4 * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
6 * Privacy Browser PC 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, either version 3 of the License, or
9 * (at your option) any later version.
11 * Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef COOKIESDATABASE_H
21 #define COOKIESDATABASE_H
23 // Qt framework headers.
24 #include <QNetworkCookie>
30 // The default constructor.
33 // The public functions.
34 static void addDatabase();
35 static void addCookie(const QNetworkCookie &cookie);
36 static int cookieCount();
37 static void deleteAllCookies();
38 static void deleteCookie(const QNetworkCookie &cookie);
39 static QList<QNetworkCookie*>* getCookies();
40 static QNetworkCookie* getCookieById(const int &id);
41 static bool isDurable(const QNetworkCookie &cookie);
42 static bool isUpdate(const QNetworkCookie &cookie);
43 static void updateCookie(const QNetworkCookie &cookie);
44 static void updateCookie(const QNetworkCookie &oldCookie, const QNetworkCookie &newCookie);
46 // The public constants.
47 static const QString CONNECTION_NAME;
48 static const QString COOKIES_TABLE;
49 static const QString DOMAIN;
50 static const QString EXPIRATION_DATE;
51 static const QString HTTP_ONLY;
52 static const QString ID;
53 static const QString NAME;
54 static const QString PATH;
55 static const QString SECURE;
56 static const QString VALUE;
59 // The private static constants.
60 static const int SCHEMA_VERSION;