ICF 3.1.1.10
Technical documentation of ICF Libraries
CDocumentImportExportCommandComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// ICF includes
17
18
19namespace idocgui
20{
21
22
27 public QObject,
29 protected imod::TSingleModelObserverBase<idoc::IDocumentManager>,
30 virtual public ibase::ICommandsProvider
31{
32 Q_OBJECT
33public:
35
36 I_BEGIN_COMPONENT(CDocumentImportExportCommandComp);
37 I_REGISTER_INTERFACE(ibase::ICommandsProvider);
38 I_ASSIGN(m_documentPersistenceCompPtr, "DocumentPersistence", "File persistence for the actual document type", true, "DocumentPersistence");
39 I_ASSIGN_TO(m_documentPersistenceInfoCompPtr, m_documentPersistenceCompPtr, false);
40 I_ASSIGN(m_documentManagerCompPtr, "DocumentManager", "Manager of the documents in the MDI workspace", true, "DocumentManager");
41 I_ASSIGN_TO(m_documentManagerModelCompPtr, m_documentManagerCompPtr, true);
42 I_ASSIGN(m_documentTypeIdAttrPtr, "DocumentTypeId", "ID of the document type used by MDI workspace", true, "Default");
43 I_ASSIGN(m_importCommandNameAttrPtr, "ImportCommandName", "Name/Text of the import command shown in File menu", false, "Import...");
44 I_ASSIGN(m_exportCommandNameAttrPtr, "ExportCommandName", "Name/Text of the export command shown in File menu", false, "Export...");
45 I_END_COMPONENT;
46
48
49 // reimplemented (ibase::ICommandsProvider)
51
52protected:
53 // reimplemented (imod::CSingleModelObserverBase)
54 void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
55
56 // reimplemented (icomp::CComponentBase)
57 void OnComponentCreated() override;
58 void OnComponentDestroyed() override;
59
60protected Q_SLOTS:
61 virtual void OnImport();
62 virtual void OnExport();
63
64protected:
65 virtual void UpdateCommands();
66
67protected:
72
73 I_REF(idoc::IDocumentManager, m_documentManagerCompPtr);
74 I_REF(imod::IModel, m_documentManagerModelCompPtr);
75 I_REF(ifile::IFilePersistence, m_documentPersistenceCompPtr);
76 I_REF(ifile::IFilePersistenceInfo, m_documentPersistenceInfoCompPtr);
77 I_ATTR(QByteArray, m_documentTypeIdAttrPtr);
78 I_TEXTATTR(m_importCommandNameAttrPtr);
79 I_TEXTATTR(m_exportCommandNameAttrPtr);
80};
81
82
83} // namespace idocgui
84
85
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.
Component used for triggering of the document import/export command from the file menu of a document ...
const ibase::IHierarchicalCommand * GetCommands() const override
Get list of menu commands.
void OnUpdate(const istd::IChangeable::ChangeSet &changeSet) override
Called on update of observed model.
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:29
Basic implementation for a single model observer with binding to concrete data object interface.
Set of change flags (its IDs).
Definition IChangeable.h:38
Common interface to define the hierarchical graph structures.
Implementation of hierarchical command based on QAction from Qt.
This package contains Qt implementations related to Document/View concept.

© Witold Gantzke and Kirill Lepskiy