FOSSredder 0.5.0
Loading...
Searching...
No Matches
AppContext.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <QObject>
9
12#include "ui/shell/AppActions.h"
13#include "ui/shell/Navigation.h"
14#include "ui/shell/Status.h"
24
25namespace ui::bootstrap {
26
27class AppContext : public QObject {
28 Q_OBJECT
29 Q_PROPERTY(
32 NOTIFY navigationChanged)
35 Q_PROPERTY(
36 ui::Status* status READ status WRITE setStatus NOTIFY statusChanged)
57 Q_PROPERTY(bool isDebugBuild READ isDebugBuild WRITE setIsDebugBuild NOTIFY
59
60public:
65 explicit AppContext(QObject* parent = nullptr);
66
67 ui::Actions* actions() const noexcept {
68 return actions_;
69 }
70 ui::Navigation* navigation() const noexcept {
71 return navigation_;
72 }
74 return fileSystemBrowser_;
75 }
76 ui::Status* status() const noexcept {
77 return status_;
78 }
80 return actorViewModel_;
81 }
83 return bookingViewModel_;
84 }
86 return contractViewModel_;
87 }
89 return propertyViewModel_;
90 }
92 return analysisViewModel_;
93 }
95 return annualViewModel_;
96 }
98 return exportViewModel_;
99 }
101 return importViewModel_;
102 }
104 return settingsViewModel_;
105 }
107 return languageService_;
108 }
109 bool isDebugBuild() const noexcept {
110 return isDebugBuild_;
111 }
112
117 void setActions(ui::Actions* value);
122 void setNavigation(ui::Navigation* value);
132 void setStatus(ui::Status* value);
187 void setIsDebugBuild(bool value);
188
189signals:
250
251private:
252 ui::Actions* actions_ = nullptr;
253 ui::Navigation* navigation_ = nullptr;
254 ui::FileSystemBrowser* fileSystemBrowser_ = nullptr;
255 ui::Status* status_ = nullptr;
256 ui::ActorViewModel* actorViewModel_ = nullptr;
257 ui::BookingViewModel* bookingViewModel_ = nullptr;
258 ui::ContractViewModel* contractViewModel_ = nullptr;
259 ui::PropertyViewModel* propertyViewModel_ = nullptr;
260 ui::AnalysisViewModel* analysisViewModel_ = nullptr;
261 ui::AnnualViewModel* annualViewModel_ = nullptr;
262 ui::ExportViewModel* exportViewModel_ = nullptr;
263 ui::ImportViewModel* importViewModel_ = nullptr;
264 ui::SettingsViewModel* settingsViewModel_ = nullptr;
265 ui::LanguageService* languageService_ = nullptr;
266 bool isDebugBuild_ = false;
267};
268
269} // namespace ui::bootstrap
Declares the QML API for the Actor view.
Declares the QML API for the Analysis view.
Declares the QML API for the Annual view.
Declares QAction wrappers exposed to the UI layer and QML.
Declares the QML API for the Booking view.
Declares the QML API for the Contract view.
Declares the QML API for the Export view.
Declares the UI helper that exposes a minimal filesystem view to QML.
Declares the QML API for import overview and draft review.
Declares the UI service responsible for runtime language switching.
Declarations for the UI Navigation component.
Declares the QML API for the Property view.
Declares the Settings page view model.
Declarations for the UI Status component.
Owns the main window actions and exposes them to QML.
Definition AppActions.h:18
Owns editable actor UI state and delegates actor CRUD to workspace.
Owns Analysis view form state and delegates analysis CRUD and computation to workspace and workflow.
Owns Annual view form state and delegates annual CRUD and computation to workspace and workflow.
Owns Booking view form state and delegates statement and transaction CRUD to workspace.
Owns editable contract UI state and delegates contract CRUD to workspace.
Owns Export view state and delegates export execution to ExportWorkflow.
Exposes directory listing and application-directory lookup to QML.
Exposes import overview, statement draft, and transaction draft state to QML.
Manages the active UI language and the available translation options.
Stores the active top-level shell section and settings sub-section.
Definition Navigation.h:15
Owns editable property UI state and delegates property CRUD to workspace.
Owns Settings view navigation and delegates persisted values.
Exposes the shell status text shown by the main window.
Definition Status.h:16
ui::SettingsViewModel * settingsViewModel() const noexcept
Definition AppContext.h:103
void annualViewModelChanged()
Emitted when annual view model changed.
void setContractViewModel(ui::ContractViewModel *value)
Sets contract view model exposed to QML.
void setAnnualViewModel(ui::AnnualViewModel *value)
Sets annual view model exposed to QML.
ui::ContractViewModel * contractViewModel
Definition AppContext.h:42
void exportViewModelChanged()
Emitted when export view model changed.
ui::AnnualViewModel * annualViewModel
Definition AppContext.h:48
ui::SettingsViewModel * settingsViewModel
Definition AppContext.h:54
ui::FileSystemBrowser * fileSystemBrowser() const noexcept
Definition AppContext.h:73
void fileSystemBrowserChanged()
Emitted when filesystem browser changed.
ui::LanguageService * languageService() const noexcept
Definition AppContext.h:106
ui::AnalysisViewModel * analysisViewModel
Definition AppContext.h:46
void setStatus(ui::Status *value)
Sets status state exposed to QML.
ui::LanguageService * languageService
Definition AppContext.h:56
ui::ContractViewModel * contractViewModel() const noexcept
Definition AppContext.h:85
ui::Status * status() const noexcept
Definition AppContext.h:76
void setImportViewModel(ui::ImportViewModel *value)
Sets import view model exposed to QML.
void actorViewModelChanged()
Emitted when actor view model changed.
ui::PropertyViewModel * propertyViewModel() const noexcept
Definition AppContext.h:88
ui::ActorViewModel * actorViewModel
Definition AppContext.h:38
void setPropertyViewModel(ui::PropertyViewModel *value)
Sets property view model exposed to QML.
void setIsDebugBuild(bool value)
Sets whether the running binary is a debug build.
void settingsViewModelChanged()
Emitted when settings view model changed.
ui::Navigation * navigation() const noexcept
Definition AppContext.h:70
void contractViewModelChanged()
Emitted when contract view model changed.
void propertyViewModelChanged()
Emitted when property view model changed.
void actionsChanged()
Emitted when actions changed.
ui::ActorViewModel * actorViewModel() const noexcept
Definition AppContext.h:79
ui::Navigation * navigation
Definition AppContext.h:32
void setAnalysisViewModel(ui::AnalysisViewModel *value)
Sets analysis view model exposed to QML.
void analysisViewModelChanged()
Emitted when analysis view model changed.
void isDebugBuildChanged()
Emitted when debug build flag changed.
void setSettingsViewModel(ui::SettingsViewModel *value)
Sets settings view model exposed to QML.
void setBookingViewModel(ui::BookingViewModel *value)
Sets booking view model exposed to QML.
void setNavigation(ui::Navigation *value)
Sets navigation state exposed to QML.
ui::AnalysisViewModel * analysisViewModel() const noexcept
Definition AppContext.h:91
ui::FileSystemBrowser * fileSystemBrowser
Definition AppContext.h:34
ui::ExportViewModel * exportViewModel() const noexcept
Definition AppContext.h:97
void setFileSystemBrowser(ui::FileSystemBrowser *value)
Sets filesystem browsing service exposed to QML.
void setExportViewModel(ui::ExportViewModel *value)
Sets export view model exposed to QML.
void setLanguageService(ui::LanguageService *value)
Sets language service exposed to QML.
ui::ImportViewModel * importViewModel
Definition AppContext.h:52
ui::BookingViewModel * bookingViewModel
Definition AppContext.h:40
bool isDebugBuild() const noexcept
Definition AppContext.h:109
ui::PropertyViewModel * propertyViewModel
Definition AppContext.h:44
void languageServiceChanged()
Emitted when language service changed.
void statusChanged()
Emitted when status state changed.
void setActions(ui::Actions *value)
Sets shell actions exposed to QML.
ui::BookingViewModel * bookingViewModel() const noexcept
Definition AppContext.h:82
void importViewModelChanged()
Emitted when import view model changed.
ui::ImportViewModel * importViewModel() const noexcept
Definition AppContext.h:100
AppContext(QObject *parent=nullptr)
Creates the QML application context.
ui::AnnualViewModel * annualViewModel() const noexcept
Definition AppContext.h:94
void navigationChanged()
Emitted when navigation changed.
void setActorViewModel(ui::ActorViewModel *value)
Sets actor view model exposed to QML.
void bookingViewModelChanged()
Emitted when booking view model changed.
ui::ExportViewModel * exportViewModel
Definition AppContext.h:50