undo_operation.h 977 B

1234567891011121314151617181920212223242526
  1. // Copyright 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_UNDO_UNDO_OPERATION_H_
  5. #define COMPONENTS_UNDO_UNDO_OPERATION_H_
  6. // Base class for all undo operations.
  7. class UndoOperation {
  8. public:
  9. virtual ~UndoOperation() {}
  10. virtual void Undo() = 0;
  11. // Returns the resource string id describing the undo/redo of this operation
  12. // for use as labels in the UI.
  13. // Note: The labels describe the original user action, this may result in
  14. // the meaning of the redo label being reversed. For example, an
  15. // UndoOperation representing a deletion would have been created in order to
  16. // redo an addition by the user. In this case, the redo label string for the
  17. // UndoOperation of delete would be "Redo add".
  18. virtual int GetUndoLabelId() const = 0;
  19. virtual int GetRedoLabelId() const = 0;
  20. };
  21. #endif // COMPONENTS_UNDO_UNDO_OPERATION_H_