ImagingTools Core SDK
CFullScreenCommandComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QProcess>
7#include <QtCore/QPointer>
8
9// ACF includes
10#include <imod/TSingleModelObserverBase.h>
11#include <icomp/CComponentBase.h>
12#include <ibase/ICommandsProvider.h>
13#include <ifile/IFileNameParam.h>
14#include <iqtgui/IIconProvider.h>
15#include <iqtgui/TMakeIconProviderCompWrap.h>
16#include <iqtgui/TDesignSchemaHandlerWrap.h>
17#include <iqtgui/CHierarchicalCommand.h>
18#include <ibase/TLocalizableWrap.h>
19#include <iqtgui/IGuiObject.h>
20
21
22namespace imtgui
23{
24
25
30 public QObject,
31 public iqtgui::TMakeIconProviderCompWrap<
32 ibase::TLocalizableWrap<icomp::CComponentBase>>,
33 virtual public ibase::ICommandsProvider
34{
35 Q_OBJECT
36public:
37 typedef iqtgui::TMakeIconProviderCompWrap<ibase::TLocalizableWrap<icomp::CComponentBase>> BaseClass;
38 typedef QObject BaseClass2;
39
40 I_BEGIN_COMPONENT(CFullScreenCommandComp);
41 I_REGISTER_INTERFACE(ibase::ICommandsProvider);
42 I_ASSIGN(m_actionIconScreenOnAttrPtr, "ActionFullScreenOnIcon", "Icon screen on used command menu", true, ":/Icons/FullScreenOnNormal");
43 I_ASSIGN(m_actionIconScreenOffAttrPtr, "ActionFullScreenOffIcon", "Icon screen off used command menu", true, ":/Icons/FullScreenOffNormal");
44 I_ASSIGN(m_menuNameAttrPtr, "MenuName", "Name of the menu for the action group", true, "View");
45 I_ASSIGN(m_menuDescriptionOnAttrPtr, "MenuDescriptionOn", "Description for the full screen On", true, "Switch to fullscreen mode");
46 I_ASSIGN(m_menuDescriptionOffAttrPtr, "MenuDescriptionOff", "Description for the full screen Off", true, "Switch to normal view mode");
47 I_ASSIGN(m_rootMenuNameAttrPtr, "RootMenu", "Name of the root command", true, "");
48 I_ASSIGN(m_guiObjectCompPtr, "GuiObject", "Any of the gui object", true, "GuiObject");
49 I_END_COMPONENT;
50
52
53 // reimplemented (QObject)
54 virtual bool eventFilter(QObject* watchedPtr, QEvent* eventPtr) override;
55
56 // reimpemented (ibase::ICommandsProvider)
57 virtual const ibase::IHierarchicalCommand* GetCommands() const override;
58
59 // reimpemented (icomp::IComponent)
60 virtual void OnComponentCreated() override;
61
62protected:
63 Q_REQUIRED_RESULT virtual bool CheckIsFullScreen() const;
64 Q_REQUIRED_RESULT virtual QWidget* GetMainWidget(QWidget* fromWidgetPtr = nullptr) const;
65 virtual void UpdateVisualStatus();
66
67 // reimpemented (iqtgui::TDesignSchemaHandlerWrap)
68 virtual void OnDesignSchemaChanged(const QByteArray& themeId) override;
69
70 // reimpemented (ibase::TLocalizableWrap)
71 virtual void OnLanguageChanged() override;
72
73private Q_SLOTS:
74 void OnCommandActivated();
75
76protected:
77 I_ATTR(QByteArray, m_actionIconScreenOnAttrPtr);
78 I_ATTR(QByteArray, m_actionIconScreenOffAttrPtr);
79 I_TEXTATTR(m_menuNameAttrPtr);
80 I_TEXTATTR(m_menuDescriptionOnAttrPtr);
81 I_TEXTATTR(m_menuDescriptionOffAttrPtr);
82 I_TEXTATTR(m_rootMenuNameAttrPtr);
83 I_REF(iqtgui::IGuiObject, m_guiObjectCompPtr);
84
85 iqtgui::CHierarchicalCommand m_rootMenuCommand;
86 iqtgui::CHierarchicalCommand m_mainMenuCommand;
87 iqtgui::CHierarchicalCommand m_switchCommand;
88
89 mutable QPointer<QWidget> m_mainWidgetPtr;
90
91 Qt::WindowStates m_mainWidgetLastState;
92
93};
94
95
96} // namespace imtgui
97
98