1 #ifndef DALI_COLOR_CONTROLLER_H
2 #define DALI_COLOR_CONTROLLER_H
5 * Copyright (c) 2019 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.
23 #include <dali/public-api/object/base-handle.h>
24 #include <dali/public-api/math/vector4.h>
27 #include <dali/public-api/dali-adaptor-common.h>
32 namespace Internal DALI_INTERNAL
36 class ColorController;
42 * Color controller currently caches the changeable color table which updates with the theme change
44 * It provides the functionality of retrieving a RGBA color by passing in the color code string.
46 class DALI_ADAPTOR_API ColorController : public BaseHandle
51 * @brief Create an uninitialized ColorController handle.
56 * @brief Creates a copy of the handle.
58 * The copy will point to the same implementation as the original.
59 * @param[in] colorController The Color Controller to copy from.
61 ColorController( const ColorController& colorController);
64 * @brief This assignment operator is required for (smart) pointer semantics.
66 * @param [in] rhs A reference to the copied handle
67 * @return A reference to this
69 ColorController& operator=(const ColorController& rhs);
72 * @brief Retrieve the initialized instance of the ColorController.
74 * @return Handle to ColorController.
76 static ColorController Get();
81 * This is non-virtual since derived Handle types must not contain data or virtual methods.
86 * @brief Retrieve the RGBA value by given the color code.
88 * @param[in] colorCode The color code string.
89 * @param[out] colorValue The RGBA color
90 * @return true if the color code exists, otherwise false
92 bool RetrieveColor( const std::string& colorCode, Vector4& colorValue );
95 * @brief Retrieve the RGBA values by given the color code.
97 * @param[in] colorCode The color code string.
98 * @param[out] textColor The text color.
99 * @param[out] textOutlineColor The text outline color.
100 * @param[out] textShadowColor The text shadow color.
101 * @return true if the color code exists, otherwise false
103 bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor);
106 public: // Not intended for application developers
108 * @brief This constructor is used internally to create a handle from an object pointer.
109 * @param [in] colorController A pointer the internal color controller.
111 explicit DALI_INTERNAL ColorController(Internal::Adaptor::ColorController* colorController);
117 #endif // DALI_COLOR_CONTROLLER_H