2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include <dali-toolkit/public-api/factory/localized-control-factory.h>
26 #include <dali-toolkit/internal/factory/localized-control-factory-impl.h>
34 Dali::Toolkit::TextView LocalizedControlFactory::CreateLocalizedTextView( const std::string& textID, const std::string& textDomain, const std::string& textViewTheme )
36 LocalizedControlFactory factory = Get();
37 return GetImpl(factory).CreateLocalizedTextView(textID, textDomain, textViewTheme);
40 LocalizedControlFactory::LocalizedControlFactory()
44 LocalizedControlFactory::~LocalizedControlFactory()
48 LocalizedControlFactory LocalizedControlFactory::Get()
50 LocalizedControlFactory factory;
52 // Check whether the focus factory is already created
53 SingletonService singletonService( SingletonService::Get() );
54 if ( singletonService )
56 Dali::BaseHandle handle = singletonService.GetSingleton(typeid(LocalizedControlFactory));
59 // If so, downcast the handle of singleton to focus factory
60 factory = LocalizedControlFactory(dynamic_cast<Internal::LocalizedControlFactory*>(handle.GetObjectPtr()));
65 // If not, create the focus factory and register it as a singleton
66 factory = LocalizedControlFactory(new Internal::LocalizedControlFactory());
67 singletonService.Register(typeid(factory), factory);
74 LocalizedControlFactory::LocalizedControlFactory(Internal::LocalizedControlFactory *impl)
79 } // namespace Toolkit