diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2006-06-06 04:37:22 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2006-06-06 04:37:22 +0000 |
| commit | 187de97ae4f5eab845113c9a8202e806a0b53c93 (patch) | |
| tree | bb362be9aa02ec69939a6c0ff0d5c8b621a5726d /src/trace/siox.h | |
| parent | Applied patch #1501134 (diff) | |
| download | inkscape-187de97ae4f5eab845113c9a8202e806a0b53c93.tar.gz inkscape-187de97ae4f5eab845113c9a8202e806a0b53c93.zip | |
Applied patch #1501375
(bzr r1164)
Diffstat (limited to 'src/trace/siox.h')
| -rw-r--r-- | src/trace/siox.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/trace/siox.h b/src/trace/siox.h index ba85f0fa6..0dbf76a8e 100644 --- a/src/trace/siox.h +++ b/src/trace/siox.h @@ -341,6 +341,56 @@ private: +//######################################################################## +//# S I O X O B S E R V E R +//######################################################################## +class Siox; + +/** + * This is a class for observing the progress of a Siox engine. Overload + * the methods in your subclass to get the desired behaviour. + */ +class SioxObserver +{ +public: + + /** + * Constructor. Context can point to anything, and is usually + * used to point to a C++ object or C state object, to delegate + * callback processing to something else. Use NULL to ignore. + */ + SioxObserver(void *contextArg) : context(NULL) + { context = contextArg; } + + /** + * Destructor + */ + virtual ~SioxObserver() + { } + + /** + * Informs the observer how much has been completed. + * Return false if the processing should be aborted. + */ + virtual bool progress(float percentCompleted) + { + return true; + } + + /** + * Send an error string to the Observer. Processing will + * be halted. + */ + virtual void error(const std::string &msg) + { + } + +protected: + + void *context; + +}; + //######################################################################## @@ -385,6 +435,11 @@ public: Siox(); /** + * Construct a Siox engine. Use null to ignore + */ + Siox(SioxObserver *observer); + + /** * */ virtual ~Siox(); @@ -401,6 +456,18 @@ public: private: + SioxObserver *sioxObserver; + + /** + * Progress reporting + */ + bool progressReport(float percentCompleted); + + /** + * Flag this as false during processing to abort + */ + bool keepGoing; + /** * Our signature limits */ |
