ImagingTools Core SDK
CCompositeObjectViewComp.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// ACF includes
6#include <ibase/ICommandsProvider.h>
7#include <imod/CModelProxy.h>
8#include <iqtgui/CHierarchicalCommand.h>
9#include <iqtgui/TDesignerGuiObserverCompBase.h>
10#include <iqtgui/TRestorableGuiWrap.h>
11
12// ImtCore includes
13#include <imtbase/IObjectCollection.h>
14#include <imtgui/IViewExtender.h>
15#include <GeneratedFiles/imtgui/ui_CCompositeObjectViewComp.h>
16
17
18namespace imtgui
19{
20
21
22class CCompositeObjectViewComp:
23 public iqtgui::TDesignerGuiObserverCompBase<
24 Ui::CCompositeObjectViewComp, imtbase::IObjectCollection>,
25 virtual public ibase::ICommandsProvider
26{
27 Q_OBJECT
28
29public:
30 typedef iqtgui::TDesignerGuiObserverCompBase<
31 Ui::CCompositeObjectViewComp, imtbase::IObjectCollection> BaseClass;
32
33 I_BEGIN_COMPONENT(CCompositeObjectViewComp);
34 I_REGISTER_INTERFACE(ibase::ICommandsProvider);
35 I_ASSIGN_MULTI_0(m_objectTypeAttrPtr, "ObjectTypeId", "ID of objects on the container", true);
36 I_ASSIGN_MULTI_0(m_objectViewFactoryListCompPtr, "ObjectView", "View for showing object", true);
37 I_ASSIGN_TO(m_objectObserverFactoryListCompPtr, m_objectViewFactoryListCompPtr, true);
38 I_ASSIGN_MULTI_0(m_objectsToExtendAttrPtr, "ObjectsToExtend", "Object-IDs which view will be extended", false);
39 I_ASSIGN_MULTI_0(m_objectsFromExtendAttrPtr, "ObjectsFromExtend", "Object-IDs to extend view", false);
40 I_ASSIGN_MULTI_0(m_viewExtendersCompPtr, "ViewExtenders", "View extenders", false);
41 I_END_COMPONENT;
42
43 CCompositeObjectViewComp();
44
45 // reimplemented (ibase::ICommandsProvider)
46 virtual const ibase::IHierarchicalCommand* GetCommands() const override;
47
48protected:
49 // reimplemented (iqtgui::TGuiObserverWrap)
50 virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet) override;
51 virtual void OnGuiModelAttached() override;
52 virtual void OnGuiModelDetached() override;
53
54private:
55 void CreateView();
56 void DestroyView();
57
58private:
59 iqtgui::CHierarchicalCommand m_rootCommands;
60 iqtgui::CHierarchicalCommand m_commands;
61
62 I_MULTIATTR(QByteArray, m_objectTypeAttrPtr);
63 I_MULTIFACT(iqtgui::IGuiObject, m_objectViewFactoryListCompPtr);
64 I_MULTIFACT(imod::IObserver, m_objectObserverFactoryListCompPtr);
65
66 I_MULTIATTR(QByteArray, m_objectsToExtendAttrPtr);
67 I_MULTIATTR(QByteArray, m_objectsFromExtendAttrPtr);
68 I_MULTIFACT(imtgui::IViewExtender, m_viewExtendersCompPtr);
69
70 QList<QByteArray> m_objectIds;
71 QList<icomp::IComponentSharedPtr> m_views;
72 QList<icomp::IComponentSharedPtr> m_viewExtenders;
73};
74
75
76} // namespace imtgui
77
78