Refractor ImfManager to InputMethodContext
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-color-controller.cpp
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <dali/devel-api/adaptor-framework/color-controller.h>
18
19 #include <dali/public-api/object/base-object.h>
20
21 using namespace Dali;
22
23 namespace Dali
24 {
25 namespace Internal
26 {
27 namespace Adaptor
28 {
29
30 class ColorController : public BaseObject
31 {
32 public:
33   ColorController(){}
34   static Dali::ColorController Get()
35   {
36     return Dali::ColorController( new ColorController() );
37   }
38
39   bool RetrieveColor( const std::string& colorCode, Vector4& colorValue )
40   {
41     return false;
42   }
43
44   bool RetrieveColor( const std::string& colorCode ,
45                       Vector4&           textColor,
46                       Vector4&           textOutlineColor,
47                       Vector4&           textShadowColor)
48   {
49     return false;
50   }
51 protected:
52   virtual ~ColorController(){}
53 };
54
55 } // Adaptor
56 } // Internal
57
58 inline Internal::Adaptor::ColorController& GetImplementation(Dali::ColorController& controller)
59 {
60   DALI_ASSERT_ALWAYS(controller && "ColorController handle is empty");
61   BaseObject& handle = controller.GetBaseObject();
62   return static_cast<Internal::Adaptor::ColorController&>(handle);
63 }
64
65 inline const Internal::Adaptor::ColorController& GetImplementation(const Dali::ColorController& controller)
66 {
67   DALI_ASSERT_ALWAYS(controller && "ColorController handle is empty");
68   const BaseObject& handle = controller.GetBaseObject();
69   return static_cast<const Internal::Adaptor::ColorController&>(handle);
70 }
71
72 ColorController ColorController::Get()
73 {
74   return Internal::Adaptor::ColorController::Get();
75 }
76
77 ColorController::ColorController(Internal::Adaptor::ColorController* internal)
78 : BaseHandle(internal)
79 {
80 }
81
82 ColorController::~ColorController()
83 {
84 }
85
86 bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
87 {
88   return GetImplementation(*this).RetrieveColor( colorCode, colorValue );
89 }
90
91 } // Dali