index 908610135a11c829a61841653cf6c21fa12983c8..cd00d421115f8274b2861699d2957e281dfc3b8f 100644 (file)
#ifndef __COMPOSITE_UNDO_COMMIT_OBSERVER_H__
#define __COMPOSITE_UNDO_COMMIT_OBSERVER_H__
#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 {
#include "undo-stack-observer.h"
#include <list>
namespace Inkscape {
-namespace XML {
-
class Event;
class Event;
-}
-
-class UndoStackObserver;
-
/**
* Aggregates UndoStackObservers for management and triggering in an SPDocument's undo/redo
* system.
*/
/**
* Aggregates UndoStackObservers for management and triggering in an SPDocument's undo/redo
* system.
*/
-class CompositeUndoStackObserver {
+class CompositeUndoStackObserver : public UndoStackObserver {
public:
/**
public:
/**
*
* \param log The event log generated by the redo event.
*/
*
* \param log The event log generated by the redo event.
*/
- void issueRedo(XML::Event* log)
+ void issueRedo(Event* log)
{
this->_observer.notifyRedoEvent(log);
}
{
this->_observer.notifyRedoEvent(log);
}
*
* \param log The event log generated by the undo event.
*/
*
* \param log The event log generated by the undo event.
*/
- void issueUndo(XML::Event* log)
+ void issueUndo(Event* log)
{
this->_observer.notifyUndoEvent(log);
}
{
this->_observer.notifyUndoEvent(log);
}
*
* \param log The event log being committed to the undo stack.
*/
*
* \param log The event log being committed to the undo stack.
*/
- void issueUndoCommit(XML::Event* log)
+ void issueUndoCommit(Event* log)
{
this->_observer.notifyUndoCommitEvent(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.
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();
/**
* Constructor.
*/
CompositeUndoStackObserver();
- ~CompositeUndoStackObserver();
+ virtual ~CompositeUndoStackObserver();
/**
* Add an UndoStackObserver.
/**
* Add an UndoStackObserver.
*
* \param log The event log generated by the undo event.
*/
*
* \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.
*/
/**
* 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.
*/
/**
* 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
private:
// Remove an observer from a given list