CDocumentProcessingManagerCompBase.h
Go to the documentation of this file.
1 #ifndef iprocgui_CDocumentProcessingManagerCompBase_included
2 #define iprocgui_CDocumentProcessingManagerCompBase_included
3 
4 
5 // Qt includes
6 #include <QtCore/QObject>
7 
8 // ACF includes
10 #include "ilog/TLoggerCompWrap.h"
12 #include "idoc/IDocumentManager.h"
13 #include "iproc/IProcessor.h"
14 #include "iqtgui/IGuiObject.h"
16 
17 
18 namespace iprocgui
19 {
20 
21 
23  public QObject,
26  virtual public ibase::ICommandsProvider
27 {
28  Q_OBJECT
29 public:
31 
32  I_BEGIN_BASE_COMPONENT(CDocumentProcessingManagerCompBase);
33  I_REGISTER_INTERFACE(ibase::ICommandsProvider);
34  I_ASSIGN(m_documentManagerCompPtr, "DocumentManager", "Application's document manager", true, "DocumentManager");
35  I_ASSIGN_TO(m_documentManagerModelCompPtr, m_documentManagerCompPtr, true);
36  I_ASSIGN(m_processorCompPtr, "Processor", "Target processing component", true, "Processor");
37  I_ASSIGN(m_progressManagerCompPtr, "ProgressManager", "Processing progress manager", false, "ProgressManager");
38  I_ASSIGN(m_paramsSetCompPtr, "ProcessingParamsSet", "Processing parameters", false, "ProcessingParameters");
39  I_ASSIGN(m_paramsGuiCompPtr, "ProcessingParamsGui", "UI for processing parameters", false, "ProcessingParamsGui");
40  I_ASSIGN(m_commandNameAttrPtr, "ProcessingCommandName", "Name of the processing action in menu", true, "");
41  I_ASSIGN(m_menuNameAttrPtr, "ProcessingMenuName", "Name of the processing menu", false, "Processing");
42  I_ASSIGN(m_inputDocumentRequiredAttrPtr, "InputDocumentRequired", "If enabled, the input document is required for processing", false, true);
43  I_ASSIGN(m_documentTypeIdAttrPtr, "DocumentTypeId", "Document type ID used for document creation", false, "Default");
44  I_ASSIGN(m_commandGroupIdAttrPtr, "CommandGroup", "Specify the command group ID", true, 0);
45  I_ASSIGN(m_commandShowInToolBarAttrPtr, "ShowInToolsBar", "If enabled the command button will be shown also in the tool bar", true, false);
46  I_ASSIGN(m_commandIconPathAttrPtr, "CommandIconPath", "Path to the icon resource used for the command", false, "CommandIconPath");
47 
48  I_END_COMPONENT;
49 
51 
55  bool IsInputDocumentRequired() const;
56 
60  void SetProcessingCommandEnabled(bool isProcessingCommandEnabled = true);
61 
62  // reimpemented (ibase::ICommandsProvider)
63  virtual const ibase::IHierarchicalCommand* GetCommands() const;
64 
65  // reimpemented (icomp::IComponent)
66  virtual void OnComponentCreated();
67  virtual void OnComponentDestroyed();
68 
69  // abstract methods
70 
74  virtual void DoDocumentProcessing(const istd::IChangeable* inputDocumentPtr, const QByteArray& documentTypeId) = 0;
75 
76 protected:
77  // reimplemented (imod::CMultiModelDispatcherBase)
78  virtual void OnModelChanged(int modelId, int changeFlags, istd::IPolymorphic* updateParamsPtr);
79 
80  I_REF(idoc::IDocumentManager, m_documentManagerCompPtr);
81  I_REF(imod::IModel, m_documentManagerModelCompPtr);
82  I_REF(iproc::IProcessor, m_processorCompPtr);
83  I_REF(ibase::IProgressManager, m_progressManagerCompPtr);
84  I_REF(iprm::IParamsSet, m_paramsSetCompPtr);
85  I_REF(iqtgui::IGuiObject, m_paramsGuiCompPtr);
86  I_ATTR(QString, m_commandNameAttrPtr);
87  I_ATTR(QString, m_menuNameAttrPtr);
88  I_ATTR(bool, m_inputDocumentRequiredAttrPtr);
89  I_ATTR(QByteArray, m_documentTypeIdAttrPtr);
90  I_ATTR(int, m_commandGroupIdAttrPtr);
91  I_ATTR(bool, m_commandShowInToolBarAttrPtr);
92  I_ATTR(QString, m_commandIconPathAttrPtr);
93 
97 
98 private Q_SLOTS:
99  void OnDoProcessing();
100 };
101 
102 
103 } // namespace iproc
104 
105 
106 #endif // !iprocgui_CDocumentProcessingManagerCompBase_included
107 
108 
virtual const ibase::IHierarchicalCommand * GetCommands() const
void SetProcessingCommandEnabled(bool isProcessingCommandEnabled=true)
Enable or disable processing command.
bool IsInputDocumentRequired() const
Return true, if the input document is required for processing.
virtual void DoDocumentProcessing(const istd::IChangeable *inputDocumentPtr, const QByteArray &documentTypeId)=0
Process the current document.
I_ASSIGN_TO(m_documentManagerModelCompPtr, m_documentManagerCompPtr, true)
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24
virtual void OnModelChanged(int modelId, int changeFlags, istd::IPolymorphic *updateParamsPtr)

© 2007-2011 Witold Gantzke and Kirill Lepskiy