PreviewAnimationList.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #pragma once
  9. #if !defined(Q_MOC_RUN)
  10. #include <QMainWindow>
  11. #endif
  12. class EditorWindow;
  13. struct IUiAnimationSystem;
  14. struct IUiAnimSequence;
  15. QT_FORWARD_DECLARE_CLASS(QListWidget)
  16. class PreviewAnimationList
  17. : public QMainWindow
  18. {
  19. Q_OBJECT
  20. public: // member functions
  21. PreviewAnimationList(EditorWindow* editorWindow);
  22. ~PreviewAnimationList();
  23. //! Initialize the animation list
  24. void Activate(AZ::EntityId canvasEntityId);
  25. //! Clear the animation list
  26. void Deactivate();
  27. private: // types
  28. //! Actions that can be performed by the toolbar
  29. enum class Action
  30. {
  31. Play,
  32. Pause,
  33. Stop,
  34. Reset
  35. };
  36. private: // member functions
  37. QSize sizeHint() const override;
  38. void AddMenuItems();
  39. void AddToolBarButton(const QIcon& icon, Action action, const char* tooltip);
  40. void DoActionOnSelectedAnimations(Action action);
  41. private: // data
  42. AZ::EntityId m_canvasEntityId;
  43. QListWidget* m_listWidget;
  44. QToolBar* m_toolBar;
  45. };