Changed Type of PROPERTY_RENDERING_BACKEND to signed, to correct Property::Value...
[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 #include <dali-toolkit/public-api/text/rendering/text-renderer.h>
24
25 namespace Dali
26 {
27
28 namespace Toolkit
29 {
30
31 namespace Internal DALI_INTERNAL
32 {
33 class TextLabel;
34 }
35
36 /**
37  * @brief A control which renders a short text string.
38  *
39  * Text labels are lightweight, non-editable and do not respond to user input.
40  */
41 class DALI_IMPORT_API TextLabel : public Control
42 {
43 public:
44
45   // Property indices
46   static const Property::Index PROPERTY_RENDERING_BACKEND; ///< name "rendering-backend", type INT
47   static const Property::Index PROPERTY_TEXT;              ///< name "text", type STRING
48   static const Property::Index PROPERTY_MULTI_LINE;        ///< name "multi-line", type BOOLEAN
49
50   // Property names
51   static const std::string RENDERING_BACKEND_PROPERTY_NAME; ///< Property, name "rendering-backend", type INT
52   static const std::string TEXT_PROPERTY_NAME;              ///< Property, name "text", type STRING
53   static const std::string MULTI_LINE_PROPERTY_NAME;        ///< Property, name "multi-line", type BOOLEAN
54
55   /**
56    * Create the TextLabel control.
57    * @return A handle to the TextLabel control.
58    */
59   static TextLabel New();
60
61   /**
62    * @brief Creates an empty handle.
63    */
64   TextLabel();
65
66   /**
67    * @brief Copy constructor.
68    *
69    * @param[in] handle The handle to copy from.
70    */
71   TextLabel( const TextLabel& handle );
72
73   /**
74    * @brief Assignment operator.
75    *
76    * @param[in] handle The handle to copy from.
77    * @return A reference to this.
78    */
79   TextLabel& operator=( const TextLabel& handle );
80
81   /**
82    * @brief Destructor
83    *
84    * This is non-virtual since derived Handle types must not contain data or virtual methods.
85    */
86   ~TextLabel();
87
88   /**
89    * @brief Downcast a handle to TextLabel.
90    *
91    * If the BaseHandle points is a TextLabel the downcast returns a valid handle.
92    * If not the returned handle is left empty.
93    *
94    * @param[in] handle Handle to an object
95    * @return handle to a TextLabel or an empty handle
96    */
97   static TextLabel DownCast( BaseHandle handle );
98
99 public: // Not intended for application developers
100
101   /**
102    * @brief Creates a handle using the Toolkit::Internal implementation.
103    *
104    * @param[in] implementation The Control implementation.
105    */
106   DALI_INTERNAL TextLabel( Internal::TextLabel& implementation );
107
108   /**
109    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
110    *
111    * @param[in]  internal  A pointer to the internal CustomActor.
112    */
113   explicit DALI_INTERNAL TextLabel( Dali::Internal::CustomActor* internal );
114 };
115
116 } // namespace Toolkit
117
118 } // namespace Dali
119
120 #endif // __DALI_TOOLKIT_TEXT_LABEL_H__