BastionGuard/src/MainWindow.hpp

97 lines
2.9 KiB
C++

/*
* BastionGuard™
* Copyright (C) 2025–2026 Calogero Scarnà
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* BastionGuard™ is a trademark of Calogero Scarnà.
* The BastionGuard™ name and branding are not licensed under the GPL.
*/
#pragma once
#include <gtkmm.h>
#include "DashboardPage.hpp"
#include "ScanPage.hpp"
#include "LogPage.hpp"
#include "SettingsPage.hpp"
#include "QuarantinePage.hpp"
#include "UpdatePage.hpp"
#include "AboutPage.hpp"
#include "DonatePage.hpp"
#ifndef BASTIONGUARD_HAS_CEF
#define BASTIONGUARD_HAS_CEF 1
#endif
#if BASTIONGUARD_HAS_CEF
#include "BankPage.hpp"
#endif
#include "PrivacyPage.hpp"
#include "rootguard/RootGuardPage.hpp"
#include "AntiRansomwarePage.hpp"
#include "SettingsWindow.hpp"
#include "usb/USBScanPage.hpp"
#include "IdentityLeakPage/ui/IdentityLeakPage.hpp"
#include "SambaPage.hpp"
#include "phishing_search/PhishingPage.hpp"
#include "vpn/VpnPage.hpp"
#include "password_manager/PasswordManagerPage.hpp"
#include "backup/BackupPage.hpp"
class ClamdConfig;
class MainWindow : public Gtk::Window {
public:
MainWindow();
~MainWindow() override = default;
void showDashboard();
void open_settings_window();
protected:
bool on_close_request() override;
private:
Gtk::Box mainBox{Gtk::Orientation::HORIZONTAL};
Gtk::Stack stack_;
std::vector<Gtk::Button*> sidebar_buttons_;
AboutPage about_page_;
DonatePage donate_page_;
DashboardPage dashboard_page_;
ScanPage scan_page_{*this};
LogPage log_page_;
ClamdConfig clamdConfig_;
SettingsWindow* settings_window_ = nullptr;
#if BASTIONGUARD_HAS_CEF
BankPage* bank_page_ = nullptr;
#endif
QuarantinePage quarantine_page_;
PhishingPage* phishing_page_ = nullptr;
VpnPage* vpn_page_ = nullptr;
UpdatePage update_page_;
PrivacyPage* privacy_page_;
RootGuardPage* rootguard_page_ = nullptr;
AntiRansomwarePage* anti_ransomware_page_ = nullptr;
USBScanPage* usb_page_ = nullptr;
SambaPage* samba_page_ = nullptr;
IdentityLeakPage* identity_leak_page_ = nullptr;
PasswordManagerPage* password_manager_page_ = nullptr;
BackupPage* backup_page_ = nullptr;
void build_headerbar();
void build_sidebar(ClamdConfig& clamdConfig);
Gtk::Button* dashboard_button_ = nullptr;
void activate_sidebar_button(Gtk::Button* btn);
void minimize();
};