1 #ifndef DALI_TOOLKIT_TEXT_ABSTRACT_STYLE_CHARACTER_RUN_H
2 #define DALI_TOOLKIT_TEXT_ABSTRACT_STYLE_CHARACTER_RUN_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/public-api/common/type-traits.h>
23 #include <dali/public-api/math/vector4.h>
26 #include <dali-toolkit/internal/text/character-run.h>
35 * @brief Run of characters with the same style.
37 struct AbstractStyleCharacterRun
39 CharacterRun characterRun; ///< The initial character index and the number of characters of the run.
46 * Default constructor to set the default values
48 AbstractStyleCharacterRun()
55 * Default constructor to set the default values
57 * @param[in] characterRun the character run
59 AbstractStyleCharacterRun(const CharacterRun& characterRun)
60 : characterRun{characterRun}
65 AbstractStyleCharacterRun(const AbstractStyleCharacterRun&) = default;
67 AbstractStyleCharacterRun(AbstractStyleCharacterRun&&) noexcept = default;
71 AbstractStyleCharacterRun& operator=(const AbstractStyleCharacterRun&) = default;
73 AbstractStyleCharacterRun& operator=(AbstractStyleCharacterRun&&) noexcept = default;
78 virtual ~AbstractStyleCharacterRun() = default;
83 * @brief Retrive the first index in run.
84 * @return the end character index in run.
86 CharacterIndex GetStartCharacterIndex() const;
89 * @brief Retrive the number of characters in the run.
90 * @return the the number of characters in run.
92 Length GetNumberOfCharacters() const;
95 * @brief Calculate the end index in run.
96 * @return the end character index in run.
98 CharacterIndex GetEndCharacterIndex() const;
103 } // namespace Toolkit
105 // Allow AbstractStyleCharacterRun to be treated as a POD type
107 struct TypeTraits<Dali::Toolkit::Text::AbstractStyleCharacterRun> : public Dali::BasicTypes<Dali::Toolkit::Text::AbstractStyleCharacterRun>
111 IS_TRIVIAL_TYPE = true
117 #endif // DALI_TOOLKIT_TEXT_ABSTRACT_STYLE_CHARACTER_RUN_H