(ScrollComponent) Removing unneeded public-api versions of ScrollComponents
[platform/core/uifw/dali-toolkit.git] / capi / dali-toolkit / public-api / factory / localized-control-factory.h
1 #ifndef __DALI_TOOLKIT_LOCALIZED_CONTROL_FACTORY_H__
2 #define __DALI_TOOLKIT_LOCALIZED_CONTROL_FACTORY_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
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
10 //
11 //     http://floralicense.org/license/
12 //
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.
18 //
19
20 /**
21  * @addtogroup CAPI_DALI_FRAMEWORK
22  * @{
23  */
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
27
28 namespace Dali DALI_IMPORT_API
29 {
30
31 namespace Toolkit
32 {
33
34 namespace Internal DALI_INTERNAL
35 {
36 class LocalizedControlFactory;
37 }
38
39 /**
40  * LocalizedControlFactory
41  * This class provides functionality for creating controls which have localized text.
42  * This class keeps track of objects created using its factory methods, and updates them
43  * when the system language changes.
44  *
45  * Warning: If the developer calls SetText on the object to overwrite the managed TextView,
46  * then it leads to an inconsistent state where the object will be overwritten with the
47  * localized text when language/locale changes.
48  */
49
50  class LocalizedControlFactory : public BaseHandle
51  {
52  public:
53
54   /**
55    * Creates a localized TextView, which is automatically updated when the locale or language changes.
56    *
57    * @pre The LocalizedControlFactory has been initialized.
58    *
59    * @param textID The id of the localized text with which a platform request (gettext) for localized text can be made.
60    * @param textDomain The text domain for the localized text. Eg "sys_string"
61    * @param textViewTheme A string containing style info about various properties of TextView for different
62    *        locale/language.
63    */
64   static Dali::Toolkit::TextView CreateLocalizedTextView( const std::string& textID, const std::string& textDomain = "sys_string", const std::string& textViewTheme = "{}" );
65
66
67 private:
68
69   /**
70    * Create a LocalizedControlFactory handle; this can be initialised with LocalizedControlFactory::New()
71    * Calling member functions with an uninitialised handle is not allowed.
72    */
73   LocalizedControlFactory();
74
75   /**
76    * Virtual destructor.
77    */
78   virtual ~LocalizedControlFactory();
79
80   /**
81    * Get the singleton of LocalizedControlFactory object.
82    * @return A handle to the LocalizedControlFactory control.
83    */
84   static LocalizedControlFactory Get();
85
86   /**
87    * Allows the creation of this Control from an Internal::LocalizedControlFactory pointer.
88    * @param[in]  impl  A pointer to the internal LocalizedControlFactory.
89    */
90   LocalizedControlFactory(Internal::LocalizedControlFactory *impl);
91 }; // class LocalizedControlFactory
92
93 } // namespace Toolkit
94
95 } // namespace Dali
96
97 /**
98  * @}
99  */
100 #endif // __DALI_TOOLKIT_LOCALIZED_CONTROL_FACTORY_H__