mirror of
https://review.haiku-os.org/haiku
synced 2025-02-07 06:16:11 +01:00
fb3e35fcec
build. I sure hope that this doesn't break the build for anyone else. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28992 a95241bf-73f2-0310-859d-f6bbb57e9c96
49 lines
879 B
C++
49 lines
879 B
C++
/*
|
|
* Copyright 2006-2007, Haiku.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Stephan Aßmus <superstippi@gmx.de>
|
|
*/
|
|
#ifndef COMMAND_STACK_H
|
|
#define COMMAND_STACK_H
|
|
|
|
#include <stack>
|
|
|
|
#include "Notifier.h"
|
|
|
|
class BString;
|
|
class RWLocker;
|
|
class Command;
|
|
|
|
class CommandStack : public Notifier {
|
|
public:
|
|
CommandStack(RWLocker* locker);
|
|
virtual ~CommandStack();
|
|
|
|
status_t Perform(Command* command);
|
|
|
|
status_t Undo();
|
|
status_t Redo();
|
|
|
|
bool GetUndoName(BString& name);
|
|
bool GetRedoName(BString& name);
|
|
|
|
void Clear();
|
|
void Save();
|
|
bool IsSaved();
|
|
|
|
private:
|
|
status_t _AddCommand(Command* command);
|
|
|
|
RWLocker* fLocker;
|
|
|
|
typedef std::stack<Command*> command_stack;
|
|
|
|
command_stack fUndoHistory;
|
|
command_stack fRedoHistory;
|
|
Command* fSavedCommand;
|
|
};
|
|
|
|
#endif // COMMAND_STACK_H
|