File indexing completed on 2024-05-19 04:59:14

0001 /* ============================================================
0002 * FlashCookieManager plugin for Falkon
0003 * Copyright (C) 2014  S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
0004 * Copyright (C) 2010-2014  David Rosca <nowrep@gmail.com>
0005 *
0006 * some codes and ideas are taken from cookiemanager.cpp and cookiemanager.ui
0007 *
0008 * This program is free software: you can redistribute it and/or modify
0009 * it under the terms of the GNU General Public License as published by
0010 * the Free Software Foundation, either version 3 of the License, or
0011 * (at your option) any later version.
0012 *
0013 * This program is distributed in the hope that it will be useful,
0014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0016 * GNU General Public License for more details.
0017 *
0018 * You should have received a copy of the GNU General Public License
0019 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0020 * ============================================================ */
0021 #ifndef FCM_DIALOG_H
0022 #define FCM_DIALOG_H
0023 
0024 #include <QDialog>
0025 
0026 
0027 namespace Ui
0028 {
0029 class FCM_Dialog;
0030 }
0031 
0032 class QTreeWidgetItem;
0033 
0034 class BrowserWindow;
0035 class FCM_Plugin;
0036 
0037 class FCM_Dialog : public QDialog
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042     explicit FCM_Dialog(FCM_Plugin* manager, QWidget* parent = nullptr);
0043     ~FCM_Dialog() override;
0044 
0045     void refreshView(bool forceReload = false);
0046     void showPage(int index);
0047 
0048 private Q_SLOTS:
0049     void currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* parent);
0050     void removeCookie();
0051     void removeAll();
0052 
0053     void refreshFlashCookiesTree();
0054     void refreshFilters();
0055 
0056     void addWhitelist();
0057     void addWhitelist(const QString &origin);
0058     void removeWhitelist();
0059     void addBlacklist();
0060     void addBlacklist(const QString &origin);
0061     void removeBlacklist();
0062 
0063     void deletePressed();
0064     void autoModeChanged(bool state);
0065 
0066     void filterString(const QString &string);
0067 
0068     void reloadFromDisk();
0069     void cookieTreeContextMenuRequested(const QPoint &pos);
0070 
0071 private:
0072     void closeEvent(QCloseEvent* e) override;
0073     void keyPressEvent(QKeyEvent* e) override;
0074 
0075     Ui::FCM_Dialog* ui;
0076 
0077     FCM_Plugin* m_manager;
0078 };
0079 
0080 #endif // FCM_DIALOG_H