diff options
| author | MenTaLguY <mental@rydia.net> | 2006-01-16 02:36:01 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2006-01-16 02:36:01 +0000 |
| commit | 179fa413b047bede6e32109e2ce82437c5fb8d34 (patch) | |
| tree | a5a6ac2c1708bd02288fbd8edb2ff500ff2e0916 /src/undo-stack-observer.h | |
| download | inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.tar.gz inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.zip | |
moving trunk for module inkscape
(bzr r1)
Diffstat (limited to 'src/undo-stack-observer.h')
| -rw-r--r-- | src/undo-stack-observer.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/undo-stack-observer.h b/src/undo-stack-observer.h new file mode 100644 index 000000000..f9e3d9dd0 --- /dev/null +++ b/src/undo-stack-observer.h @@ -0,0 +1,68 @@ +/** + * Undo stack observer interface + * + * Observes undo, redo, and undo log commit events. + * + * Authors: + * David Yip <yipdw@rose-hulman.edu> + * + * Copyright (c) 2005 Authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifndef __UNDO_COMMIT_OBSERVER_H__ +#define __UNDO_COMMIT_OBSERVER_H__ + +namespace Inkscape { + +namespace XML { + +class Event; + +} + +/** + * Observes changes made to the undo and redo stacks. + * + * More specifically, an UndoStackObserver is a class that receives notifications when + * any of the following events occur: + * <ul> + * <li>A change is committed to the undo stack.</li> + * <li>An undo action is made.</li> + * <li>A redo action is made.</li> + * </ul> + * + * UndoStackObservers should not be used on their own. Instead, they should be registered + * with a CompositeUndoStackObserver. + */ +class UndoStackObserver { +public: + UndoStackObserver() { } + virtual ~UndoStackObserver() { } + + /** + * Triggered when the user issues an undo command. + * + * \param log Pointer to an XML::Event describing the undone event. + */ + virtual void notifyUndoEvent(XML::Event* log) = 0; + + /** + * Triggered when the user issues a redo command. + * + * \param log Pointer to an XML::Event describing the redone event. + */ + virtual void notifyRedoEvent(XML::Event* log) = 0; + + /** + * Triggered when a set of transactions is committed to the undo log. + * + * \param log Pointer to an XML::Event describing the committed events. + */ + virtual void notifyUndoCommitEvent(XML::Event* log) = 0; +}; + +} + +#endif |
