Skip to content
API Documentation
BastionGuard™
PasswordManagerPage.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 <vector>
25
26#include "PasswordVault.hpp"
27#include "PasswordEntry.hpp"
28#include "PasswordSearchRow.hpp"
29#include "../LifetimeGuard.hpp"
30
31class PasswordManagerPage : public Gtk::Box {
32public:
34 ~PasswordManagerPage() override;
35
36private:
38 std::vector<PasswordEntry> entriesCache_;
40 Gtk::Label securityIcon_;
41 Gtk::Label securityLabel_;
42 Gtk::Box topBar_;
43 Gtk::Button unlockButton_;
44 Gtk::Button lockButton_;
45 Gtk::Box stateBox_;
46 Gtk::Label stateLabel_;
47
48 // Riga 2: azioni
49 Gtk::Box actionBar_;
50 Gtk::Button addButton_;
51 Gtk::Button importButton_;
52 Gtk::Button vaultViewButton_;
53 Gtk::Button refreshButton_;
54 Gtk::Button deleteAllButton_;
55 Gtk::SearchEntry searchEntry_;
56
57 Gtk::ScrolledWindow listScrolled_;
58 Gtk::Box entriesBox_;
59
60 Gtk::ScrolledWindow logScrolled_;
61 Gtk::TextView outputView_;
62 Glib::RefPtr<Gtk::TextBuffer> buffer_;
63
64 void buildUi();
65 void setVaultState(bool unlocked, const std::string& msg = "");
66 void reload();
67 void refreshEntries(const std::string& filter = "");
68 void createEntryRow(const PasswordEntry& entry);
69
70 void onUnlockClicked();
71 void onLockClicked();
72 void onAddClicked();
73 void onImportClicked();
74 void onVaultViewClicked();
75 void onDeleteAllClicked();
76 void onRefreshClicked();
77 void onSearchChanged();
78
79 void onRevealEntry(const PasswordEntry& entry);
80 void onEditEntry(const PasswordEntry& entry);
81 void onDeleteEntry(const PasswordEntry& entry);
82
83 Gtk::Window* getParentWindow();
84 void logSafe(const std::string& msg);
85
87};
Gtk::Window * getParentWindow()
Gtk::ScrolledWindow logScrolled_
Gtk::ScrolledWindow listScrolled_
void onRevealEntry(const PasswordEntry &entry)
void setVaultState(bool unlocked, const std::string &msg="")
void createEntryRow(const PasswordEntry &entry)
Gtk::SearchEntry searchEntry_
BastionGuard::AliveFlag alive_
void refreshEntries(const std::string &filter="")
std::vector< PasswordEntry > entriesCache_
Glib::RefPtr< Gtk::TextBuffer > buffer_
void onDeleteEntry(const PasswordEntry &entry)
void logSafe(const std::string &msg)
void onEditEntry(const PasswordEntry &entry)
std::shared_ptr< std::atomic< bool > > AliveFlag
AliveFlag make_alive_flag()