2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.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
8 // http://floralicense.org/license/
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.
19 #include <dali-toolkit/public-api/factory/localized-control-factory.h>
25 #include <dali-toolkit/internal/factory/localized-control-factory-impl.h>
33 Dali::Toolkit::TextView LocalizedControlFactory::CreateLocalizedTextView( const std::string& textID, const std::string& textDomain, const std::string& textViewTheme )
35 LocalizedControlFactory factory = Get();
36 return GetImpl(factory).CreateLocalizedTextView(textID, textDomain, textViewTheme);
39 LocalizedControlFactory::LocalizedControlFactory()
43 LocalizedControlFactory::~LocalizedControlFactory()
47 LocalizedControlFactory LocalizedControlFactory::Get()
49 LocalizedControlFactory factory;
51 // Check whether the focus factory is already created
52 Dali::Adaptor& adaptor = Dali::Adaptor::Get();
53 Dali::BaseHandle handle = adaptor.GetSingleton(typeid(LocalizedControlFactory));
56 // If so, downcast the handle of singleton to focus factory
57 factory = LocalizedControlFactory(dynamic_cast<Internal::LocalizedControlFactory*>(handle.GetObjectPtr()));
62 // If not, create the focus factory and register it as a singleton
63 factory = LocalizedControlFactory(new Internal::LocalizedControlFactory());
64 adaptor.RegisterSingleton(typeid(factory), factory);
70 LocalizedControlFactory::LocalizedControlFactory(Internal::LocalizedControlFactory *impl)
75 } // namespace Toolkit