CommandHistory.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00024 #ifndef _COMMANDHISTORY_H
00025 #define _COMMANDHISTORY_H
00026 
00027 #include <hugin_shared.h>
00028 #include "Command.h"
00029 #include <vector>
00030 
00031 namespace PanoCommand
00032 {
00038     class WXIMPEX CommandHistory
00039     {
00040     public:
00041 
00044         CommandHistory();
00045 
00048         virtual ~CommandHistory();
00049 
00055         void clear();
00056 
00068         void addCommand(PanoCommand *command, bool execute = true);
00069 
00073         virtual void undo();
00077         virtual void redo();
00078 
00080         bool canUndo() const;
00081 
00083         bool canRedo() const;
00084 
00086         std::string getLastCommandName() const;
00087     private:
00088         // our commands
00089         std::vector<PanoCommand*> commands;
00090         size_t nextCmd;
00091 
00092     };
00093 
00094 
00100     class WXIMPEX GlobalCmdHist : public CommandHistory
00101     {
00102     public:
00103         static GlobalCmdHist & getInstance();
00104     protected:
00105         GlobalCmdHist();
00106     private:
00107         static GlobalCmdHist * instance;
00108     };
00109 
00110 } // namespace
00111 
00112 #endif // _COMMANDHISTORY_H

Generated on 23 Jan 2018 for Hugintrunk by  doxygen 1.4.7