1 #ifndef __DALI_TOOLKIT_INTERNAL_LOCALIZED_CONTROL_FACTORY_H__
2 #define __DALI_TOOLKIT_INTERNAL_LOCALIZED_CONTROL_FACTORY_H__
5 * Copyright (c) 2014 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.
26 #include <dali/dali.h>
27 #include <dali-toolkit/public-api/factory/localized-control-factory.h>
39 * @copydoc Toolkit::LocalizedControlFactory
41 class LocalizedControlFactory : public Dali::BaseObject, public ConnectionTracker
46 * Structure used to store/retrieve localisation info.
48 struct LocalisedStringInfo
54 LocalisedStringInfo(std::string id, std::string domain, std::string theme)
63 std::string textDomain;
64 std::string textViewTheme;
67 typedef std::map< const Dali::RefObject*, LocalisedStringInfo > ObjectEntriesContainer;
68 typedef ObjectEntriesContainer::iterator ObjectEntriesIterator;
69 typedef ObjectEntriesContainer::const_iterator ObjectEntriesConstIterator;
72 * Construct a new LocalizedControlFactory.
74 LocalizedControlFactory();
77 * @copydoc Toolkit::LocalizedControlFactory::CreateLocalizedTextView
79 Dali::Toolkit::TextView CreateLocalizedTextView( const std::string& textID, const std::string& textDomain, const std::string& textViewTheme );
86 virtual ~LocalizedControlFactory();
91 * Callback for Object destructed signal.
92 * @param objectPointer Pointer to a RefObject
94 void OnObjectDestruction( const Dali::RefObject* objectPointer );
97 * Callback for language changed signal.
98 * @param adaptor Reference to a Dali::Adaptor instance
100 void OnLanguageChanged( Dali::Adaptor& adaptor);
105 LocalizedControlFactory(const LocalizedControlFactory&);
106 LocalizedControlFactory& operator=(const LocalizedControlFactory& rhs);
110 ObjectEntriesContainer mObjectEntries;
111 bool mSignalsConnected:1;
115 } // namespace Internal
117 inline Internal::LocalizedControlFactory& GetImpl(Dali::Toolkit::LocalizedControlFactory& obj)
119 DALI_ASSERT_ALWAYS(obj);
121 Dali::BaseObject& handle = obj.GetBaseObject();
123 return static_cast<Internal::LocalizedControlFactory&>(handle);
126 inline const Internal::LocalizedControlFactory& GetImpl(const Dali::Toolkit::LocalizedControlFactory& obj)
128 DALI_ASSERT_ALWAYS(obj);
130 const Dali::BaseObject& handle = obj.GetBaseObject();
132 return static_cast<const Internal::LocalizedControlFactory&>(handle);
135 } // namespace Toolkit
139 #endif // __DALI_TOOLKIT_INTERNAL_LOCALIZED_CONTROL_FACTORY_H__