Code

backed out Event -> XML::Event changes
[inkscape.git] / src / undo-stack-observer.h
1 /**
2  * Undo stack observer interface
3  *
4  * Observes undo, redo, and undo log commit events.
5  *
6  * Authors:
7  * David Yip <yipdw@rose-hulman.edu>
8  *
9  * Copyright (c) 2005 Authors
10  *
11  * Released under GNU GPL, read the file 'COPYING' for more information
12  */
14 #ifndef __UNDO_COMMIT_OBSERVER_H__
15 #define __UNDO_COMMIT_OBSERVER_H__
17 namespace Inkscape {
19 class Event;
21 /**
22  * Observes changes made to the undo and redo stacks.
23  *
24  * More specifically, an UndoStackObserver is a class that receives notifications when
25  * any of the following events occur:
26  * <ul>
27  *      <li>A change is committed to the undo stack.</li>
28  *      <li>An undo action is made.</li>
29  *      <li>A redo action is made.</li>
30  * </ul>
31  *
32  * UndoStackObservers should not be used on their own.  Instead, they should be registered
33  * with a CompositeUndoStackObserver.
34  */
35 class UndoStackObserver {
36 public:
37         UndoStackObserver() { }
38         virtual ~UndoStackObserver() { }
40         /**
41          * Triggered when the user issues an undo command.
42          *
43          * \param log Pointer to an Event describing the undone event.
44          */
45         virtual void notifyUndoEvent(Event* log) = 0;
47         /**
48          * Triggered when the user issues a redo command.
49          *
50          * \param log Pointer to an Event describing the redone event.
51          */
52         virtual void notifyRedoEvent(Event* log) = 0;
54         /**
55          * Triggered when a set of transactions is committed to the undo log.
56          *
57          * \param log Pointer to an Event describing the committed events.
58          */
59         virtual void notifyUndoCommitEvent(Event* log) = 0;
60 };
62 }
64 #endif