YODAU 1.0
YEAR OF THE DEPEND ADULT UNDERGARMENT
Loading...
Searching...
No Matches
main_window.hpp
Go to the documentation of this file.
1#ifndef YODAU_FRONTEND_MAIN_WINDOW_HPP
2#define YODAU_FRONTEND_MAIN_WINDOW_HPP
3
4#ifdef KC_KDE
5#include <KXmlGuiWindow>
6using BaseMainWindow = KXmlGuiWindow;
7#else
8#include <QMainWindow>
9using BaseMainWindow = QMainWindow;
10#endif
11
12class board;
13class settings_panel;
14class QDockWidget;
15class QStackedWidget;
16
17/**
18 * @file main_window.hpp
19 * @brief Declares the application's main top-level window.
20 *
21 * The main window hosts the primary UI:
22 * - a central @ref board widget that shows streams,
23 * - a @ref settings_panel that manages streams and lines.
24 *
25 * Platform-dependent layout:
26 * - On desktop, settings are shown in a dock widget.
27 * - On Android, board and settings are placed into a stacked view and can be
28 * swapped by the user via toolbar actions.
29 */
30
31/**
32 * @brief Application main window with board and settings panel.
33 *
34 * The window is responsible for assembling the frontend object graph:
35 * - creates backend @ref yodau::backend::stream_manager,
36 * - creates UI widgets (@ref board and @ref settings_panel),
37 * - creates a @ref controller that binds UI to backend,
38 * - wires high-level signals from settings to controller slots.
39 *
40 * Lifetime rules:
41 * - UI widgets are children of the window and are deleted with it.
42 * - The backend stream manager is allocated on heap and explicitly deleted
43 * when the window is destroyed.
44 * - The controller is a QObject child and follows Qt parent ownership.
45 *
46 * @note The class is final and not intended for subclassing.
47 */
48class main_window final : public BaseMainWindow {
50public:
51 /**
52 * @brief Construct the main window and create all core UI components.
53 *
54 * Desktop:
55 * - board is set as central widget;
56 * - settings panel is placed into a right-side dock with a toolbar toggle.
57 *
58 * Android:
59 * - board and settings are packed into a @ref QStackedWidget;
60 * - the stack becomes the central widget.
61 *
62 * In all cases:
63 * - a backend @ref yodau::backend::stream_manager is created;
64 * - a @ref controller is constructed and connected;
65 * - local sources detection is triggered once.
66 *
67 * @param parent Optional parent widget.
68 */
69 explicit main_window(QWidget* parent = nullptr);
70
71private:
72 /** @brief Central board widget showing streams (owned). */
74
75 /** @brief Settings side panel (owned). */
77
78#if defined(KC_ANDROID) || defined(Q_OS_ANDROID)
79 /**
80 * @brief Stacked container for mobile layouts.
81 *
82 * Holds the board and settings as separate pages.
83 */
85#else
86 /**
87 * @brief Dock widget hosting settings on desktop platforms.
88 */
89 QDockWidget* settings_dock;
90#endif
91};
92
93#endif // YODAU_FRONTEND_MAIN_WINDOW_HPP
board(QWidget *parent=nullptr)
Construct the board widget.
Definition board.cpp:8
QMap< QString, std::vector< stream_cell::line_instance > > per_stream_lines
Per-stream persistent line instances keyed by stream name.
void handle_detect_local_sources()
Handler for detecting available local sources.
QDockWidget * settings_dock
Dock widget hosting settings on desktop platforms.
board * main_zone
Central board widget showing streams (owned).
main_window(QWidget *parent=nullptr)
Construct the main window and create all core UI components.
settings_panel * settings
Settings side panel (owned).
settings_panel(QWidget *parent=nullptr)
Construct the settings panel.
void detect_local_sources_requested()
User requested re-detection of local sources.
Central coordinator for streams, geometry, frame processing and events.
#define str_label(text)
Create a user-visible localized label.
Definition str_label.hpp:29