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 Flora License, Version 1.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://floralicense.org/license/
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.
25 #include <dali/dali.h>
26 #include <dali-toolkit/public-api/factory/localized-control-factory.h>
38 * @copydoc Toolkit::LocalizedControlFactory
40 class LocalizedControlFactory : public Dali::BaseObject, public ConnectionTracker
45 * Structure used to store/retrieve localisation info.
47 struct LocalisedStringInfo
53 LocalisedStringInfo(std::string id, std::string domain, std::string theme)
62 std::string textDomain;
63 std::string textViewTheme;
66 typedef std::map< const Dali::RefObject*, LocalisedStringInfo > ObjectEntriesContainer;
67 typedef ObjectEntriesContainer::iterator ObjectEntriesIterator;
68 typedef ObjectEntriesContainer::const_iterator ObjectEntriesConstIterator;
71 * Construct a new LocalizedControlFactory.
73 LocalizedControlFactory();
76 * @copydoc Toolkit::LocalizedControlFactory::CreateLocalizedTextView
78 Dali::Toolkit::TextView CreateLocalizedTextView( const std::string& textID, const std::string& textDomain, const std::string& textViewTheme );
85 virtual ~LocalizedControlFactory();
90 * Callback for Object destructed signal.
91 * @param objectPointer Pointer to a RefObject
93 void OnObjectDestruction( const Dali::RefObject* objectPointer );
96 * Callback for language changed signal.
97 * @param adaptor Reference to a Dali::Adaptor instance
99 void OnLanguageChanged( Dali::Adaptor& adaptor);
104 LocalizedControlFactory(const LocalizedControlFactory&);
105 LocalizedControlFactory& operator=(const LocalizedControlFactory& rhs);
109 ObjectEntriesContainer mObjectEntries;
110 bool mSignalsConnected:1;
114 } // namespace Internal
116 inline Internal::LocalizedControlFactory& GetImpl(Dali::Toolkit::LocalizedControlFactory& obj)
118 DALI_ASSERT_ALWAYS(obj);
120 Dali::BaseObject& handle = obj.GetBaseObject();
122 return static_cast<Internal::LocalizedControlFactory&>(handle);
125 inline const Internal::LocalizedControlFactory& GetImpl(const Dali::Toolkit::LocalizedControlFactory& obj)
127 DALI_ASSERT_ALWAYS(obj);
129 const Dali::BaseObject& handle = obj.GetBaseObject();
131 return static_cast<const Internal::LocalizedControlFactory&>(handle);
134 } // namespace Toolkit
138 #endif // __DALI_TOOLKIT_INTERNAL_LOCALIZED_CONTROL_FACTORY_H__