Multi-profile support
[platform/core/uifw/dali-adaptor.git] / adaptors / mobile / mobile-color-controller-impl.cpp
1 /*
2  * Copyright (c) 2014 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
18 // CLASS HEADER
19 #include <common/color-controller-impl.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23 #include <dali/public-api/object/type-registry.h>
24
25 // INTERNAL INCLUDES
26 #include <singleton-service-impl.h>
27
28 namespace Dali
29 {
30
31 namespace Internal
32 {
33
34 namespace Adaptor
35 {
36
37 namespace
38 {
39
40 BaseHandle Create()
41 {
42   return ColorController::Get();
43 }
44 Dali::TypeRegistration COLOR_CONTROLLER_TYPE( typeid(Dali::ColorController), typeid(Dali::BaseHandle), Create );
45
46 }
47
48 Dali::ColorController ColorController::Get()
49 {
50   Dali::ColorController colorController;
51
52   Dali::SingletonService service( SingletonService::Get() );
53   if ( service )
54   {
55     // Check whether the singleton is already created
56     Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::ColorController ) );
57     if(handle)
58     {
59       // If so, downcast the handle
60       colorController = Dali::ColorController( dynamic_cast< ColorController* >( handle.GetObjectPtr() ) );
61     }
62     else
63     {
64       colorController = Dali::ColorController( new ColorController( ) );
65       service.Register( typeid( colorController ), colorController );
66     }
67   }
68
69   return colorController;
70
71 }
72
73 ColorController::ColorController()
74 {
75 }
76
77 ColorController::~ColorController()
78 {
79 }
80
81 bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
82 {
83   return false;
84 }
85
86 bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
87 {
88   return false;
89 }
90
91 } // namespace Adaptor
92
93 } // namespace Internal
94
95 } // namespace Dali