1 #ifndef DALI_TOOLKIT_INTERNAL_TEXT_VISUAL_H
2 #define DALI_TOOLKIT_INTERNAL_TEXT_VISUAL_H
5 * Copyright (c) 2016 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/internal/visuals/visual-base-impl.h>
23 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
24 #include <dali-toolkit/internal/text/text-controller.h>
25 #include <dali-toolkit/internal/text/text-scroller.h>
37 typedef IntrusivePtr< TextVisual > TextVisualPtr;
40 * The visual which renders text
42 * The following properties are optional:
44 * | %Property Name | Type |
45 * |---------------------|---------|
46 * | renderingBackend | INTEGER |
48 * | fontFamily | STRING |
49 * | fontStyle | STRING |
50 * | pointSize | FLOAT |
51 * | multiLine | BOOLEAN |
52 * | horizontalAlignment | STRING |
53 * | verticalAlignment | STRING |
54 * | textColor | VECTOR4 |
55 * | enableMarkup | BOOLEAN |
56 * | enableAutoScroll | BOOLEAN |
57 * | autoScrollSpeed | INTEGER |
58 * | autoScrollLoopCount | INTEGER |
59 * | autoScrollGap | INTEGER |
60 * | lineSpacing | FLOAT |
61 * | underline | STRING |
63 * | outline | STRING |
64 * | batchingEnabled | BOOLEAN |
67 class TextVisual : public Visual::Base
74 * @param[in] factoryCache The VisualFactoryCache object
76 TextVisual( VisualFactoryCache& factoryCache );
79 * @brief A reference counted object may only be deleted by calling Unreference().
86 void SetTextControlInterface( Text::ControlInterface* controlInterface );
88 public: // from Visual::Base
91 * @copydoc Visual::Base::GetHeightForWidth()
93 float GetHeightForWidth( float width ) const;
96 * @copydoc Visual::Base::GetNaturalSize()
98 virtual void SetSize( const Vector2& size );
101 * @copydoc Visual::Base::GetNaturalSize()
103 virtual void GetNaturalSize( Vector2& naturalSize ) const;
106 * @copydoc Visual::Base::CreatePropertyMap()
108 virtual void DoCreatePropertyMap( Property::Map& map ) const;
110 protected: // from Visual::Base
112 * @copydoc Visual::Base::DoInitialize()
114 virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
117 * @copydoc Visual::Base::DoSetOnStage()
119 virtual void DoSetOnStage( Actor& actor );
122 * @copydoc Visual::Base::DoSetOffStage()
124 virtual void DoSetOffStage( Actor& actor );
127 *@copydoc Visual::Base::DoSetProperty
129 virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue );
132 * @copydoc Visual::Base::DoGetProperty
134 virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index );
139 * @brief Render view, create and attach actor(s) to this TextView.
140 * @todo In a next patch a new text render back-end won't add extra actors.
145 * @brief Stops the text auto scroll.
147 void StopTextAutoScrolling();
150 * @brief Set up Autoscrolling.
152 void SetUpAutoScrolling();
155 Text::ControllerPtr mController; ///< The text's controller.
158 Text::RendererPtr mRenderer;
159 Text::TextScrollerPtr mTextScroller;
160 Actor mRenderableActor;
162 int mRenderingBackend;
163 bool mHasBeenStaged : 1;
166 } // namespace Internal
168 } // namespace Toolkit
172 #endif /* DALI_TOOLKIT_INTERNAL_TEXT_VISUAL_H */