28 #ifndef dooble_accepted_or_blocked_domains_h
29 #define dooble_accepted_or_blocked_domains_h
32 #include <QMainWindow>
33 #include <QMessageBox>
35 #include <QSqlDatabase>
36 #include <QTableWidgetItem>
39 #include "ui_dooble_accepted_or_blocked_domains.h"
48 bool contains(
const QString &domain)
const;
49 bool exception(
const QUrl &url)
const;
51 void accept_or_block_domain(
const QString &domain,
bool replace =
true);
52 void new_exception(
const QString &url);
57 void showNormal(
void);
60 void closeEvent(QCloseEvent *event);
61 void keyPressEvent(QKeyEvent *event);
62 void resizeEvent(QResizeEvent *event);
65 QFuture<void> m_future;
66 QHash<QString, char> m_domains;
67 QHash<QString, char> m_exceptions;
68 QHash<QString, char> m_session_origin_hosts;
69 QPointer<QMessageBox> m_import_dialog;
70 QTimer m_search_timer;
71 Ui_dooble_accepted_or_blocked_domains m_ui;
72 void create_tables(QSqlDatabase &db);
74 void populate_exceptions(
void);
75 void save(
const QByteArray &authentication_key,
76 const QByteArray &encryption_key,
77 const QHash<QString, char> &hash);
78 void save_blocked_domain(
const QString &domain,
bool replace,
bool state);
79 void save_exception(
const QString &url,
bool state);
80 void save_settings(
void);
84 void slot_add_session_url(
const QUrl &first_party_url,
85 const QUrl &origin_url);
86 void slot_delete_all_exceptions(
void);
87 void slot_delete_selected(
void);
88 void slot_delete_selected_exceptions(
void);
89 void slot_exceptions_item_changed(QTableWidgetItem *item);
91 void slot_import(
void);
92 void slot_imported(
void);
93 void slot_item_changed(QTableWidgetItem *item);
94 void slot_maximum_entries_changed(
int value);
95 void slot_new_exception(
const QString &url);
96 void slot_new_exception(
void);
97 void slot_populate(
void);
98 void slot_radio_button_toggled(
bool state);
100 void slot_save_selected(
void);
101 void slot_search_timer_timeout(
void);
104 void add_session_url(
const QUrl &first_party_url,
const QUrl &origin_url);
106 void populated(
void);
113 QTableWidgetItem(text)
121 bool operator < (
const QTableWidgetItem &other)
const
123 if(Qt::ItemIsUserCheckable & flags())
124 return checkState() < other.checkState();
126 return other.text() > text();