1 #ifndef __DALI_INTERNAL_TEXT_H__
2 #define __DALI_INTERNAL_TEXT_H__
5 * Copyright (c) 2014 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.
25 #include <dali/public-api/text/text.h>
26 #include <dali/integration-api/text-array.h>
35 * Implementation class for Dali::Text.
43 * @copydoc Dali::Text::Text().
48 * @copydoc Dali::Text::Text( const std::string& text ).
50 Text( const std::string& text );
53 * @copydoc Dali::Text::Text( const Character& character ).
55 Text( const Character& character );
58 * @copydoc Dali::Text::Text( const Text& text ).
60 Text( const Text& text );
63 * @copydoc Dali::Text::operator=( const Text& text )
65 Text& operator=( const Text& text );
68 * Non-virtual destructor.
78 * Converts stored text encoded in UTF-32 to a std::string encoded with UTF-8.
79 * @param [out] text The text resultant of the UTF-32 to UTF-8 conversion.
81 void GetText( std::string& text ) const;
84 * @copydoc Dali::Text::operator[]()
86 Dali::Character operator[]( size_t position ) const;
89 * @copydoc Dali::Text::IsEmpty()
94 * @copydoc Dali::Text::GetLength()
96 size_t GetLength() const;
99 * @copydoc Dali::Text::Append( const Text& text )
101 void Append( const Dali::Text& text );
104 * @copydoc Dali::Text::Remove()
106 void Remove( size_t position, size_t numberOfCharacters );
109 * @copydoc Dali::Text::Find( const Character& character, std::size_t from, std::size_t to, Vector<std::size_t>& positions )
111 void Find( uint32_t character, std::size_t from, std::size_t to, Vector<std::size_t>& positions ) const;
114 * @copydoc Dali::Text::Find( SpecialCharacter character, std::size_t from, std::size_t to, Vector<std::size_t>& positions )
116 void FindWhiteSpace( std::size_t from, std::size_t to, Vector<std::size_t>& positions ) const;
119 * @copydoc Dali::Text::Find( SpecialCharacter character, std::size_t from, std::size_t to, Vector<std::size_t>& positions )
121 void FindNewLine( std::size_t from, std::size_t to, Vector<std::size_t>& positions ) const;
124 * @copydoc Dali::Text::GetSubText()
126 void GetSubText( std::size_t from, std::size_t to, Text* subText ) const;
129 * @copydoc Dali::Text::IsWhiteSpace()
131 bool IsWhiteSpace( std::size_t index ) const;
134 * @copydoc Dali::Text::IsNewLine()
136 bool IsNewLine( std::size_t index ) const;
139 * Retrieves a reference to the UTF-32 encoded string.
140 * @return A reference to the UTF-32 encoded string.
142 const Integration::TextArray& GetTextArray() const;
146 Integration::TextArray mString; ///< Stores an array of unicodes.
150 * @brief Helper function to get the Integration::TextArray from a Dali::Text.
152 * @param[in] text A Dali::Text.
154 * @return The Text's Integration::TextArray.
156 const Integration::TextArray& GetTextArray( const Dali::Text& text );
158 } // namespace Internal
162 #endif // __DALI_INTERNAL_TEXT_H__