1 #ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
2 #define DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
5 * Copyright (c) 2020 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/public-api/visuals/visual-properties.h>
34 * @brief All the visual types.
38 BORDER = Dali::Toolkit::Visual::BORDER,
39 COLOR = Dali::Toolkit::Visual::COLOR,
40 GRADIENT = Dali::Toolkit::Visual::GRADIENT,
41 IMAGE = Dali::Toolkit::Visual::IMAGE,
42 MESH = Dali::Toolkit::Visual::MESH,
43 PRIMITIVE = Dali::Toolkit::Visual::PRIMITIVE,
44 WIREFRAME = Dali::Toolkit::Visual::WIREFRAME,
45 TEXT = Dali::Toolkit::Visual::TEXT,
46 N_PATCH = Dali::Toolkit::Visual::N_PATCH,
47 SVG = Dali::Toolkit::Visual::SVG,
48 ANIMATED_IMAGE = Dali::Toolkit::Visual::ANIMATED_IMAGE,
50 ANIMATED_GRADIENT = ANIMATED_IMAGE + 1, ///< Renders an animated gradient.
51 ANIMATED_VECTOR_IMAGE = ANIMATED_IMAGE + 2, ///< Renders an animated vector image.
52 ARC = ANIMATED_IMAGE + 3, ///< Renders an arc.
56 * @brief Visual Properties
62 TYPE = Dali::Toolkit::Visual::Property::TYPE,
63 SHADER = Dali::Toolkit::Visual::Property::SHADER,
64 TRANSFORM = Dali::Toolkit::Visual::Property::TRANSFORM,
65 PREMULTIPLIED_ALPHA = Dali::Toolkit::Visual::Property::PREMULTIPLIED_ALPHA,
66 MIX_COLOR = Dali::Toolkit::Visual::Property::MIX_COLOR,
67 OPACITY = Dali::Toolkit::Visual::Property::OPACITY,
70 * @brief The fitting mode of the visual
71 * @details Name "fittingMode", type FittingMode (Property::INTEGER) or Property::STRING.
72 * @see DevelVisual::FittingMode
73 * @note The default is defined by the type of visual (if it's suitable to be stretched or not).
75 VISUAL_FITTING_MODE = OPACITY + 1,
78 * @brief The radius for the rounded corners of the visual
79 * @details Name "cornerRadius", type Property::FLOAT.
82 CORNER_RADIUS = OPACITY + 2,
85 * @brief Whether the corner radius value is relative (percentage [0.0f to 1.0f] of the visual size) or absolute (in world units).
86 * @details Name "cornerRadiusPolicy", type Property::INTEGER.
88 * @note By default, it is ABSOLUTE to the visual's size.
89 * If it it RELATIVE, the corner radius value is relative to the smaller of the visual width and visual height.
91 CORNER_RADIUS_POLICY = OPACITY + 3,
94 } // namespace Property
98 * @brief The values of this enum determine how the visual should be fit to the view
102 FIT_KEEP_ASPECT_RATIO, ///< The visual should be scaled to fit, preserving aspect ratio
103 FILL, ///< The visual should be stretched to fill, not preserving aspect ratio
104 OVER_FIT_KEEP_ASPECT_RATIO,///< The visual should be scaled to fit, preserving aspect ratio. The visual will be filled without empty area, and outside is cropped away.
105 CENTER, ///< The visual should keep original size of image. It is not scaled and not strecthed.
106 FIT_HEIGHT, ///< The visual should be scaled to fit, preserving aspect ratio. Height is scaled proportionately to maintain aspect ratio. It will be deprecated.
107 FIT_WIDTH ///< The visual should be scaled to fit, preserving aspect ratio. Width is scaled proportionately to maintain aspect ratio. It will be deprecated.
111 * @brief Devel Visual Transform for the offset or size.
117 * @brief Visual Transform Property.
123 * @brief Enumeration for the type of Transform Property.
127 SIZE_POLICY = Dali::Toolkit::Visual::Transform::Property::SIZE_POLICY,
130 * @brief Extra size value that will be added to the computed visual size.
131 * @details Name "extraSize", type Vector2.
133 * @note It is an absolute value.
134 * The property can be used when a user want to set a visual size as a combined value of `relative` and `absolute`.
135 * For example, when a user want to set a visual size to (ControlSize * 2 + 10),
136 * The transform map will be,
137 * transformMap.Add( Transform::Property::SIZE, Vector2( 2.0f, 2.0f ) )
138 * .Add( Transform::Property::SIZE_POLICY, Vector2( Transform::Policy::Relative, Transform::Policy::Relative ) )
139 * .Add( Transform::Property::EXTRA_SIZE, Vector2( 10.0f, 10.0f ) );
141 EXTRA_SIZE = SIZE_POLICY + 1,
144 } // namespace Property
146 } // namespace Transform
148 } // namespace DevelVisual
150 } // namespace Toolkit
154 #endif // DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H