ICF 3.1.1.10
Technical documentation of ICF Libraries
CExternalOpenDocumentCommandComp.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
13
14
15namespace idocgui
16{
17
18
21 protected imod::TSingleModelObserverBase<idoc::IDocumentManager>
22{
23public:
25
26 I_BEGIN_COMPONENT(CExternalOpenDocumentCommandComp);
27 I_ASSIGN(m_documentManagerCompPtr, "DocumentManager", "Manager of the documents in the MDI workspace", true, "DocumentManager");
28 I_ASSIGN_TO(m_documentManagerModelCompPtr, m_documentManagerCompPtr, true);
29 I_ASSIGN(m_documentTypeIdAttrPtr, "DocumentTypeId", "ID of the document type used by MDI workspace", true, "Default");
30 I_END_COMPONENT;
31
32protected:
33 virtual void UpdateCommands();
34
35 // reimplemented (ifilegui::CExternalOpenDocumentCommandCompBase)
36 const istd::IChangeable* GetDocumentPtr() const override;
37
38 // reimplemented (istdgui::CStartProcessCommandComp)
39 void CreateMenu() override;
40
41 // reimplemented (imod::CSingleModelObserverBase)
42 void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
43
44 // reimplemented (icomp::CComponentBase)
45 void OnComponentCreated() override;
46 void OnComponentDestroyed() override;
47
48private:
49 I_REF(idoc::IDocumentManager, m_documentManagerCompPtr);
50 I_REF(imod::IModel, m_documentManagerModelCompPtr);
51 I_ATTR(QByteArray, m_documentTypeIdAttrPtr);
52
54};
55
56
57} // namespace idocgui
58
59
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept.
ifilegui::CExternalOpenDocumentCommandCompBase BaseClass
void OnUpdate(const istd::IChangeable::ChangeSet &changeSet) override
Called on update of observed model.
const istd::IChangeable * GetDocumentPtr() const override
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 for data model objects, which can be changed.
Definition IChangeable.h:32
Implementation of hierarchical command based on QAction from Qt.
This package contains Qt implementations related to Document/View concept.

© Witold Gantzke and Kirill Lepskiy