1 #ifndef __DALI_TOOLKIT_TEXT_LABEL_H__
2 #define __DALI_TOOLKIT_TEXT_LABEL_H__
5 * Copyright (c) 2015 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 #include <dali-toolkit/public-api/controls/control.h>
30 namespace Internal DALI_INTERNAL
36 * @brief A control which renders a short text string.
38 * Text labels are lightweight, non-editable and do not respond to user input.
40 class DALI_IMPORT_API TextLabel : public Control
45 * @brief The start and end property ranges for this control.
49 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
50 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
54 * @brief An enumeration of properties belonging to the TextLabel class.
60 RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend", The type or rendering e.g. bitmap-based, type INT
61 TEXT, ///< name "text", The text to display in UTF-8 format, type STRING
62 FONT_FAMILY, ///< name "font-family", The requested font family, type STRING
63 FONT_STYLE, ///< name "font-style", The requested font style e.g. Regular/Italic, type STRING
64 POINT_SIZE, ///< name "point-size", The size of font in points, type FLOAT
65 MULTI_LINE, ///< name "multi-line", The single-line or multi-line layout option, type BOOLEAN
66 HORIZONTAL_ALIGNMENT, ///< name "horizontal-alignment", The line horizontal alignment, type STRING, values "BEGIN", "CENTER", "END"
67 VERTICAL_ALIGNMENT, ///< name "vertical-alignment", The line vertical alignment, type STRING, values "TOP", "CENTER", "BOTTOM"
68 SHADOW_OFFSET, ///< name "shadow-offset", The drop shadow offset 0 indicates no shadow, type VECTOR2
69 SHADOW_COLOR, ///< name "shadow-color", The color of a drop shadow , type VECTOR4
74 * Create the TextLabel control.
75 * @return A handle to the TextLabel control.
77 static TextLabel New();
80 * @brief Creates an empty handle.
85 * @brief Copy constructor.
87 * @param[in] handle The handle to copy from.
89 TextLabel( const TextLabel& handle );
92 * @brief Assignment operator.
94 * @param[in] handle The handle to copy from.
95 * @return A reference to this.
97 TextLabel& operator=( const TextLabel& handle );
102 * This is non-virtual since derived Handle types must not contain data or virtual methods.
107 * @brief Downcast a handle to TextLabel.
109 * If the BaseHandle points is a TextLabel the downcast returns a valid handle.
110 * If not the returned handle is left empty.
112 * @param[in] handle Handle to an object
113 * @return handle to a TextLabel or an empty handle
115 static TextLabel DownCast( BaseHandle handle );
117 public: // Not intended for application developers
120 * @brief Creates a handle using the Toolkit::Internal implementation.
122 * @param[in] implementation The Control implementation.
124 DALI_INTERNAL TextLabel( Internal::TextLabel& implementation );
127 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
129 * @param[in] internal A pointer to the internal CustomActor.
131 explicit DALI_INTERNAL TextLabel( Dali::Internal::CustomActor* internal );
134 } // namespace Toolkit
138 #endif // __DALI_TOOLKIT_TEXT_LABEL_H__