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>
23 #include <dali-toolkit/public-api/text/rendering/text-renderer.h>
31 namespace Internal DALI_INTERNAL
37 * @brief A control which renders a short text string.
39 * Text labels are lightweight, non-editable and do not respond to user input.
41 class DALI_IMPORT_API TextLabel : public Control
46 static const Property::Index PROPERTY_TEXT; ///< name "text", type STRING
47 static const Property::Index PROPERTY_MULTI_LINE; ///< name "multi-line", type BOOLEAN
50 static const std::string TEXT_PROPERTY_NAME; ///< Property, name "text", type STRING
51 static const std::string MULTI_LINE_PROPERTY_NAME; ///< Property, name "multi-line", type BOOLEAN
54 * Create the TextLabel control.
55 * @return A handle to the TextLabel control.
57 static TextLabel New();
60 * @brief Creates an empty handle.
65 * @brief Copy constructor.
67 * @param[in] handle The handle to copy from.
69 TextLabel( const TextLabel& handle );
72 * @brief Assignment operator.
74 * @param[in] handle The handle to copy from.
75 * @return A reference to this.
77 TextLabel& operator=( const TextLabel& handle );
82 * This is non-virtual since derived Handle types must not contain data or virtual methods.
87 * @brief Downcast a handle to TextLabel.
89 * If the BaseHandle points is a TextLabel the downcast returns a valid handle.
90 * If not the returned handle is left empty.
92 * @param[in] handle Handle to an object
93 * @return handle to a TextLabel or an empty handle
95 static TextLabel DownCast( BaseHandle handle );
98 * @brief Set the rendering back-end used by the TextLabel.
100 * @param[in] renderer The text renderer to use.
102 void SetRenderer( Text::RendererPtr renderer );
104 public: // Not intended for application developers
107 * @brief Creates a handle using the Toolkit::Internal implementation.
109 * @param[in] implementation The Control implementation.
111 DALI_INTERNAL TextLabel( Internal::TextLabel& implementation );
114 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
116 * @param[in] internal A pointer to the internal CustomActor.
118 explicit DALI_INTERNAL TextLabel( Dali::Internal::CustomActor* internal );
121 } // namespace Toolkit
125 #endif // __DALI_TOOLKIT_TEXT_LABEL_H__