1 #ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_ACTIONS_DEVEL_H
2 #define DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_ACTIONS_DEVEL_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali-toolkit/devel-api/toolkit-action-index-ranges.h>
23 #include <dali/public-api/signals/callback.h>
30 namespace DevelAnimatedVectorImageVisual
33 * @brief Actions that the animated vector image visual can perform. These actions are called through the Visual::Base::DoAction API.
38 * @brief The available actions for this visual
42 PLAY = VISUAL_ACTION_START_INDEX, ///< Play the animated vector image.
43 PAUSE, ///< Pause the animated vector image.
44 STOP, ///< Stop the animated vector image. This is also Default playback mode.
45 JUMP_TO, ///< Jump to the specified frame. Property::INTEGER value should be passed.
46 SET_DYNAMIC_PROPERTY ///< Set the dynamic property.
52 * @brief The dynamic property info
54 * @note A callback of the following type may be used:
56 * Property::Value MyFunction(int32_t id, VectorAnimationRenderer::VectorProperty property, uint32_t frameNumber);
59 * id The id to specify the callback.
60 * property The property that represent what you are trying to change.
61 * frameNumber The current frame number.
62 * It returns a Property::Value to set according to the property type.
64 * The callback will be called on the worker thread. You MUST not call other DALi methods in the callback.
65 * And the object must still be alive when the callback occurs if you make the callback from a class member function.
67 struct DynamicPropertyInfo
69 int32_t id; ///< The Id to specify the callback. It should be unique and will be passed when the callback is called.
70 std::string keyPath; ///< The key path used to target a specific content or a set of contents that will be updated.
71 int32_t property; ///< The property to set.
72 CallbackBase* callback; ///< The callback that gets called every time the animation is rendered. Ownership of the callback is passed onto the visual.
75 } // namespace DevelAnimatedVectorImageVisual
77 } // namespace Toolkit
81 #endif // DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_ACTIONS_DEVEL_H