1 #ifndef DALI_TOOLKIT_CONTROL_DEVEL_H
2 #define DALI_TOOLKIT_CONTROL_DEVEL_H
5 * Copyright (c) 2017 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/controls/control.h>
37 namespace DevelControl
52 STYLE_NAME = Control::Property::STYLE_NAME,
53 BACKGROUND_COLOR = Control::Property::BACKGROUND_COLOR,
54 BACKGROUND_IMAGE = Control::Property::BACKGROUND_IMAGE,
55 KEY_INPUT_FOCUS = Control::Property::KEY_INPUT_FOCUS,
56 BACKGROUND = Control::Property::BACKGROUND,
57 MARGIN = Control::Property::MARGIN,
58 PADDING = Control::Property::PADDING,
61 * @brief Displays a tooltip when the control is hovered over.
62 * @details Name "tooltip", type Property::STRING, Property::ARRAY or Property::MAP.
63 * If Property::STRING, then the style specified in the stylesheet is used.
64 * If Property::ARRAY of Visuals then all are displayed in one row.
65 * If Property::MAP, then it should be a map of Tooltip properties.
66 * @note The tooltip is only activated if display content is received, i.e. a string (text) or visual to show.
67 * The rest is used to just build up the style of the tooltip (i.e. background, text color/point-size etc.)
68 * @note When retrieved, a Property::MAP is returned.
69 * @see Toolkit::Tooltip
71 TOOLTIP = PADDING + 1,
74 * @brief The current state of the control.
75 * @details Name "state", type DevelControl::State ( Property::INTEGER ) or Property::STRING
77 * @see DevelControl::State
82 * @brief The current sub state of the control.
83 * @details Name "subState", type Property::INTEGER or Property::STRING. The enumeration used is dependent on the derived control.
85 * @see DevelControl::State
87 SUB_STATE = PADDING + 3,
90 * @brief The actor ID of the left focusable control.
91 * @details Name "leftFocusableActorId", type Property::INTEGER.
94 LEFT_FOCUSABLE_ACTOR_ID = PADDING + 4,
97 * @brief The actor ID of the right focusable control.
98 * @details Name "rightFocusableActorId", type Property::INTEGER.
101 RIGHT_FOCUSABLE_ACTOR_ID = PADDING + 5,
104 * @brief The actor ID of the up focusable control.
105 * @details Name "upFocusableActorId", type Property::INTEGER.
108 UP_FOCUSABLE_ACTOR_ID = PADDING + 6,
111 * @brief The actor ID of the down focusable control.
112 * @details Name "downFocusableActorId", type Property::INTEGER.
115 DOWN_FOCUSABLE_ACTOR_ID = PADDING + 7
118 } // namespace Property
121 * @brief Register a visual by Property Index.
123 * @param[in] control The control
124 * @param[in] index The Property index of the visual, used to reference visual
125 * @param[in] visual The visual to register
127 * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
128 * Use below API with enabled set to false if derived class wishes to control when visual is staged.
129 * @note If the depth-index is not set on the visual, then it is set to be above the currently registered visuals.
130 * @note If replacing a visual, then the depth-index of the visual being replaced is used for the visual.
132 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual );
135 * @brief Register a visual by Property Index with a depth index.
137 * @param[in] control The control
138 * @param[in] index The Property index of the visual, used to reference visual
139 * @param[in] visual The visual to register
140 * @param[in] depthIndex The visual's depth-index is set to this
142 * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
143 * Use below API with enabled set to false if derived class wishes to control when visual is staged.
145 * @see Visual::Base::GetDepthIndex()
146 * @see Visual::Base::SetDepthIndex()
148 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
151 * @brief Register a visual by Property Index with the option of enabling/disabling it.
153 * @param[in] control The control
154 * @param[in] index The Property index of the visual, used to reference visual
155 * @param[in] visual The visual to register
156 * @param[in] enabled false if derived class wants to control when visual is set on stage.
158 * @note If the depth-index is not set on the visual, then it is set to be above the currently registered visuals.
159 * @note If replacing a visual, then the depth-index of the visual being replaced is used for the visual.
161 * @see EnableVisual()
163 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
166 * @brief Register a visual by Property Index with a depth index with the option of enabling/disabling it.
168 * @param[in] control The control
169 * @param[in] index The Property index of the visual, used to reference visual
170 * @param[in] visual The visual to register
171 * @param[in] enabled false if derived class wants to control when visual is set on stage.
172 * @param[in] depthIndex The visual's depth-index is set to this
174 * @see EnableVisual()
175 * @see Visual::Base::GetDepthIndex()
176 * @see Visual::Base::SetDepthIndex()
178 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
181 * @brief Erase the entry matching the given index from the list of registered visuals
183 * @param[in] control The control
184 * @param[in] index The Property index of the visual, used to reference visual
186 DALI_IMPORT_API void UnregisterVisual( Internal::Control& control, Dali::Property::Index index );
189 * @brief Retrieve the visual associated with the given property index.
191 * @param[in] control The control
192 * @param[in] index The Property index of the visual.
193 * @return The registered visual if exist, otherwise empty handle.
194 * @note For managing object life-cycle, do not store the returned visual as a member which increments its reference count.
196 DALI_IMPORT_API Toolkit::Visual::Base GetVisual( const Internal::Control& control, Dali::Property::Index index );
199 * @brief Sets the given visual to be displayed or not when parent staged.
201 * @param[in] control The control
202 * @param[in] index The Property index of the visual
203 * @param[in] enable flag to set enabled or disabled.
205 DALI_IMPORT_API void EnableVisual( Internal::Control& control, Dali::Property::Index index, bool enable );
208 * @brief Queries if the given visual is to be displayed when parent staged.
210 * @param[in] control The control
211 * @param[in] index The Property index of the visual
212 * @return bool whether visual is enabled or not
214 DALI_IMPORT_API bool IsVisualEnabled( const Internal::Control& control, Dali::Property::Index index );
217 * @brief Create a transition effect on the control.
219 * Only generates an animation if the properties described in the transition
220 * data are staged (e.g. the visual is Enabled and the control is on stage).
221 * Otherwise the target values are stored, and will get set onto the properties
222 * when the visual is next staged.
224 * @param[in] control The control
225 * @param[in] transitionData The transition data describing the effect to create
226 * @return A handle to an animation defined with the given effect, or an empty
227 * handle if no properties match.
229 DALI_IMPORT_API Dali::Animation CreateTransition( Internal::Control& control, const Toolkit::TransitionData& transitionData );
231 } // namespace DevelControl
233 } // namespace Toolkit
237 #endif // DALI_TOOLKIT_CONTROL_DEVEL_H