ACF $AcfVersion:0$
CExternalOpenDocumentCommandComp.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
9
10
11namespace iqtdoc
12{
13
14
17 protected imod::TSingleModelObserverBase<idoc::IDocumentManager>
18{
19public:
21
22 I_BEGIN_COMPONENT(CExternalOpenDocumentCommandComp);
23 I_ASSIGN(m_documentManagerCompPtr, "DocumentManager", "Manager of the documents in the MDI workspace", true, "DocumentManager");
24 I_ASSIGN_TO(m_documentManagerModelCompPtr, m_documentManagerCompPtr, true);
25 I_ASSIGN(m_documentTypeIdAttrPtr, "DocumentTypeId", "ID of the document type used by MDI workspace", true, "Default");
26 I_END_COMPONENT;
27
28protected:
29 virtual void UpdateCommands();
30
31 // reimplemented (ifilegui::CExternalOpenDocumentCommandCompBase)
32 virtual const istd::IChangeable* GetDocumentPtr() const override;
33
34 // reimplemented (iqtgui::CStartProcessCommandComp)
35 virtual void CreateMenu() override;
36
37 // reimplemented (imod::CSingleModelObserverBase)
38 virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
39
40 // reimplemented (icomp::CComponentBase)
41 virtual void OnComponentCreated() override;
42 virtual void OnComponentDestroyed() override;
43
44private:
45 I_REF(idoc::IDocumentManager, m_documentManagerCompPtr);
46 I_REF(imod::IModel, m_documentManagerModelCompPtr);
47 I_ATTR(QByteArray, m_documentTypeIdAttrPtr);
48
49 iqtgui::CHierarchicalCommand m_fileCommand;
50};
51
52
53} // namespace iqtdoc
54
55
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept.
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:25
Basic implementation for a single model observer with binding to concrete data object interface.
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet) override
Called on update of observed model.
virtual const istd::IChangeable * GetDocumentPtr() const override
virtual void OnComponentCreated() override
Called when component is created.
ifilegui::CExternalOpenDocumentCommandCompBase BaseClass
virtual void OnComponentDestroyed() override
Called when component is destroyed.
Implementation of hierarchical command based on QAction from Qt.
Set of change flags (its IDs).
Definition IChangeable.h:36
Common interface for data model objects, which can be changed.
Definition IChangeable.h:28
This package contains Qt implementations related to Document/View concept.