1 #ifndef DALI_INTERNAL_COLOR_CONTROLLER_H
2 #define DALI_INTERNAL_COLOR_CONTROLLER_H
5 * Copyright (c) 2021 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.
22 #include <dali/public-api/object/base-object.h>
25 #include <dali/devel-api/adaptor-framework/color-controller-plugin.h>
26 #include <dali/devel-api/adaptor-framework/color-controller.h>
35 * Implementation of ColorController
37 class ColorController : public BaseObject
46 * @copydoc Dali::ColorController::Get()
48 static Dali::ColorController Get();
51 * @copydoc Dali::ColorController::RetrieveColor(const std::string&, Vector4&)
53 bool RetrieveColor(const std::string& colorCode, Vector4& colorValue);
56 * @copydoc Dali::ColorController::RetrieveColor(const std::string&, Vector4&, Vector4&, Vector4&)
58 bool RetrieveColor(const std::string& colorCode, Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor);
70 ~ColorController() override;
73 using CreateColorControllerFunction = Dali::ColorControllerPlugin* (*)();
75 void* mLibHandle; ///< Handle for the loaded library
76 Dali::ColorControllerPlugin* mPlugin; ///< Plugin handle
78 CreateColorControllerFunction mCreateColorControllerPtr; ///< Function pointer called in adaptor to create a plugin instance
81 } // namespace Adaptor
83 } // namespace Internal
85 // Additional Helpers for public-api forwarding methods
86 inline Internal::Adaptor::ColorController& GetImplementation(Dali::ColorController& controller)
88 DALI_ASSERT_ALWAYS(controller && "ColorController handle is empty");
89 BaseObject& handle = controller.GetBaseObject();
90 return static_cast<Internal::Adaptor::ColorController&>(handle);
93 inline const Internal::Adaptor::ColorController& GetImplementation(const Dali::ColorController& controller)
95 DALI_ASSERT_ALWAYS(controller && "ColorController handle is empty");
96 const BaseObject& handle = controller.GetBaseObject();
97 return static_cast<const Internal::Adaptor::ColorController&>(handle);
102 #endif // DALI_INTERNAL_COLOR_CONTROLLER_H