aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf
diff options
context:
space:
mode:
Diffstat (limited to 'include/qpdf')
-rw-r--r--include/qpdf/QPDFWriter.hh17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh
index e44839d4..245e11f3 100644
--- a/include/qpdf/QPDFWriter.hh
+++ b/include/qpdf/QPDFWriter.hh
@@ -29,6 +29,7 @@
#include <qpdf/DLL.h>
#include <qpdf/Types.h>
+#include <functional>
#include <list>
#include <map>
#include <memory>
@@ -80,7 +81,7 @@ class QPDFWriter
class QPDF_DLL_CLASS ProgressReporter
{
public:
- virtual ~ProgressReporter() = default;
+ virtual ~ProgressReporter();
// This method is called with a value from 0 to 100 to
// indicate approximate progress through the write process.
@@ -88,6 +89,20 @@ class QPDFWriter
virtual void reportProgress(int) = 0;
};
+ // This is a progress reporter that takes a function. It is used
+ // by the C APIs, but it is available if you want to just register
+ // a C function as a handler.
+ class QPDF_DLL_CLASS FunctionProgressReporter: public ProgressReporter
+ {
+ public:
+ FunctionProgressReporter(std::function<void(int)>);
+ virtual ~FunctionProgressReporter();
+ virtual void reportProgress(int) override;
+
+ private:
+ std::function<void(int)> handler;
+ };
+
// Setting Output. Output may be set only one time. If you don't
// use the filename version of the QPDFWriter constructor, you
// must call exactly one of these methods.