1 #ifndef __DALI_TOOLKIT_TEXT_LOGICAL_MODEL_H__
2 #define __DALI_TOOLKIT_TEXT_LOGICAL_MODEL_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>
25 #include <dali-toolkit/public-api/text/text-definitions.h>
37 typedef IntrusivePtr<LogicalModel> LogicalModelPtr;
40 * @brief A logical text model contains layout independent information.
43 * - A series of UTF-32 characters in logical order
45 class LogicalModel : public RefObject
50 * @brief Create a new instance of a LogicalModel.
52 * @return A pointer to a new LogicalModel.
54 static LogicalModelPtr New();
59 * @brief Replaces any text previously set.
61 * @param[in] text An array of UTF-32 characters.
62 * @param[in] length The length of the array.
64 void SetText( const Character* text,
68 * @brief Retrieves the number of characters of the text.
70 * @return The number of characters.
72 Length GetNumberOfCharacters() const;
75 * @brief Retrieves characters from the text in the given buffer.
77 * @pre The size of the @p text buffer needs to be big enough to copy the @p numberOfCharacters.
78 * @param[in] characterIndex The index to the first character to copy.
79 * @param[out] text Pointer to a buffer where the text is copied.
80 * @param[in] numberOfCharacters The number of characters to be copied.
82 void GetText( CharacterIndex characterIndex,
84 Length numberOfCharacters ) const;
89 * @brief A reference counted object may only be deleted by calling Unreference().
91 virtual ~LogicalModel();
96 * @brief Private constructor.
101 LogicalModel( const LogicalModel& handle );
104 LogicalModel& operator=( const LogicalModel& handle );
114 } // namespace Toolkit
118 #endif // __DALI_TOOLKIT_TEXT_LOGICAL_MODEL_H__