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
41 /// @brief ResourceReady signal type;
42 typedef Signal<void ( Control ) > ResourceReadySignalType;
45 * @brief This signal is emitted after all resources required
46 * by a control are loaded and ready.
47 * Most resources are only loaded when the control is placed on stage.
49 * A callback of the following type may be connected:
51 * void YourCallbackName( Control control );
54 DALI_IMPORT_API ResourceReadySignalType& ResourceReadySignal( Control& control );
57 * @brief Query if all resources required by a control are loaded and ready.
58 * Most resources are only loaded when the control is placed on stage.
59 * @return true if the resources are loaded and ready, false otherwise
62 DALI_IMPORT_API bool IsResourceReady( const Control& control );
65 * @brief Register a visual by Property Index, linking an Actor to visual when required.
66 * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
67 * No parenting is done during registration, this should be done by derived class.
69 * @param[in] control The control
70 * @param[in] index The Property index of the visual, used to reference visual
71 * @param[in] visual The visual to register
72 * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
73 * Use below API with enabled set to false if derived class wishes to control when visual is staged.
75 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual );
78 * @brief Register a visual by Property Index, linking an Actor to visual when required.
80 * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
81 * If enabled is false then the visual is not set on stage until enabled by the derived class.
84 * @param[in] control The control
85 * @param[in] index The Property index of the visual, used to reference visual
86 * @param[in] visual The visual to register
87 * @param[in] enabled false if derived class wants to control when visual is set on stage.
90 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
93 * @brief Erase the entry matching the given index from the list of registered visuals
95 * @param[in] control The control
96 * @param[in] index The Property index of the visual, used to reference visual
98 DALI_IMPORT_API void UnregisterVisual( Internal::Control& control, Dali::Property::Index index );
101 } // namespace DevelControl
103 } // namespace Toolkit
107 #endif // DALI_TOOLKIT_CONTROL_DEVEL_H