d11363268a736c2d7d69352ce7f03f42cd01ea41
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / control-devel.h
1 #ifndef DALI_TOOLKIT_CONTROL_DEVEL_H
2 #define DALI_TOOLKIT_CONTROL_DEVEL_H
3
4 /*
5  * Copyright (c) 2017 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/controls/control.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 class TransitionData;
31
32 namespace Visual
33 {
34 class Base;
35 }
36
37 namespace DevelControl
38 {
39
40
41 /// @brief ResourceReady signal type;
42 typedef Signal<void ( Control ) > ResourceReadySignalType;
43
44 /**
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.
48  *
49  * A callback of the following type may be connected:
50  * @code
51  *   void YourCallbackName( Control control );
52  * @endcode
53  */
54 DALI_IMPORT_API ResourceReadySignalType& ResourceReadySignal( Control& control );
55
56 /**
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
60  *
61  */
62 DALI_IMPORT_API bool IsResourceReady( const Control& control );
63
64 /**
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.
68  *
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.
74  */
75 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual );
76
77 /**
78  * @brief Register a visual by Property Index, linking an Actor to visual when required.
79  *
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.
82  * @see EnableVisual
83  *
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.
88  *
89  */
90 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
91
92 /**
93  * @brief Erase the entry matching the given index from the list of registered visuals
94  *
95  * @param[in] control The control
96  * @param[in] index The Property index of the visual, used to reference visual
97  */
98 DALI_IMPORT_API void UnregisterVisual( Internal::Control& control, Dali::Property::Index index );
99
100
101 } // namespace DevelControl
102
103 } // namespace Toolkit
104
105 } // namespace Dali
106
107 #endif // DALI_TOOLKIT_CONTROL_DEVEL_H