undo_history.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* docks/undo_history.h - undo/redo history dock
  2. * Copyright (C) 2017-2018 caryoscelus
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef STUDIO_DOCKS_UNDO_HISTORY_H_4A9B9622_73CA_5E46_889F_7912CD326698
  18. #define STUDIO_DOCKS_UNDO_HISTORY_H_4A9B9622_73CA_5E46_889F_7912CD326698
  19. #include <core/std/memory.h>
  20. #include <generic/dock_registry.h>
  21. #include <generic/context_listener.h>
  22. #include "close_destroy_dock.h"
  23. namespace Ui {
  24. class UndoHistoryDock;
  25. }
  26. namespace rainynite::studio {
  27. class UndoModel;
  28. class UndoHistoryDock : public DockWidget, public ContextListener {
  29. public:
  30. UndoHistoryDock(shared_ptr<EditorContext> context, QWidget* parent=nullptr);
  31. virtual ~UndoHistoryDock();
  32. void set_context(shared_ptr<EditorContext> context) override;
  33. private:
  34. unique_ptr<Ui::UndoHistoryDock> ui;
  35. unique_ptr<UndoModel> model;
  36. };
  37. REGISTER_CONTEXT_DOCK("Undo history", UndoHistoryDock, Qt::RightDockWidgetArea);
  38. } // namespace rainynite::studio
  39. #endif