CDocumentImportExportCommandComp.h
Go to the documentation of this file.
1 #ifndef iqtdoc_CDocumentImportExportCommandComp_included
2 #define iqtdoc_CDocumentImportExportCommandComp_included
3 
4 
5 // ACF includes
7 #include <icomp/CComponentBase.h>
11 #include <idoc/IDocumentManager.h>
13 
14 
15 namespace iqtdoc
16 {
17 
18 
23  public QObject,
24  public icomp::CComponentBase,
25  protected imod::TSingleModelObserverBase<idoc::IDocumentManager>,
26  virtual public ibase::ICommandsProvider
27 {
28  Q_OBJECT
29 public:
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;
47 
48 protected:
49  // reimplemented (imod::CSingleModelObserverBase)
50  virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
51 
52  // reimplemented (icomp::CComponentBase)
53  virtual void OnComponentCreated();
54  virtual void OnComponentDestroyed();
55 
56 protected Q_SLOTS:
57  virtual void OnImport();
58  virtual void OnExport();
59 
60 protected:
61  virtual void UpdateCommands();
62 
63 protected:
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 
82 #endif // !iqtdoc_CDocumentImportExportCommandComp_included
83 
84 
Implementation of hierarchical command based on QAction from Qt.
Base class for component implementation.
Basic implementation for a single model observer with binding to concrete data object interface...
Interface for a provider of the heriarchical commands.
Component used for triggering of the document import/export command from the file menu of a document ...
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept...
Common interface to define the hierarchical graph structures.
I_TEXTATTR(m_importCommandNameAttrPtr)
Provide some information about file loader state.
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet)
Called on update of observed model.
Common interface for model objects, that supports Model/Observer design pattern.
Definition: IModel.h:23
Set of change flags (its IDs).
Definition: IChangeable.h:30
Interface providing loading and saving of data objects.
virtual const ibase::IHierarchicalCommand * GetCommands() const
Get list of menu commands.

© 2007-2017 Witold Gantzke and Kirill Lepskiy