Changed 'virtual' function override declarations to 'override'.
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / common / color-controller-impl.h
1 #ifndef DALI_INTERNAL_COLOR_CONTROLLER_H
2 #define DALI_INTERNAL_COLOR_CONTROLLER_H
3
4 /*
5  * Copyright (c) 2019 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-object.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/devel-api/adaptor-framework/color-controller.h>
26 #include <dali/devel-api/adaptor-framework/color-controller-plugin.h>
27
28 namespace Dali
29 {
30
31 namespace Internal
32 {
33
34 namespace Adaptor
35 {
36
37 /**
38  * Implementation of ColorController
39  */
40 class ColorController : public BaseObject
41 {
42 public:
43
44   /**
45    * Constructor.
46    */
47   ColorController();
48
49   /**
50    * @copydoc Dali::ColorController::Get()
51    */
52   static Dali::ColorController Get();
53
54   /**
55    * @copydoc Dali::ColorController::RetrieveColor(const std::string&, Vector4&)
56    */
57   bool RetrieveColor( const std::string& colorCode, Vector4& colorValue );
58
59   /**
60    * @copydoc Dali::ColorController::RetrieveColor(const std::string&, Vector4&, Vector4&, Vector4&)
61    */
62   bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor);
63
64 private:
65
66  /**
67   * @brief Initialize
68   */
69   void Initialize();
70
71 protected:
72   /**
73    * @brief Destructor.
74    */
75   ~ColorController() override;
76
77 private:
78
79   using CreateColorControllerFunction = Dali::ColorControllerPlugin* (*)();
80
81   void*                                  mLibHandle;          ///< Handle for the loaded library
82   Dali::ColorControllerPlugin*           mPlugin;             ///< Plugin handle
83
84   CreateColorControllerFunction          mCreateColorControllerPtr;   ///< Function pointer called in adaptor to create a plugin instance
85
86 };
87
88 } // namespace Adaptor
89
90 } // namespace Internal
91
92 // Additional Helpers for public-api forwarding methods
93 inline Internal::Adaptor::ColorController& GetImplementation(Dali::ColorController& controller)
94 {
95   DALI_ASSERT_ALWAYS(controller && "ColorController handle is empty");
96   BaseObject& handle = controller.GetBaseObject();
97   return static_cast<Internal::Adaptor::ColorController&>(handle);
98 }
99
100 inline const Internal::Adaptor::ColorController& GetImplementation(const Dali::ColorController& controller)
101 {
102   DALI_ASSERT_ALWAYS(controller && "ColorController handle is empty");
103   const BaseObject& handle = controller.GetBaseObject();
104   return static_cast<const Internal::Adaptor::ColorController&>(handle);
105 }
106
107 } // namespace Dali
108
109 #endif // DALI_INTERNAL_COLOR_CONTROLLER_H