IUndoObject.h 935 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. // Description : Interface for implementation of IUndo objects.
  9. #pragma once
  10. #include <QString>
  11. //! IUndoObject is a interface of general Undo object.
  12. struct IUndoObject
  13. {
  14. // Virtual destructor.
  15. virtual ~IUndoObject() {};
  16. //! Called to delete undo object.
  17. virtual void Release() { delete this; };
  18. //! Return size of this Undo object.
  19. virtual int GetSize() = 0;
  20. //! Undo this object.
  21. //! @param bUndo If true this operation called in response to Undo operation.
  22. virtual void Undo(bool bUndo = true) = 0;
  23. //! Redo undone changes on object.
  24. virtual void Redo() = 0;
  25. // Returns the name of undo object
  26. virtual QString GetObjectName(){ return QString(); }
  27. };