1 #ifndef __DALI_TOOLKIT_TEXT_CONTROLLER_H__
2 #define __DALI_TOOLKIT_TEXT_CONTROLLER_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/public-api/common/intrusive-ptr.h>
23 #include <dali/public-api/object/ref-object.h>
26 #include <dali-toolkit/public-api/text/text-view.h>
38 typedef IntrusivePtr<Controller> ControllerPtr;
41 * @brief A Text Controller is used by UI Controls which display text.
43 * It manipulates the Logical & Visual text models on behalf of the UI Controls.
44 * It provides a view of the text that can be used by rendering back-ends.
46 class Controller : public RefObject
51 * @brief Create a new instance of a Controller.
53 * @return A pointer to a new Controller.
55 static ControllerPtr New();
57 // TODO - Layouting options e.g. single vs multi-line
60 * @brief Replaces any text previously set.
62 * @note This will be converted into UTF-32 when stored in the text model.
63 * @param[in] text A string of UTF-8 characters.
65 void SetText( const std::string& text );
68 * @brief Return a view of the text.
70 * @return An interface to the view.
77 * @brief A reference counted object may only be deleted by calling Unreference().
79 virtual ~Controller();
84 * @brief Private constructor.
89 * TODO - Move these with LayoutEngine
91 void UpdateVisualModel();
92 void UpdateVisualPositions();
95 Controller( const Controller& handle );
98 Controller& operator=( const Controller& handle );
107 } // namespace Toolkit
111 #endif // __DALI_TOOLKIT_TEXT_CONTROLLER_H__