Skip to content
API Documentation
BastionGuard™
IdentityLeakPage.hpp
Go to the documentation of this file.
1/*
2 * BastionGuard™
3 * Copyright (C) 2025–2026 Calogero Scarnà
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 *
17 * BastionGuard™ is a trademark of Calogero Scarnà.
18 * The BastionGuard™ name and branding are not licensed under the GPL.
19 */
20
21#pragma once
22
23#include <gtkmm.h>
24#include <thread>
25#include <atomic>
26#include <memory>
27#include <string>
28
30
31class LeakMonitor;
32
33class IdentityLeakPage : public Gtk::Box {
34public:
35 explicit IdentityLeakPage(Gtk::Window& parent);
36 ~IdentityLeakPage() override;
37
38private:
39 Gtk::Window& parentWindow;
40
41 Gtk::Label titleLabel;
42 Gtk::Entry emailEntry;
43
44 Gtk::Entry apiKeyEntry;
45 Gtk::Button apiToggleButton;
46 Gtk::Button saveHibpButton;
47 Gtk::Entry passwordEntry;
49
53
54 Gtk::CheckButton monitorToggle;
55 Gtk::Button checkButton;
56
57 Gtk::ScrolledWindow logScroller;
58 Gtk::TextView logView;
59 Glib::RefPtr<Gtk::TextBuffer> logBuffer;
60
61 std::thread workerThread;
62 std::atomic<bool> running { false };
63
64 std::unique_ptr<LeakMonitor> monitor;
65 std::atomic<bool> monitorActive { false };
66
67 void appendLog(const Glib::ustring& text);
68
69 void startMonitor(const std::string& email);
70 void stopMonitor();
71
72 void onCheckClicked();
74 void showPrivacyPopup();
78
79 void onSaveHibpApi();
80 void onSaveLeakCheckApi();
81
82 void onMonitorToggled();
83
85};
Gtk::CheckButton monitorToggle
IdentityLeakPage(Gtk::Window &parent)
Gtk::Window & parentWindow
Gtk::Button leakCheckToggleButton
Glib::RefPtr< Gtk::TextBuffer > logBuffer
Gtk::Button apiToggleButton
void startMonitor(const std::string &email)
void onToggleLeakCheckApiVisibility()
Gtk::Button checkPasswordButton
Gtk::Entry leakCheckApiEntry
void appendLog(const Glib::ustring &text)
std::atomic< bool > running
Gtk::TextView logView
std::unique_ptr< LeakMonitor > monitor
Gtk::Button saveLeakCheckButton
std::atomic< bool > monitorActive
Gtk::Button saveHibpButton
BastionGuard::AliveFlag alive_
Gtk::ScrolledWindow logScroller
std::shared_ptr< std::atomic< bool > > AliveFlag
AliveFlag make_alive_flag()