Property system fixes
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / text-controls / text-label.h
1 #ifndef __DALI_TOOLKIT_TEXT_LABEL_H__
2 #define __DALI_TOOLKIT_TEXT_LABEL_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
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 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32 class TextLabel;
33 }
34
35 /**
36  * @brief A control which renders a short text string.
37  *
38  * Text labels are lightweight, non-editable and do not respond to user input.
39  */
40 class DALI_IMPORT_API TextLabel : public Control
41 {
42 public:
43
44   /**
45    * @brief The start and end property ranges for this control.
46    */
47   enum PropertyRange
48   {
49     PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
50     PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property indices
51   };
52
53   /**
54    * @brief An enumeration of properties belonging to the TextLabel class.
55    */
56   struct Property
57   {
58     enum
59     {
60       PROPERTY_RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend", The type or rendering e.g. bitmap-based,      type INT
61       PROPERTY_TEXT,                                     ///< name "text",              The text to display in UTF-8 format,          type STRING
62       PROPERTY_FONT_FAMILY,                              ///< name "font-family",       The requested font family,                    type STRING
63       PROPERTY_FONT_STYLE,                               ///< name "font-style",        The requested font style e.g. Regular/Italic, type STRING
64       PROPERTY_POINT_SIZE,                               ///< name "point-size",        The size of font in points,                   type FLOAT
65       PROPERTY_MULTI_LINE,                               ///< name "multi-line",        The single-line or multi-line layout option,  type BOOLEAN
66     };
67   };
68
69   /**
70    * Create the TextLabel control.
71    * @return A handle to the TextLabel control.
72    */
73   static TextLabel New();
74
75   /**
76    * @brief Creates an empty handle.
77    */
78   TextLabel();
79
80   /**
81    * @brief Copy constructor.
82    *
83    * @param[in] handle The handle to copy from.
84    */
85   TextLabel( const TextLabel& handle );
86
87   /**
88    * @brief Assignment operator.
89    *
90    * @param[in] handle The handle to copy from.
91    * @return A reference to this.
92    */
93   TextLabel& operator=( const TextLabel& handle );
94
95   /**
96    * @brief Destructor
97    *
98    * This is non-virtual since derived Handle types must not contain data or virtual methods.
99    */
100   ~TextLabel();
101
102   /**
103    * @brief Downcast a handle to TextLabel.
104    *
105    * If the BaseHandle points is a TextLabel the downcast returns a valid handle.
106    * If not the returned handle is left empty.
107    *
108    * @param[in] handle Handle to an object
109    * @return handle to a TextLabel or an empty handle
110    */
111   static TextLabel DownCast( BaseHandle handle );
112
113 public: // Not intended for application developers
114
115   /**
116    * @brief Creates a handle using the Toolkit::Internal implementation.
117    *
118    * @param[in] implementation The Control implementation.
119    */
120   DALI_INTERNAL TextLabel( Internal::TextLabel& implementation );
121
122   /**
123    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
124    *
125    * @param[in]  internal  A pointer to the internal CustomActor.
126    */
127   explicit DALI_INTERNAL TextLabel( Dali::Internal::CustomActor* internal );
128 };
129
130 } // namespace Toolkit
131
132 } // namespace Dali
133
134 #endif // __DALI_TOOLKIT_TEXT_LABEL_H__