CExternalOpenDocumentCommandComp.h
Go to the documentation of this file.
1 #ifndef iqtdoc_CExternalOpenDocumentCommandComp_included
2 #define iqtdoc_CExternalOpenDocumentCommandComp_included
3 
4 
5 // ACF includes
9 
10 
11 namespace iqtdoc
12 {
13 
14 
17  protected imod::TSingleModelObserverBase<idoc::IDocumentManager>
18 {
19 public:
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 
28 protected:
29  virtual void UpdateCommands();
30 
31  // reimplemented (ifilegui::CExternalOpenDocumentCommandCompBase)
32  virtual const istd::IChangeable* GetDocumentPtr() const;
33 
34  // reimplemented (iqtgui::CStartProcessCommandComp)
35  virtual void CreateMenu();
36 
37  // reimplemented (imod::CSingleModelObserverBase)
38  virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
39 
40  // reimplemented (icomp::CComponentBase)
41  virtual void OnComponentCreated();
42  virtual void OnComponentDestroyed();
43 
44 private:
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 
56 #endif // iqtdoc_CExternalOpenDocumentCommandComp_included
57 
58 
Implementation of hierarchical command based on QAction from Qt.
Basic implementation for a single model observer with binding to concrete data object interface...
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet)
Called on update of observed model.
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept...
ifilegui::CExternalOpenDocumentCommandCompBase BaseClass
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
virtual const istd::IChangeable * GetDocumentPtr() const

© 2007-2017 Witold Gantzke and Kirill Lepskiy