1 #ifndef DALI_TOOLKIT_INTERNAL_TEXT_CHARACTER_SEQUENCE_IMPL_H
2 #define DALI_TOOLKIT_INTERNAL_TEXT_CHARACTER_SEQUENCE_IMPL_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/devel-api/text/character-sequence.h>
26 #include <dali-toolkit/internal/text/text-definitions.h>
27 #include <dali/public-api/object/base-object.h>
37 class CharacterSequence;
39 typedef IntrusivePtr<CharacterSequence> CharacterSequencePtr;
40 typedef const CharacterSequence* CharacterSequenceConstPtr;
43 * @copydoc Dali::Toolkit::Text::CharacterSequence
45 class CharacterSequence : public BaseObject
49 * This constructor is only used by derived classes.
54 * @brief Virtual destructor.
56 * A reference counted object may only be deleted by calling Unreference()
58 virtual ~CharacterSequence() = 0;
60 // Removed constructors and assignment operators
62 CharacterSequence(const CharacterSequence&) = delete; ///< Deleted copy constructor
63 CharacterSequence(CharacterSequence&&) = delete; ///< Deleted move constructor
64 CharacterSequence& operator=(const CharacterSequence&) = delete; ///< Deleted copy assignment operator
65 CharacterSequence& operator=(CharacterSequence&&) = delete; ///< Deleted move assignment operator
69 * @copydoc Dali::Toolkit::Text::CharacterSequence::GetCharacters()
71 virtual Vector<uint32_t> GetCharacters() const = 0;
74 * @copydoc Dali::Toolkit::Text::CharacterSequence::GetNumberOfCharacters()
76 virtual uint32_t GetNumberOfCharacters() const = 0;
79 * @copydoc Dali::Toolkit::Text::CharacterSequence::ToString()
81 virtual std::string ToString() const = 0;
83 }; // class CharacterSequence
85 } // namespace Internal
88 * Helper methods for public API.
90 inline Internal::CharacterSequence& GetImplementation(Dali::Toolkit::Text::CharacterSequence& characterSequence)
92 DALI_ASSERT_ALWAYS(characterSequence && "characterSequence handle is empty");
94 BaseObject& handle = characterSequence.GetBaseObject();
96 return static_cast<Internal::CharacterSequence&>(handle);
99 inline const Internal::CharacterSequence& GetImplementation(const Dali::Toolkit::Text::CharacterSequence& characterSequence)
101 DALI_ASSERT_ALWAYS(characterSequence && "characterSequence handle is empty");
103 const BaseObject& handle = characterSequence.GetBaseObject();
105 return static_cast<const Internal::CharacterSequence&>(handle);
110 } // namespace Toolkit
112 // Allow AbstractStyleSpan to be treated as a POD type
114 struct TypeTraits<Dali::Toolkit::Text::Internal::CharacterSequence> : public Dali::BasicTypes<Dali::Toolkit::Text::Internal::CharacterSequence>
118 IS_TRIVIAL_TYPE = true
124 #endif // DALI_TOOLKIT_INTERNAL_TEXT_CHARACTER_SEQUENCE_IMPL_H