Remove orientation from application class
[platform/core/uifw/dali-adaptor.git] / adaptors / public-api / adaptor-framework / color-controller.h
1 #ifndef __DALI_COLOR_CONTROLLER_H__
2 #define __DALI_COLOR_CONTROLLER_H__
3
4 /*
5  * Copyright (c) 2014 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/object/base-handle.h>
23
24 namespace Dali
25 {
26
27 namespace Internal DALI_INTERNAL
28 {
29 namespace Adaptor
30 {
31 class ColorController;
32 }
33 }
34
35 /**
36  * Color controller currently caches the changeable color table which updates with the theme change
37  *
38  * It provides the functionality of retrieving a RGBA color by passing in the color code string.
39  */
40 class DALI_IMPORT_API ColorController : public BaseHandle
41 {
42 public:
43
44   /**
45    * @brief Create an uninitialized ColorController handle.
46    */
47   ColorController();
48
49   /**
50    * @brief Creates a copy of the handle.
51    *
52    * The copy will point to the same implementation as the original.
53    * @param[in]  colorController  The Color Controller to copy from.
54    */
55   ColorController( const ColorController& colorController);
56
57   /**
58    * @brief This assignment operator is required for (smart) pointer semantics.
59    *
60    * @param [in] rhs  A reference to the copied handle
61    * @return A reference to this
62    */
63   ColorController& operator=(const ColorController& rhs);
64
65   /**
66    * @brief Retrieve the initialized instance of the ColorController.
67    *
68    * @return Handle to ColorController.
69    */
70   static ColorController Get();
71
72   /**
73    * @brief Destructor
74    *
75    * This is non-virtual since derived Handle types must not contain data or virtual methods.
76    */
77   ~ColorController();
78
79   /**
80    * @brief Retrieve the RGB value by given the color code.
81    *
82    * @param[in] colorCode The color code string.
83    * @param[out] colorValue The RGBA color
84    * @return true if the color code exists, otherwise false
85    */
86   bool RetrieveColor( const std::string& colorCode, Vector4& colorValue );
87
88   /**
89     * @brief Retrieve the RGB values by given the color code.
90     *
91     * @param[in] colorCode The color code string.
92     * @param[out] textColor The text color.
93     * @param[out] textOutlineColor The text outline color.
94     * @param[out] textShadowColor The text shadow color.
95     * @return true if the color code exists, otherwise false
96     */
97   bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor);
98
99
100 public: // Not intended for application developers
101   /**
102    * @brief This constructor is used internally to create a handle from an object pointer.
103    * @param [in] colorController A pointer the internal color controller.
104    */
105   explicit DALI_INTERNAL ColorController(Internal::Adaptor::ColorController* colorController);
106 };
107
108
109 } //namespace Dali
110
111 #endif /* __DALI_COLOR_CONTROLLER_H__ */