Loading...
Searching...
No Matches
ProcessRunner.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20/*!
21 \file terralib/process/qt/ProcessRunner.h
22
23 \brief A QWidget to run process
24*/
25
26#ifndef __TERRALIB_PROCESS_QT_INTERNAL_PROCESSRUNNER_H
27#define __TERRALIB_PROCESS_QT_INTERNAL_PROCESSRUNNER_H
28
29#include "../Config.h"
30#include "../ProcessListener.h"
31
32// Qt Includes
33#include <QTextEdit>
34#include <QWidget>
35
36// STL
37#include <map>
38
39namespace te
40{
41 namespace process
42 {
43 class Process;
44 class TaskSharedPtr;
45
46 namespace qt
47 {
48 /*!
49 \class ProcessRunner
50
51 \brief A QWidget to run process
52
53 */
55 {
56 Q_OBJECT
57
58 public:
59
60 /*! \brief Default constructor. */
61 ProcessRunner(QWidget *parent = nullptr);
62
63 /*! \brief Virtual destructor. */
65
66 public:
67
69
70 void run(te::process::Process* process);
71
73
74 QTextEdit* getLoggerWidget();
75
76 protected:
77
78 virtual void onProcessStarted() override;
79
80 virtual void onProcessFinished() override;
81
82 virtual void onTaskStarted(const te::process::TaskSharedPtr& task) override;
83
84 virtual void onTaskFinished(const te::process::TaskSharedPtr& task) override;
85
86 virtual void onProcessAborted(const std::string& errorMessage) override;
87
88 signals:
89
91
93
95
97
98 void onProcessAbortedSignal(const std::string& errorMessage);
99
100
101 protected slots:
102
104
106
108
110
111 void onProcessAbortedSlot(const std::string& errorMessage);
112
113 protected:
114
116 };
117 }
118 }
119}
120
121#endif // __TERRALIB_PROCESS_QT_INTERNAL_PROCESSRUNNER_H
This abstract class a listener to the process flow.
A QWidget to run process.
Definition: ProcessRunner.h:55
virtual void onTaskStarted(const te::process::TaskSharedPtr &task) override
void onTaskStartedSlot(const te::process::TaskSharedPtr &task)
ProcessRunner(QWidget *parent=nullptr)
Default constructor.
void onTaskFinishedSignal(const te::process::TaskSharedPtr &task)
void validate(te::process::Process *process)
virtual void onProcessAborted(const std::string &errorMessage) override
virtual void onTaskFinished(const te::process::TaskSharedPtr &task) override
void onProcessAbortedSignal(const std::string &errorMessage)
~ProcessRunner()
Virtual destructor.
virtual void onProcessStarted() override
void run(te::process::Process *process)
virtual void onProcessFinished() override
void onProcessAbortedSlot(const std::string &errorMessage)
void reset(te::process::Process *process)
void onTaskFinishedSlot(const te::process::TaskSharedPtr &task)
void onTaskStartedSignal(const te::process::TaskSharedPtr &task)
TerraLib.
#define slots
#define TEPROCESSEXPORT
Definition: Config.h:47