X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fdialogs%2FAddOrEditCookieDialog.h;fp=src%2Fdialogs%2FAddOrEditCookieDialog.h;h=5bc763f6e5a2b6dc9f87bf28ec47a2388954185d;hp=0000000000000000000000000000000000000000;hb=cba9a47f00b59f59f76f1b5195086285ca0cdb59;hpb=9b6cee96126484925bec4f4ab30c2b880df687fe diff --git a/src/dialogs/AddOrEditCookieDialog.h b/src/dialogs/AddOrEditCookieDialog.h new file mode 100644 index 0000000..5bc763f --- /dev/null +++ b/src/dialogs/AddOrEditCookieDialog.h @@ -0,0 +1,69 @@ +/* + * Copyright © 2022 Soren Stoutner . + * + * This file is part of Privacy Browser PC . + * + * Privacy Browser PC is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Privacy Browser PC is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Privacy Browser PC. If not, see . + */ + +#ifndef ADDOREDITCOOKIEDIALOG_H +#define ADDOREDITCOOKIEDIALOG_H + +// Qt toolkit headers. +#include +#include +#include +#include + +class AddOrEditCookieDialog : public QDialog +{ + // Include the Q_OBJECT macro. + Q_OBJECT + +public: + // The primary constructor. + explicit AddOrEditCookieDialog(const int &dialogType, const QNetworkCookie *cookiePointer = nullptr); + + // The public static constants. + static const int AddCookie; + static const int EditCookie; + +signals: + // The signals. + void addCookie(const QNetworkCookie &cookie) const; + void deleteCookie(const QNetworkCookie &cookie) const; + +private Q_SLOTS: + // The private slots. + void saveCookie(); + void updateExpirationDateTimeState(const int &newState) const; + void updateUi() const; + +private: + // The private widgets. + QLineEdit *domainLineEditPointer; + QCheckBox *expirationCheckBoxPointer; + QDateTimeEdit *expirationDateTimeEditPointer; + QCheckBox *httpOnlyCheckBoxPointer; + QLineEdit *nameLineEditPointer; + QLineEdit *pathLineEditPointer; + QPushButton *saveButtonPointer; + QCheckBox *secureCheckBoxPointer; + QLineEdit *valueLineEditPointer; + + // The private variables. + QNetworkCookie oldCookie; + bool isEditDialog; +}; +#endif