ACF $AcfVersion:0$
CDocumentImportExportCommandComp.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
13
14
15namespace iqtdoc
16{
17
18
23 public QObject,
25 protected imod::TSingleModelObserverBase<idoc::IDocumentManager>,
26 virtual public ibase::ICommandsProvider
27{
28 Q_OBJECT
29public:
31
32 I_BEGIN_COMPONENT(CDocumentImportExportCommandComp);
33 I_REGISTER_INTERFACE(ibase::ICommandsProvider);
34 I_ASSIGN(m_documentPersistenceCompPtr, "DocumentPersistence", "File persistence for the actual document type", true, "DocumentPersistence");
35 I_ASSIGN_TO(m_documentPersistenceInfoCompPtr, m_documentPersistenceCompPtr, false);
36 I_ASSIGN(m_documentManagerCompPtr, "DocumentManager", "Manager of the documents in the MDI workspace", true, "DocumentManager");
37 I_ASSIGN_TO(m_documentManagerModelCompPtr, m_documentManagerCompPtr, true);
38 I_ASSIGN(m_documentTypeIdAttrPtr, "DocumentTypeId", "ID of the document type used by MDI workspace", true, "Default");
39 I_ASSIGN(m_importCommandNameAttrPtr, "ImportCommandName", "Name/Text of the import command shown in File menu", false, "Import...");
40 I_ASSIGN(m_exportCommandNameAttrPtr, "ExportCommandName", "Name/Text of the export command shown in File menu", false, "Export...");
41 I_END_COMPONENT;
42
44
45 // reimplemented (ibase::ICommandsProvider)
46 virtual const ibase::IHierarchicalCommand* GetCommands() const override;
47
48protected:
49 // reimplemented (imod::CSingleModelObserverBase)
50 virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
51
52 // reimplemented (icomp::CComponentBase)
53 virtual void OnComponentCreated() override;
54 virtual void OnComponentDestroyed() override;
55
56protected Q_SLOTS:
57 virtual void OnImport();
58 virtual void OnExport();
59
60protected:
61 virtual void UpdateCommands();
62
63protected:
68
69 I_REF(idoc::IDocumentManager, m_documentManagerCompPtr);
70 I_REF(imod::IModel, m_documentManagerModelCompPtr);
71 I_REF(ifile::IFilePersistence, m_documentPersistenceCompPtr);
72 I_REF(ifile::IFilePersistenceInfo, m_documentPersistenceInfoCompPtr);
73 I_ATTR(QByteArray, m_documentTypeIdAttrPtr);
74 I_TEXTATTR(m_importCommandNameAttrPtr);
75 I_TEXTATTR(m_exportCommandNameAttrPtr);
76};
77
78
79} // namespace iqtdoc
80
81
Interface for a provider of the heriarchical commands.
Base class for component implementation.
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept.
Interface providing loading and saving of data objects.
Provide some information about file loader state.
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.
Component used for triggering of the document import/export command from the file menu of a document ...
I_TEXTATTR(m_importCommandNameAttrPtr)
virtual void OnComponentCreated() override
virtual void OnComponentDestroyed() override
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet) override
Called on update of observed model.
virtual const ibase::IHierarchicalCommand * GetCommands() const override
Get list of menu commands.
I_TEXTATTR(m_exportCommandNameAttrPtr)
Implementation of hierarchical command based on QAction from Qt.
Set of change flags (its IDs).
Definition IChangeable.h:36
Common interface to define the hierarchical graph structures.
This package contains Qt implementations related to Document/View concept.