-#ifndef _IUNDO_H_
-#define _IUNDO_H_
-
-#define UNDO_MAJOR "undo"
-
-//start operation
-typedef void ( *PFN_UNDOSTART )( const char *operation );
-//end operation
-typedef void ( *PFN_UNDOEND )( void );
-//add brush to the undo
-typedef void ( *PFN_UNDOADDBRUSH )( brush_t *pBrush );
-//end a brush after the operation is performed
-typedef void ( *PFN_UNDOENDBRUSH )( brush_t *pBrush );
-//add a list with brushes to the undo
-typedef void ( *PFN_UNDOADDBRUSHLIST )( brush_t *brushlist );
-//end a list with brushes after the operation is performed
-typedef void ( *PFN_UNDOENDBRUSHLIST )( brush_t *brushlist );
-//add entity to undo
-typedef void ( *PFN_UNDOADDENTITY )( entity_t *entity );
-//end an entity after the operation is performed
-typedef void ( *PFN_UNDOENDENTITY )( entity_t *entity );
-//undo last operation (bSilent == true -> will not print the "undone blah blah message")
-typedef void ( *PFN_UNDO )( unsigned char bSilent );
-//redo last undone operation
-typedef void ( *PFN_REDO )( void );
-//get the undo Id of the next undo (0 if none available)
-typedef int ( *PFN_GETUNDOID )( void );
-//returns true if there is something to be undone available
-typedef int ( *PFN_UNDOAVAILABLE )( void );
-//returns true if there is something to redo available
-typedef int ( *PFN_REDOAVAILABLE )( void );
-
-struct _QERUndoTable
+#if !defined( INCLUDED_IUNDO_H )
+#define INCLUDED_IUNDO_H
+
+/// \file
+/// \brief The undo-system interface. Uses the 'memento' pattern.
+
+#include <cstddef>
+#include "generic/constant.h"
+#include "generic/callback.h"
+
+class UndoMemento