Prepare for Tizen 2.4 API freeze
[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   // Property indices
45   static const Dali::Property::Index PROPERTY_RENDERING_BACKEND; ///< name "rendering-backend", type INT
46   static const Dali::Property::Index PROPERTY_TEXT;              ///< name "text", type STRING
47   static const Dali::Property::Index PROPERTY_MULTI_LINE;        ///< name "multi-line", type BOOLEAN
48
49   // Property names
50   static const std::string RENDERING_BACKEND_PROPERTY_NAME; ///< Property, name "rendering-backend", type INT
51   static const std::string TEXT_PROPERTY_NAME;              ///< Property, name "text", type STRING
52   static const std::string MULTI_LINE_PROPERTY_NAME;        ///< Property, name "multi-line", type BOOLEAN
53
54   /**
55    * Create the TextLabel control.
56    * @return A handle to the TextLabel control.
57    */
58   static TextLabel New();
59
60   /**
61    * @brief Creates an empty handle.
62    */
63   TextLabel();
64
65   /**
66    * @brief Copy constructor.
67    *
68    * @param[in] handle The handle to copy from.
69    */
70   TextLabel( const TextLabel& handle );
71
72   /**
73    * @brief Assignment operator.
74    *
75    * @param[in] handle The handle to copy from.
76    * @return A reference to this.
77    */
78   TextLabel& operator=( const TextLabel& handle );
79
80   /**
81    * @brief Destructor
82    *
83    * This is non-virtual since derived Handle types must not contain data or virtual methods.
84    */
85   ~TextLabel();
86
87   /**
88    * @brief Downcast a handle to TextLabel.
89    *
90    * If the BaseHandle points is a TextLabel the downcast returns a valid handle.
91    * If not the returned handle is left empty.
92    *
93    * @param[in] handle Handle to an object
94    * @return handle to a TextLabel or an empty handle
95    */
96   static TextLabel DownCast( BaseHandle handle );
97
98 public: // Not intended for application developers
99
100   /**
101    * @brief Creates a handle using the Toolkit::Internal implementation.
102    *
103    * @param[in] implementation The Control implementation.
104    */
105   DALI_INTERNAL TextLabel( Internal::TextLabel& implementation );
106
107   /**
108    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
109    *
110    * @param[in]  internal  A pointer to the internal CustomActor.
111    */
112   explicit DALI_INTERNAL TextLabel( Dali::Internal::CustomActor* internal );
113 };
114
115 } // namespace Toolkit
116
117 } // namespace Dali
118
119 #endif // __DALI_TOOLKIT_TEXT_LABEL_H__