[dali_2.3.20] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / control / control-debug.h
1 #ifndef DALI_TOOLKIT_INTERNAL_CONTROL_DEBUG_H
2 #define DALI_TOOLKIT_INTERNAL_CONTROL_DEBUG_H
3 /*
4  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #if defined(DEBUG_ENABLED)
20
21 #include <dali-toolkit/public-api/controls/control-impl.h>
22 #include <dali/public-api/object/handle.h>
23 #include <iostream>
24 #include <string>
25
26 namespace Dali
27 {
28 namespace Toolkit
29 {
30 namespace Internal
31 {
32 /**
33  * Convert properties of handle into JSON output, separated into 'normal' and 'child' properties.
34  * @param[in] ouputStream the output stream to write to
35  * @param[in] handle The handle of the object from which to retrieve properties
36  * @return The output stream
37  */
38 std::ostream& DumpProperties(std::ostream& outputStream, Handle handle);
39
40 /**
41  * Dumps control internals, visuals and properties to a string in JSON format
42  */
43 std::string DumpControl(const Internal::Control& control);
44
45 /**
46  * Dumps actor internals and properties to a string in JSON format
47  */
48 std::string DumpActor(Actor actor);
49
50 /**
51  * Dumps actor hierarchy from a given root, but expands Control output to encompass Control internals.
52  * Formats the output in JSON.
53  * @param[in] ouputStream the output stream to write to
54  * @param[in] root The root actor
55  */
56 void DumpControlHierarchy(std::ostream& outputStream, Actor rootActor);
57
58 } // namespace Internal
59
60 } // namespace Toolkit
61
62 } // namespace Dali
63
64 #endif
65
66 #endif //DALI_TOOLKIT_INTERNAL_CONTROL_DEBUG_H