iRoCS Toolbox  1.1.0
ProgressReporter.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Thorsten Falk
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  **************************************************************************/
22 
23 #ifndef IROCSPROGRESSREPORTER_HH
24 #define IROCSPROGRESSREPORTER_HH
25 
26 #ifdef HAVE_CONFIG_H
27 #include <config.hh>
28 #endif
29 
30 #include <string>
31 
32 #ifdef _WIN32
33  #if defined(ProgressReporter_EXPORTS)
34  #define PROGRESSREPORTERDLL_API __declspec(dllexport)
35  #elif defined(ProgressReporter_USE_DLL)
36  #define PROGRESSREPORTERDLL_API __declspec(dllimport)
37  #else
38  #define PROGRESSREPORTERDLL_API
39  #endif
40 #else
41  #define PROGRESSREPORTERDLL_API
42 #endif
43 
44 namespace iRoCS
45 {
46 
48  {
49 
50  public:
51 
53  : _taskProgressMin(0), _taskProgressMax(0)
54  {}
55 
57  {}
58 
59  virtual void setProgressMin(int progressMin) = 0;
60 
61  virtual int progressMin() const = 0;
62 
63  virtual void setProgressMax(int progressMax) = 0;
64 
65  virtual int progressMax() const = 0;
66 
67  void setTaskProgressRange(int progressMin, int progressMax);
68 
69  void setTaskProgressMin(int progressMin);
70 
71  int taskProgressMin() const;
72 
73  void setTaskProgressMax(int progressMax);
74 
75  int taskProgressMax() const;
76 
77  virtual void setHeaderMessage(std::string const &message) = 0;
78 
79  virtual std::string headerMessage() const = 0;
80 
81  virtual void setProgressMessage(std::string const &message) = 0;
82 
83  virtual std::string progressMessage() const = 0;
84 
85  virtual void setProgress(int progress) = 0;
86 
87  virtual int progress() const = 0;
88 
89  virtual void setAborted(bool abort) = 0;
90 
91  virtual void abort() = 0;
92 
93  virtual void abortWithError(std::string const &msg) = 0;
94 
95  virtual bool isAborted() const = 0;
96 
97  virtual bool updateProgress(int progress) = 0;
98 
99  virtual bool updateProgressMessage(std::string const &message) = 0;
100 
101  protected:
102 
103  int _taskProgressMin, _taskProgressMax;
104 
105  };
106 
107 }
108 
109 #endif
#define PROGRESSREPORTERDLL_API