1 #ifndef DALI_TOOLKIT_TEXT_CHARACTER_SEQUENCE_H
2 #define DALI_TOOLKIT_TEXT_CHARACTER_SEQUENCE_H
5 * Copyright (c) 2022 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/dali-toolkit-common.h>
23 #include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
24 #include <dali/public-api/object/base-handle.h>
32 namespace Internal DALI_INTERNAL
34 class CharacterSequence;
38 * @brief Interface for readable character sequence.
39 * It provides uniform APIs for read-only access to many different kinds of character sequences.
41 * @note An instance of this class cannot be created.
44 class DALI_TOOLKIT_API CharacterSequence : public BaseHandle
48 * @brief Creates an uninitialized CharacterSequence handle.
50 * Calling member functions with an uninitialized CharacterSequence handle is not allowed.
55 * @brief Copy constructor.
57 * @param[in] rhs A reference to the copied handle
59 CharacterSequence(const CharacterSequence& rhs);
62 * @brief Move constructor.
64 * @param[in] rhs A reference to the handle to move
66 CharacterSequence(CharacterSequence&& rhs);
69 * @brief Assignment operator.
71 * @param[in] handle A reference to the copied handle
72 * @return A reference to this
74 CharacterSequence& operator=(const CharacterSequence& handle);
77 * @brief Move assignment operator.
79 * @param[in] rhs A reference to the handle to move
80 * @return A reference to this handle
82 CharacterSequence& operator=(CharacterSequence&& rhs);
85 * @brief Non virtual destructor.
91 * @brief Downcasts to a CharacterSequence handle.
92 * If handle is not a CharacterSequence, the returned handle is left uninitialized.
94 * @param[in] handle Handle to an object
95 * @return CharacterSequence handle or an uninitialized handle
97 static CharacterSequence DownCast(BaseHandle handle);
99 public: // Not intended for application developers
102 * @brief Internal constructor.
104 * @param[in] characterSequence Pointer to internal CharacterSequence
106 explicit DALI_INTERNAL CharacterSequence(Internal::CharacterSequence* characterSequence);
111 * @brief Retrive the characters
113 * @return the utf32 characters.
115 Vector<uint32_t> GetCharacters() const;
118 * @brief Retrive number of characters in container
120 * @return the number of characters.
122 uint32_t GetNumberOfCharacters() const;
125 * @brief Retrieve constructed string form Character Sequence.
126 * Copy the characters from container to string
128 * @return the std string.
130 std::string ToString() const;
135 } // namespace Toolkit
139 #endif // DALI_TOOLKIT_TEXT_CHARACTER_SEQUENCE_H