Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / rive-cpp / include / rive / animation / state_machine_listener.hpp
1 #ifndef _RIVE_STATE_MACHINE_LISTENER_HPP_
2 #define _RIVE_STATE_MACHINE_LISTENER_HPP_
3 #include "rive/generated/animation/state_machine_listener_base.hpp"
4 #include "rive/listener_type.hpp"
5 #include "rive/math/vec2d.hpp"
6
7 namespace rive {
8     class Shape;
9     class StateMachineListenerImporter;
10     class ListenerAction;
11     class StateMachineInstance;
12     class StateMachineListener : public StateMachineListenerBase {
13         friend class StateMachineListenerImporter;
14
15     private:
16         std::vector<uint32_t> m_HitShapesIds;
17         std::vector<std::unique_ptr<ListenerAction>> m_Actions;
18         void addAction(std::unique_ptr<ListenerAction>);
19
20     public:
21         StateMachineListener();
22         ~StateMachineListener() override;
23
24         ListenerType listenerType() const { return (ListenerType)listenerTypeValue(); }
25         size_t actionCount() const { return m_Actions.size(); }
26
27         const ListenerAction* action(size_t index) const;
28         StatusCode import(ImportStack& importStack) override;
29         StatusCode onAddedClean(CoreContext* context) override;
30
31         const std::vector<uint32_t>& hitShapeIds() const { return m_HitShapesIds; }
32         void performChanges(StateMachineInstance* stateMachineInstance, Vec2D position) const;
33     };
34 } // namespace rive
35
36 #endif