1 #ifndef __DALI_TOOLKIT_LOCALIZED_CONTROL_FACTORY_H__
2 #define __DALI_TOOLKIT_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.
22 * @addtogroup CAPI_DALI_TOOLKIT_FACTORY_MODULE
27 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
29 namespace Dali DALI_IMPORT_API
35 namespace Internal DALI_INTERNAL
37 class LocalizedControlFactory;
41 * @brief This class provides functionality for creating controls which have localized text.
43 * This class keeps track of objects created using its factory methods, and updates them
44 * when the system language changes.
46 * Warning: If the developer calls SetText on the object to overwrite the managed TextView,
47 * then it leads to an inconsistent state where the object will be overwritten with the
48 * localized text when language/locale changes.
51 class LocalizedControlFactory : public BaseHandle
56 * @brief Creates a localized TextView, which is automatically updated when the locale or language changes.
58 * @pre The LocalizedControlFactory has been initialized.
60 * @param textID The id of the localized text with which a platform request (gettext) for localized text can be made.
61 * @param textDomain The text domain for the localized text. Eg "sys_string"
62 * @param textViewTheme A string containing style info about various properties of TextView for different
64 * @return handle to a new localized TextView
66 static Dali::Toolkit::TextView CreateLocalizedTextView( const std::string& textID, const std::string& textDomain = "sys_string", const std::string& textViewTheme = "{}" );
72 * @brief Create a LocalizedControlFactory handle; this can be initialised with LocalizedControlFactory::New().
74 * Calling member functions with an uninitialised handle is not allowed.
76 LocalizedControlFactory();
81 * This is non-virtual since derived Handle types must not contain data or virtual methods.
83 ~LocalizedControlFactory();
86 * @brief Get the singleton of LocalizedControlFactory object.
88 * @return A handle to the LocalizedControlFactory control.
90 static LocalizedControlFactory Get();
93 * @brief Allows the creation of this Control from an Internal::LocalizedControlFactory pointer.
95 * @param[in] impl A pointer to the internal LocalizedControlFactory.
97 LocalizedControlFactory(Internal::LocalizedControlFactory *impl);
98 }; // class LocalizedControlFactory
100 } // namespace Toolkit
107 #endif // __DALI_TOOLKIT_LOCALIZED_CONTROL_FACTORY_H__