6#ifndef iqtgui_CSimpleMainWindowGuiComp_included
7#define iqtgui_CSimpleMainWindowGuiComp_included
11#include <QtCore/QtGlobal>
12#include <QtWidgets/QMainWindow>
13#include <QtWidgets/QMenuBar>
42 I_ASSIGN(m_workspaceCompPtr,
"Workspace",
"Main widget",
true,
"Workspace");
43 I_ASSIGN_TO(m_workspaceCommandsCompPtr, m_workspaceCompPtr,
false);
44 I_ASSIGN_TO(m_workspaceCommandsModelCompPtr, m_workspaceCompPtr,
false);
45 I_ASSIGN(m_aboutDialogCompPtr,
"AboutDialog",
"Gui displayed if 'About' action is triggered",
false,
"AboutDialog");
46 I_ASSIGN(m_settingsDialogCompPtr,
"SettingsDialog",
"Dialog window displayed if 'Settings' action is triggered",
false,
"SettingsDialog");
47 I_ASSIGN_MULTI_0(m_mainWindowComponentsCompPtr,
"MainWindowComponents",
"Additional GUI components",
false);
48 I_ASSIGN_TO(m_mainWindowCommandsCompPtr, m_mainWindowComponentsCompPtr,
false);
49 I_ASSIGN_TO(m_mainWindowCommandsModelCompPtr, m_mainWindowComponentsCompPtr,
false);
50 I_ASSIGN(m_isNestingEnabledAttrPtr,
"IsNestingEnabled",
"If true, docking nesting is enabled,\nmore than one docking widget is allowed on the same size",
true,
false);
51 I_ASSIGN(m_isAllowTabbedDockAttrPtr,
"IsTabbedDockAllowed",
"If true, stacking docking windows on each other is enabled",
true,
false);
52 I_ASSIGN(m_isMenuVisibleAttrPtr,
"IsMenuVisible",
"If true, menu bar will be visible",
true,
true);
53 I_ASSIGN(m_isToolbarVisibleAttrPtr,
"IsToolbarVisible",
"If true, tool bar will be visible",
true,
true);
54 I_ASSIGN(m_toolBarAreaAttrPtr,
"ToolBarArea",
"Specify the area where the standard toolbar will be placed\n 0 - left\n 1 - right\n 2 - top\n 3 - bottom",
false, 0);
56 I_ASSIGN(m_iconSizeAttrPtr,
"IconSize",
"Size of icons using in the main window",
false, 16);
57 I_ASSIGN(m_useIconTextAttrPtr,
"UseIconText",
"Enable text under the tool bar icons",
true,
false);
58 I_ASSIGN(m_helpFilePathPtr,
"HelpFile",
"Path to the help (manual) file opened by F1",
false,
"HelpFile");
66 I_MULTIREF(
imod::IModel, m_mainWindowCommandsModelCompPtr);
70 I_ATTR(
bool, m_isNestingEnabledAttrPtr);
71 I_ATTR(
bool, m_isAllowTabbedDockAttrPtr);
72 I_ATTR(
bool, m_isMenuVisibleAttrPtr);
73 I_ATTR(
bool, m_isToolbarVisibleAttrPtr);
74 I_ATTR(
int, m_toolBarAreaAttrPtr);
75 I_ATTR(
int, m_toolBarDockFeaturesAttrPtr);
76 I_ATTR(
int, m_iconSizeAttrPtr);
77 I_ATTR(
bool, m_useIconTextAttrPtr);
90 I_REGISTER_SUBELEMENT(VisibleWindowsManager);
91 I_REGISTER_SUBELEMENT_INTERFACE(VisibleWindowsManager,
iprm::IOptionsManager, GetVisibleWindowsManager);
92 I_REGISTER_SUBELEMENT_INTERFACE(VisibleWindowsManager,
iprm::IOptionsList, GetVisibleWindowsManager);
93 I_REGISTER_SUBELEMENT_INTERFACE(VisibleWindowsManager,
imod::IModel, GetVisibleWindowsManager);
94 I_REGISTER_SUBELEMENT_INTERFACE(VisibleWindowsManager,
istd::IChangeable, GetVisibleWindowsManager);
95 I_ASSIGN(m_enableGeometryRestoringAttrPtr,
"EnableGeometryRestoring",
"If enabled geometry will be restored",
true,
true);
96 I_ASSIGN(m_progressMessagesComsumerCompPtr,
"ProgressMessagesConsumer",
"Consumer of the progress messages",
false,
"");
181 VisibleWindowsManager();
186 int GetOptionOperationFlags(
int index = -1)
const override;
187 bool SetOptionEnabled(
int index,
bool isEnabled =
true)
override;
188 bool RemoveOption(
int index)
override;
190 const QString& optionName,
191 const QByteArray& optionId,
192 const QString& optionDescription = QString(),
193 int index = -1)
override;
194 bool SwapOptions(
int index1,
int index2)
override;
195 bool SetOptionName(
int optionIndex,
const QString& optionName)
override;
196 bool SetOptionDescription(
int optionIndex,
const QString& optionDescription)
override;
199 int GetOptionsFlags()
const override;
200 int GetOptionsCount()
const override;
201 QString GetOptionName(
int index)
const override;
202 QString GetOptionDescription(
int index)
const override;
203 QByteArray GetOptionId(
int index)
const override;
204 bool IsOptionEnabled(
int index)
const override;
210 template <
class InterfaceType>
213 return &parent.m_visibleWindowsManager;
216 std::unique_ptr<QMenuBar> m_menuBarPtr;
217 std::unique_ptr<QToolBar> m_standardToolBarPtr;
219 bool m_isStandardToolbarVisible;
220 bool m_areToolbarsVisible;
223 std::vector<QToolBar*> m_userToolbars;
234#if !defined(Q_OS_MAC)
247 QByteArray m_beforeFullScreenGeometry;
248 QByteArray m_beforeFullScreenState;
252 QMap<int, int> m_commandIndexToMainCompMap;
254 I_ATTR(
bool, m_enableGeometryRestoringAttrPtr);
Interface for a provider of the heriarchical commands.
Common interface for any file system item name (e.g directory, file or URL path)
Common interface for a message container consuming information objects (messages).
Generic implementation of a data model changes notifier.
Common interface for model objects, that supports Model/Observer design pattern.
This model wrapper provides a simple connection between a concrete istd::IChangeable implementation a...
Constraints of selection from set of possibilities.
Common interface for the management of the dynamic selection constraints.
Set of change flags (its IDs).
Common interface for data model objects, which can be changed.
Implementation of hierarchical command based on QAction from Qt.
void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet &changeSet)
Called when some model observed by dispatcher will be changed.
CommandsObserver(CSimpleMainWindowGuiComp &parent)
imod::CMultiModelDispatcherBase BaseClass
istdgui::TRestorableGuiWrap< istdgui::TGuiComponentBase< QMainWindow > > BaseClass
virtual void UpdateMenuActions()
CommandsObserver m_commandsObserver
void OnSaveSettings(QSettings &settings) const override
bool eventFilter(QObject *sourcePtr, QEvent *eventPtr) override
virtual void UpdateViewCommands(istdgui::CHierarchicalCommand &viewCommand)
CSimpleMainWindowGuiComp()
virtual void UpdateToolbarsVisibility()
void OnTryClose(bool *ignoredPtr=nullptr) override
Called on trying to close application.
CSimpleMainWindowGuiCompBase BaseClass
virtual void AppendMenuActions(istdgui::CHierarchicalCommand &menuCommands)
void OnRestoreSettings(const QSettings &settings) override
virtual void AddMainComponent(int componentIndex, istdgui::IMainWindowComponent &component)
virtual void RemoveMainComponent(istdgui::IMainWindowComponent &component)
void OnGuiShown() override
Called from widget event filter when slave widget is shown.
virtual void CreateMenuBar()
virtual void UpdateMainWindowComponentsVisibility()
Set main window visible or invisible, depending on menu commands.
virtual void UpdateToolsCommands(istdgui::CHierarchicalCommand &toolsCommand)
virtual void SetupMainWindowComponents(QMainWindow &mainWindow)
virtual void UpdateHelpCommands(istdgui::CHierarchicalCommand &helpCommand)
void OnGuiDestroyed() override
Called just before GUI is released.
virtual bool IsMainWindowActive(int index) const
virtual std::unique_ptr< QToolBar > CreateDefaultToolBar() const
void OnGuiCreated() override
Called just after GUI is initialized.
void OnRetranslate() override
Called when non-GUI elements (like commands) should be retranslated.
void OnShowOtherCommandTriggered(bool enabled)
virtual void UpdateFixedCommands(istdgui::CHierarchicalCommand &fixedCommands)
Interface for a dialog widget.
Common interface for GUI objects using in component context.
A common interface for main window component such as dock widget, tool bar and so on.
@ WCF_FLOATABLE
Element can be float from the main window to be standalone window.
@ WCF_MOVEABLE
Element can be moved.
A wrapper for saving/restoring of GUI component states in the application settings.
Standard GUI specific interfaces and components based on Qt.