1 #ifndef __DALI_COLOR_CONTROLLER_H__
2 #define __DALI_COLOR_CONTROLLER_H__
5 * Copyright (c) 2014 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.
21 #include <dali/public-api/object/base-handle.h>
23 namespace Dali DALI_IMPORT_API
26 namespace Internal DALI_INTERNAL
30 class ColorController;
35 * Color controller currently caches the changeable color table which updates with the theme change
37 * It provides the functionality of retrieving a RGBA color by passing in the color code string.
39 class ColorController : public BaseHandle
44 * @brief Create an uninitialized ColorController handle.
49 * @brief Creates a copy of the handle.
51 * The copy will point to the same implementation as the original.
52 * @param[in] colorController The Color Controller to copy from.
54 ColorController( const ColorController& colorController);
57 * @brief This assignment operator is required for (smart) pointer semantics.
59 * @param [in] rhs A reference to the copied handle
60 * @return A reference to this
62 ColorController& operator=(const ColorController& rhs);
65 * @brief This method is defined to allow assignment of the NULL value,
66 * and will throw an exception if passed any other value.
68 * Assigning to NULL is an alias for Reset().
69 * @param [in] rhs A NULL pointer
70 * @return A reference to this handle
72 ColorController& operator=(BaseHandle::NullType* rhs);
75 * @brief Retrieve the initialized instance of the ColorController.
77 * @return Handle to ColorController.
79 static ColorController Get();
84 * This is non-virtual since derived Handle types must not contain data or virtual methods.
89 * @brief Retrieve the RGB value by given the color code.
91 * @param[in] colorCode The color code string.
92 * @param[out] colorValue The RGBA color
93 * @return true if the color code exists, otherwise false
95 bool RetrieveColor( const std::string& colorCode, Vector4& colorValue );
98 * @brief Retrieve the RGB values by given the color code.
100 * @param[in] colorCode The color code string.
101 * @param[out] textColor The text color.
102 * @param[out] textOutlineColor The text outline color.
103 * @param[out] textShadowColor The text shadow color.
104 * @return true if the color code exists, otherwise false
106 bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor);
109 public: // Not intended for application developers
111 * @brief This constructor is used internally to create a handle from an object pointer.
112 * @param [in] colorController A pointer the internal color controller.
114 explicit DALI_INTERNAL ColorController(Internal::Adaptor::ColorController* colorController);
120 #endif /* __DALI_COLOR_CONTROLLER_H__ */