[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / styling / style-manager-devel.h
1 #ifndef DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
2 #define DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
3
4 /*
5  * Copyright (c) 2023 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 // EXTERNAL INCLUDES
22 #include <dali/public-api/common/vector-wrapper.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/public-api/styling/style-manager.h>
26
27 namespace Dali
28 {
29 namespace Toolkit
30 {
31 namespace DevelStyleManager
32 {
33 /**
34  * @brief The Type of BrokenImage
35  */
36 enum class BrokenImageType
37 {
38   SMALL,
39   NORMAL,
40   LARGE
41 };
42
43 using BrokenImageChangedSignalType = Signal<void(StyleManager)>;
44
45 /**
46  * @brief Gets all currently defined configurations.
47  *
48  * @pre The Builder has been initialized.
49  * @param[in] styleManager The instance of StyleManager
50  * @return A property map to the currently defined configurations
51 **/
52 DALI_TOOLKIT_API const Property::Map& GetConfigurations(StyleManager styleManager);
53
54 /**
55    * @brief Sets an image to be used when a visual has failed to correctly render
56    * @param[in] styleManager The instance of StyleManager
57    * @param[in] brokenImageType The type of broken image
58    * @param[in] brokenImageUrl The broken image url
59    */
60 DALI_TOOLKIT_API void SetBrokenImageUrl(StyleManager styleManager, DevelStyleManager::BrokenImageType brokenImageType, const std::string& brokenImageUrl);
61
62 /**
63    * @brief Gets an image to be used when a visual has failed to correctly render
64    * @param[in] styleManager The instance of StyleManager
65    * @param[in] brokenImageType BrokenImage type
66    */
67 DALI_TOOLKIT_API std::string GetBrokenImageUrl(StyleManager styleManager, DevelStyleManager::BrokenImageType brokenImageType);
68
69 /**
70  * @brief Get the Broken Image Url List
71  *
72  * This list is broken images stored in order of SMALL, NORMAL, and LARGE values except if the value is empty.
73  * This API just makes the list without comparing size, so the application must set a value that matches the size.
74  * @param styleManager The instance of StyleManager
75  * @return A List of Broken Image Url
76  */
77 DALI_TOOLKIT_API std::vector<std::string> GetBrokenImageUrlList(StyleManager styleManager);
78
79 /**
80  * @brief This signal is emitted when the URL of the broken image is set
81  *
82  * A callback of the following type may be connected:
83  * @code
84  *   void YourCallbackName(StyleManager styleManager)
85  * @endcode
86  * @param styleManager The instance of StyleManager
87  * @return The signal to connect to
88  */
89 DALI_TOOLKIT_API BrokenImageChangedSignalType& BrokenImageChangedSignal(StyleManager styleManager);
90
91 } // namespace DevelStyleManager
92
93 } // namespace Toolkit
94
95 } // namespace Dali
96
97 #endif // DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H