1 #ifndef __DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H__
2 #define __DALI_TOOLKIT_INTERNAL_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-impl.h>
23 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
35 * @brief A control which renders a short text string.
37 class TextLabel : public Control
44 TEXTLABEL_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
45 TEXTLABEL_PROPERTY_END_INDEX = TEXTLABEL_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
49 * @copydoc Dali::Toollkit::TextLabel::New()
51 static Toolkit::TextLabel New();
54 * @copydoc Dali::Toollkit::TextLabel::SetRenderer()
56 void SetRenderer( Text::RendererPtr renderer );
61 * Called when a property of an object of this type is set.
62 * @param[in] object The object whose property is set.
63 * @param[in] index The property index.
64 * @param[in] value The new property value.
66 static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
69 * Called to retrieve a property of an object of this type.
70 * @param[in] object The object whose property is to be retrieved.
71 * @param[in] index The property index.
72 * @return The current value of the property.
74 static Property::Value GetProperty( BaseObject* object, Property::Index index );
76 private: // From Control
79 * @copydoc Control::OnInitialize()
81 virtual void OnInitialize();
83 private: // Implementation
86 * Construct a new TextLabel.
91 * A reference counted object may only be deleted by calling Unreference()
97 // Undefined copy constructor and assignment operators
98 TextLabel(const TextLabel&);
99 TextLabel& operator=(const TextLabel& rhs);
103 // TODO - Use Controller/Model for storage
104 Text::RendererPtr mRenderer;
108 } // namespace Internal
110 // Helpers for public-api forwarding methods
112 inline Toolkit::Internal::TextLabel& GetImpl( Toolkit::TextLabel& textLabel )
114 DALI_ASSERT_ALWAYS(textLabel);
116 Dali::RefObject& handle = textLabel.GetImplementation();
118 return static_cast<Toolkit::Internal::TextLabel&>(handle);
121 inline const Toolkit::Internal::TextLabel& GetImpl( const Toolkit::TextLabel& textLabel )
123 DALI_ASSERT_ALWAYS(textLabel);
125 const Dali::RefObject& handle = textLabel.GetImplementation();
127 return static_cast<const Toolkit::Internal::TextLabel&>(handle);
130 } // namespace Toolkit
134 #endif // __DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H__