Code

Use subdirectories with icon sizes.
[inkscape.git] / src / composite-undo-stack-observer.h
index 908610135a11c829a61841653cf6c21fa12983c8..cd00d421115f8274b2861699d2957e281dfc3b8f 100644 (file)
 #ifndef __COMPOSITE_UNDO_COMMIT_OBSERVER_H__
 #define __COMPOSITE_UNDO_COMMIT_OBSERVER_H__
 
+#include "gc-alloc.h"
+#include "gc-managed.h"
 #include "undo-stack-observer.h"
 
 #include <list>
 
 namespace Inkscape {
 
-namespace XML {
-
 class Event;
 
-}
-
-class UndoStackObserver;
-
 /**
  * Aggregates UndoStackObservers for management and triggering in an SPDocument's undo/redo
  * system.
  */
-class CompositeUndoStackObserver {
+class CompositeUndoStackObserver : public UndoStackObserver {
 public:
 
        /**
@@ -62,7 +58,7 @@ public:
                 *
                 * \param log The event log generated by the redo event.
                 */
-               void issueRedo(XML::Event* log)
+               void issueRedo(Event* log)
                {
                        this->_observer.notifyRedoEvent(log);
                }
@@ -73,7 +69,7 @@ public:
                 *
                 * \param log The event log generated by the undo event.
                 */
-               void issueUndo(XML::Event* log)
+               void issueUndo(Event* log)
                {
                        this->_observer.notifyUndoEvent(log);
                }
@@ -84,24 +80,44 @@ public:
                 *
                 * \param log The event log being committed to the undo stack.
                 */
-               void issueUndoCommit(XML::Event* log)
+               void issueUndoCommit(Event* log)
                {
                        this->_observer.notifyUndoCommitEvent(log);
                }
 
+               /**
+                * Issue a clear undo event to the UndoStackObserver
+                * that is associated with this
+                * UndoStackObserverRecord.
+                */
+               void issueClearUndo()
+               {
+                       this->_observer.notifyClearUndoEvent();
+               }
+            
+               /**
+                * Issue a clear redo event to the UndoStackObserver
+                * that is associated with this
+                * UndoStackObserverRecord.
+                */
+               void issueClearRedo()
+               {
+                       this->_observer.notifyClearRedoEvent();
+               }
+
        private:
                UndoStackObserver& _observer;
        };
 
        /// A list of UndoStackObserverRecords, used to aggregate multiple UndoStackObservers.
-       typedef std::list< UndoStackObserverRecord > UndoObserverRecordList;
+       typedef std::list< UndoStackObserverRecord, GC::Alloc< UndoStackObserverRecord, GC::MANUAL > > UndoObserverRecordList;
 
        /**
         * Constructor.
         */
        CompositeUndoStackObserver();
 
-       ~CompositeUndoStackObserver();
+    virtual ~CompositeUndoStackObserver();
 
        /**
         * Add an UndoStackObserver.
@@ -122,21 +138,24 @@ public:
         *
         * \param log The event log generated by the undo event.
         */
-       void notifyUndoEvent(XML::Event* log);
+       void notifyUndoEvent(Event* log);
 
        /**
         * Notify all registered UndoStackObservers of a redo event.
         *
         * \param log The event log generated by the redo event.
         */
-       void notifyRedoEvent(XML::Event* log);
+       void notifyRedoEvent(Event* log);
 
        /**
         * Notify all registered UndoStackObservers of an event log being committed to the undo stack.
         *
         * \param log The event log being committed to the undo stack.
         */
-       void notifyUndoCommitEvent(XML::Event* log);
+       void notifyUndoCommitEvent(Event* log);
+
+       virtual void notifyClearUndoEvent();
+       virtual void notifyClearRedoEvent();
 
 private:
        // Remove an observer from a given list