Add Jump_to frame and StopBehavior of Animated-image-visual(agif)
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / visuals / image-visual-properties-devel.h
1 #ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_PROPERTIES_DEVEL_H
2 #define DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_PROPERTIES_DEVEL_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace DevelImageVisual
31 {
32
33 namespace Property
34 {
35
36 enum Type
37 {
38   URL                 = Dali::Toolkit::ImageVisual::Property::URL,
39   FITTING_MODE        = Dali::Toolkit::ImageVisual::Property::FITTING_MODE,
40   SAMPLING_MODE       = Dali::Toolkit::ImageVisual::Property::SAMPLING_MODE,
41   DESIRED_WIDTH       = Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH,
42   DESIRED_HEIGHT      = Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT,
43   SYNCHRONOUS_LOADING = Dali::Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING,
44   BORDER_ONLY         = Dali::Toolkit::ImageVisual::Property::BORDER_ONLY,
45   PIXEL_AREA          = Dali::Toolkit::ImageVisual::Property::PIXEL_AREA,
46   WRAP_MODE_U         = Dali::Toolkit::ImageVisual::Property::WRAP_MODE_U,
47   WRAP_MODE_V         = Dali::Toolkit::ImageVisual::Property::WRAP_MODE_V,
48   BORDER              = Dali::Toolkit::ImageVisual::Property::BORDER,
49   ATLASING            = Dali::Toolkit::ImageVisual::Property::ATLASING,
50   ALPHA_MASK_URL      = Dali::Toolkit::ImageVisual::Property::ALPHA_MASK_URL,
51   BATCH_SIZE          = Dali::Toolkit::ImageVisual::Property::BATCH_SIZE,
52   CACHE_SIZE          = Dali::Toolkit::ImageVisual::Property::CACHE_SIZE,
53   FRAME_DELAY         = Dali::Toolkit::ImageVisual::Property::FRAME_DELAY,
54   MASK_CONTENT_SCALE  = Dali::Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE,
55   CROP_TO_MASK        = Dali::Toolkit::ImageVisual::Property::CROP_TO_MASK,
56   LOAD_POLICY         = Dali::Toolkit::ImageVisual::Property::LOAD_POLICY,
57   RELEASE_POLICY      = Dali::Toolkit::ImageVisual::Property::RELEASE_POLICY,
58   ORIENTATION_CORRECTION = Dali::Toolkit::ImageVisual::Property::ORIENTATION_CORRECTION,
59
60   /**
61    * @brief Overlays the auxiliary image on top of an NPatch image.
62    *
63    * The resulting visual image will be at least as large as the
64    * smallest possible n-patch or the auxiliary image, whichever is
65    * larger.
66    *
67    * @details Name "auxiliaryImage", Type Property::STRING, URL of the image.
68    * @note Default true
69    */
70   AUXILIARY_IMAGE = ORIENTATION_CORRECTION + 1,
71
72   /**
73    * @brief An alpha value for mixing between the masked main NPatch image and the auxiliary image
74    * @details Name "auxiliaryImageAlpha", Type Property::FLOAT, between 0 and 1
75    * @note Default 0
76    */
77   AUXILIARY_IMAGE_ALPHA = ORIENTATION_CORRECTION + 2,
78
79   /**
80    * @brief The number of times the AnimatedImageVisual or AnimatedVectorImageVisual will be looped.
81    * @details Name "loopCount", type Property::INTEGER.
82    * @note For Animated images only. Default -1. if < 0, loop unlimited. else, loop loopCount times.
83    */
84   LOOP_COUNT = ORIENTATION_CORRECTION + 3,
85
86   /**
87    * @brief The playing range the AnimatedVectorImageVisual will use.
88    *
89    * Animation will play between the values specified. The array can have two integer values.
90    * Or it can have one or two strings, which are markers. More will be ignored.
91    * Both values should be between 0 and the total frame number, otherwise they will be ignored.
92    * If the range provided is not in proper order ( minimum, maximum ), it will be reordered.
93    *
94    * A marker has its start frame and end frame.
95    * Animation will play between the start frame and the end frame of the marker if one marker is specified.
96    * Or animation will play between the start frame of the first marker and the end frame of the second marker if two markers are specified.
97    *
98    * @details Name "playRange", Type Property::ARRAY of Property::INTEGER or Property::ARRAY of Property::STRING.
99    * @note Default 0 and the total frame number.
100    */
101   PLAY_RANGE = ORIENTATION_CORRECTION + 4,
102
103   /**
104    * @brief The playing state the AnimatedVectorImageVisual will use.
105    * @details Name "playState", Type PlayState::Type (Property::INTEGER)
106    * @note This property is read-only.
107    */
108   PLAY_STATE = ORIENTATION_CORRECTION + 5,
109
110   /**
111    * @brief The current frame number the AnimatedVectorImageVisual will use.
112    * @details Name "currentFrameNumber", Type Property::INTEGER, between [0, the maximum frame number] or between the play range if specified
113    * @note This property is read-only.
114    */
115   CURRENT_FRAME_NUMBER = ORIENTATION_CORRECTION + 6,
116
117   /**
118    * @brief The total frame number the AnimatedVectorImageVisual will use.
119    * @details Name "totalFrameNumber", Type Property::INTEGER.
120    * @note This property is read-only.
121    */
122   TOTAL_FRAME_NUMBER = ORIENTATION_CORRECTION + 7,
123
124   /**
125    * @brief  The stop behavior the AnimatedImageVisual and AnimatedVectorImageVisual will use.
126    * @details Name "stopBehavior", Type StopBehavior::Type (Property::INTEGER)
127    * @note Default value is StopBehavior::CURRENT_FRAME.
128    */
129   STOP_BEHAVIOR = ORIENTATION_CORRECTION + 8,
130
131   /**
132    * @brief  The looping mode the AnimatedVectorImageVisual will use.
133    * @details Name "loopingMode", Type LoopingMode::Type (Property::INTEGER)
134    * @note Default value is LoopingMode::RESTART.
135    */
136   LOOPING_MODE = ORIENTATION_CORRECTION + 9,
137
138   /**
139    * @brief The content information the AnimatedVectorImageVisual will use.
140    * @details Name "contentInfo", Type Property::MAP.
141    * The map contains the layer name as a key and Property::Array as a value.
142    * And the array contains 2 integer values which are the frame numbers, the start frame number and the end frame number of the layer.
143    * @note This property is read-only.
144    */
145   CONTENT_INFO = ORIENTATION_CORRECTION + 10
146 };
147
148 } //namespace Property
149
150 /**
151  * @brief Enumeration for what state the animation is in.
152  */
153 namespace PlayState
154 {
155
156 enum Type
157 {
158   STOPPED,   ///< Animation has stopped
159   PLAYING,   ///< The animation is playing
160   PAUSED     ///< The animation is paused
161 };
162
163 } // namespace PlayState
164
165 /**
166  * @brief Enumeration for what to do when the animation is stopped.
167  */
168 namespace StopBehavior
169 {
170
171 enum Type
172 {
173   CURRENT_FRAME,  ///< When the animation is stopped, the current frame is shown.
174   FIRST_FRAME,    ///< When the animation is stopped, the first frame is shown.
175   LAST_FRAME      ///< When the animation is stopped, the last frame is shown.
176 };
177
178 } // namespace StopBehavoir
179
180 /**
181  * @brief Enumeration for what looping mode is in.
182  */
183 namespace LoopingMode
184 {
185
186 enum Type
187 {
188   RESTART,      ///< When the animation arrives at the end in looping mode, the animation restarts from the beginning.
189   AUTO_REVERSE  ///< When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again.
190 };
191
192 } // namespace LoopingMode
193
194 } // namespace DevelImageVisual
195
196 } // namespace Toolkit
197
198 } // namespace Dali
199
200 #endif // DALI_TOOLKIT_DEVEL_API_VISUALS_IMAGE_VISUAL_PROPERTIES_DEVEL_H