ICF 3.1.1.10
Technical documentation of ICF Libraries
CDocumentProcessingManagerCompBase.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#ifndef iprocgui_CDocumentProcessingManagerCompBase_included
7#define iprocgui_CDocumentProcessingManagerCompBase_included
8
9
10// Qt includes
11#include <QtCore/QObject>
12
13// ICF includes
18#include <iproc/IProcessor.h>
19#include <istdgui/IGuiObject.h>
21
22
23namespace iprocgui
24{
25
26
28 public QObject,
31 virtual public ibase::ICommandsProvider
32{
33 Q_OBJECT
34public:
36
37 I_BEGIN_BASE_COMPONENT(CDocumentProcessingManagerCompBase);
38 I_REGISTER_INTERFACE(ibase::ICommandsProvider);
39 I_ASSIGN(m_documentManagerCompPtr, "DocumentManager", "Application's document manager", true, "DocumentManager");
40 I_ASSIGN_TO(m_documentManagerModelCompPtr, m_documentManagerCompPtr, true);
41 I_ASSIGN(m_processorCompPtr, "Processor", "Target processing component", true, "Processor");
42 I_ASSIGN(m_progressManagerCompPtr, "ProgressManager", "Processing progress manager", false, "ProgressManager");
43 I_ASSIGN(m_paramsSetCompPtr, "ProcessingParamsSet", "Processing parameters", false, "ProcessingParameters");
44 I_ASSIGN(m_paramsGuiCompPtr, "ProcessingParamsGui", "UI for processing parameters", false, "ProcessingParamsGui");
45 I_ASSIGN(m_commandNameAttrPtr, "ProcessingCommandName", "Name of the processing action in menu", true, "");
46 I_ASSIGN(m_menuNameAttrPtr, "ProcessingMenuName", "Name of the processing menu", false, "Processing");
47 I_ASSIGN(m_inputDocumentRequiredAttrPtr, "InputDocumentRequired", "If enabled, the input document is required for processing", false, true);
48 I_ASSIGN(m_documentTypeIdAttrPtr, "DocumentTypeId", "Document type ID used for document creation", false, "Default");
49 I_ASSIGN(m_commandGroupIdAttrPtr, "CommandGroup", "Specify the command group ID", true, 0);
50 I_ASSIGN(m_commandShowInToolBarAttrPtr, "ShowInToolsBar", "If enabled the command button will be shown also in the tool bar", true, false);
51 I_ASSIGN(m_commandIconPathAttrPtr, "CommandIconPath", "Path to the icon resource used for the command", false, "CommandIconPath");
52
53 I_END_COMPONENT;
54
56
61
66
67 // reimpemented (ibase::ICommandsProvider)
69
70 // reimpemented (icomp::IComponent)
71 void OnComponentCreated() override;
72 void OnComponentDestroyed() override;
73
74 // abstract methods
75
79 virtual void DoDocumentProcessing(const istd::IChangeable* inputDocumentPtr, const QByteArray& documentTypeId) = 0;
80
81protected:
82 // reimplemented (imod::CMultiModelDispatcherBase)
83 void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet& changeSet) override;
84
85 I_REF(idoc::IDocumentManager, m_documentManagerCompPtr);
86 I_REF(imod::IModel, m_documentManagerModelCompPtr);
87 I_REF(iproc::IProcessor, m_processorCompPtr);
88 I_REF(iproc::IProgressManager, m_progressManagerCompPtr);
89 I_REF(iprm::IParamsSet, m_paramsSetCompPtr);
90 I_REF(istdgui::IGuiObject, m_paramsGuiCompPtr);
91 I_TEXTATTR(m_commandNameAttrPtr);
92 I_TEXTATTR(m_menuNameAttrPtr);
93 I_ATTR(bool, m_inputDocumentRequiredAttrPtr);
94 I_ATTR(QByteArray, m_documentTypeIdAttrPtr);
95 I_ATTR(int, m_commandGroupIdAttrPtr);
96 I_ATTR(bool, m_commandShowInToolBarAttrPtr);
97 I_ATTR(QString, m_commandIconPathAttrPtr);
98
102
103private Q_SLOTS:
104 void OnDoProcessing();
105};
106
107
108} // namespace iproc
109
110
111#endif // !iprocgui_CDocumentProcessingManagerCompBase_included
112
113
Interface for a provider of the heriarchical commands.
Provide set of user actions needed to manage documents in MVC (Model View Controller) concept.
Wrapper provider of log-functionality for component based implementations.
Generic implementation of a data model changes notifier.
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
Set of general parameters.
Definition IParamsSet.h:29
Interface for all synchrone and asynchrone processors with "push data" model.
Definition IProcessor.h:26
Consume information about progress of some process.
const ibase::IHierarchicalCommand * GetCommands() const override
Get list of menu commands.
bool IsInputDocumentRequired() const
Return true, if the input document is required for processing.
void UpdateCommandsState()
Update state of processing command.
void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet &changeSet) override
Called when some model observed by dispatcher will be changed.
virtual void DoDocumentProcessing(const istd::IChangeable *inputDocumentPtr, const QByteArray &documentTypeId)=0
Process the current document.
Set of change flags (its IDs).
Definition IChangeable.h:38
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
Common interface to define the hierarchical graph structures.
Implementation of hierarchical command based on QAction from Qt.
Common interface for GUI objects using in component context.
Definition IGuiObject.h:27
This package contains GUI implementations of data processing.

© Witold Gantzke and Kirill Lepskiy