Skip to content
API Documentation
BastionGuard™
SettingsWindow.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#include <gtkmm.h>
23#include "SettingsPage.hpp"
24#include "ClamdConfig.hpp"
25#include <vector>
26#include <map>
27#include <string>
28
29class SettingsWindow : public Gtk::Window {
30public:
31 explicit SettingsWindow(ClamdConfig& config);
32
33private:
34 Gtk::Box mainBox_ {Gtk::Orientation::HORIZONTAL, 0};
35 Gtk::Stack stack_;
36
38 Gtk::Box* sidebar_box_ = nullptr;
39 std::vector<Gtk::Button*> all_leaf_buttons_;
40
41 std::map<Gtk::Button*, Gtk::Box*> button_submenu_;
42
43 Gtk::Button* active_button_ = nullptr;
44 int active_page_ = 0;
45
46 void build_headerbar();
47 void build_sidebar(ClamdConfig& config);
48
49 Gtk::Button* make_group_button(const std::string& icon_path,
50 const std::string& label_text,
51 Gtk::Box** out_submenu = nullptr);
52
53 Gtk::Button* make_leaf_button(const std::string& label_text,
54 bool indent = false,
55 Gtk::Box* parent_submenu = nullptr);
56
57 void activate_button(Gtk::Button* btn);
58};
std::vector< Gtk::Button * > all_leaf_buttons_
Gtk::Button * make_leaf_button(const std::string &label_text, bool indent=false, Gtk::Box *parent_submenu=nullptr)
Gtk::Box * sidebar_box_
SettingsWindow(ClamdConfig &config)
SettingsPage * settingsPage_
Gtk::Button * active_button_
Gtk::Button * make_group_button(const std::string &icon_path, const std::string &label_text, Gtk::Box **out_submenu=nullptr)
void build_sidebar(ClamdConfig &config)
void activate_button(Gtk::Button *btn)
std::map< Gtk::Button *, Gtk::Box * > button_submenu_