6#include <QtCore/QtGlobal>
7#if QT_VERSION >= 0x050000
8#include <QtWidgets/QMainWindow>
9#include <QtWidgets/QMenuBar>
11#include <QtGui/QMainWindow>
12#include <QtGui/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",
false,
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,
"");
150 virtual bool eventFilter(QObject* sourcePtr, QEvent* eventPtr)
override;
181 VisibleWindowsManager();
186 virtual int GetOptionOperationFlags(
int index = -1)
const override;
187 virtual bool SetOptionEnabled(
int index,
bool isEnabled =
true)
override;
188 virtual bool RemoveOption(
int index)
override;
189 virtual bool InsertOption(
190 const QString& optionName,
191 const QByteArray& optionId,
192 const QString& optionDescription = QString(),
193 int index = -1)
override;
194 virtual bool SwapOptions(
int index1,
int index2)
override;
195 virtual bool SetOptionName(
int optionIndex,
const QString& optionName)
override;
196 virtual bool SetOptionDescription(
int optionIndex,
const QString& optionDescription)
override;
199 virtual int GetOptionsFlags()
const override;
200 virtual int GetOptionsCount()
const override;
201 virtual QString GetOptionName(
int index)
const override;
202 virtual QString GetOptionDescription(
int index)
const override;
203 virtual QByteArray GetOptionId(
int index)
const override;
204 virtual bool IsOptionEnabled(
int index)
const override;
208 virtual int GetSelectedOptionIndex()
const override;
209 virtual bool SetSelectedOptionIndex(
int index)
override;
219 template <
class InterfaceType>
222 return &parent.m_visibleWindowsManager;
239#if !defined(Q_OS_MAC)
252 QByteArray m_beforeFullScreenGeometry;
253 QByteArray m_beforeFullScreenState;
257 typedef QMap<int, int> IndexToIndexMap;
259 IndexToIndexMap m_commandIndexToMainCompMap;
261 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 dynamic selection constraints.
Interface allowing to select single option from list of options.
Implementation of hierarchical command based on QAction from Qt.
imod::CMultiModelDispatcherBase BaseClass
CommandsObserver(CSimpleMainWindowGuiComp &parent)
void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet &changeSet) override
Called when some model observed by dispatcher will be changed.
iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QMainWindow > > BaseClass
CSimpleMainWindowGuiCompBase BaseClass
virtual void UpdateHelpCommands(iqtgui::CHierarchicalCommand &helpCommand)
virtual bool eventFilter(QObject *sourcePtr, QEvent *eventPtr) override
virtual void AddMainComponent(int componentIndex, iqtgui::IMainWindowComponent *componentPtr)
CommandsObserver m_commandsObserver
virtual void UpdateViewCommands(iqtgui::CHierarchicalCommand &viewCommand)
virtual void CreateDefaultToolBar()
virtual bool IsMainWindowActive(int index) const
virtual void OnGuiShown() override
Called from widget event filter when slave widget is shown.
virtual void OnTryClose(bool *ignoredPtr=NULL) override
Called when the application is attempting to close.
virtual void UpdateFixedCommands(iqtgui::CHierarchicalCommand &fixedCommands)
virtual void SetupMainWindowComponents(QMainWindow &mainWindow)
virtual void OnGuiDestroyed() override
Called just before GUI is released.
void OnShowOtherCommandTriggered(bool enabled)
virtual void OnRestoreSettings(const QSettings &settings) override
virtual void OnGuiDesignChanged() override
virtual void UpdateToolsCommands(iqtgui::CHierarchicalCommand &toolsCommand)
virtual void SetToolBarsVisible(bool isVisible=true)
virtual void UpdateMainWindowComponentsVisibility()
Set main window visible or invisible, depending on menu commands.
virtual void RemoveMainComponent(iqtgui::IMainWindowComponent *componentPtr)
virtual void AppendMenuActions(iqtgui::CHierarchicalCommand &menuCommands)
CSimpleMainWindowGuiComp()
virtual void OnRetranslate() override
Called when non-GUI elements (like commands) should be retranslated.
virtual void UpdateMenuActions()
virtual void CreateMenuBar()
virtual void OnGuiCreated() override
Called just after GUI is initialized.
virtual void OnSaveSettings(QSettings &settings) const override
Interface for a dialog widget.
Common interface for GUI objects used in ACF 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.
Represents an input/output persistence archive for object serialization.
Set of change flags (its IDs).
Common interface for data model objects, which can be changed.
Pointer wrapper providing automatic deleting pointed object during destruction.
Implementation of a special pointer container, which controls the live cycle of the pointer object,...
Standard GUI specific interfaces and components based on Qt.