1 #ifndef DALI_TOOLKIT_INTERNAL_TEXT_BASE_SPAN_IMPL_H
2 #define DALI_TOOLKIT_INTERNAL_TEXT_BASE_SPAN_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.
25 #include <dali-toolkit/devel-api/text/spans/base-span.h>
26 #include <dali-toolkit/internal/text/text-definitions.h>
27 #include <dali/public-api/object/base-object.h>
36 struct AbstractStyleCharacterRun;
42 using BaseSpanPtr = IntrusivePtr<BaseSpan>;
43 using BaseSpanConstPtr = const BaseSpan*;
46 * @copydoc Dali::Toolkit::Text::BaseSpan
48 class BaseSpan : public BaseObject
51 BaseSpan(const BaseSpan&) = delete; ///< Deleted copy constructor
52 BaseSpan(BaseSpan&&) = delete; ///< Deleted move constructor
53 BaseSpan& operator=(const BaseSpan&) = delete; ///< Deleted copy assignment operator
54 BaseSpan& operator=(BaseSpan&&) = delete; ///< Deleted move assignment operator
58 * @brief Default Constructor
63 * @brief Virtual destructor.
65 * A reference counted object may only be deleted by calling Unreference()
71 } // namespace Internal
74 * Helper methods for public API.
76 inline Internal::BaseSpan& GetImplementation(Dali::Toolkit::Text::BaseSpan& baseSpan)
78 DALI_ASSERT_ALWAYS(baseSpan && "baseSpan handle is empty");
80 BaseObject& handle = baseSpan.GetBaseObject();
82 return static_cast<Internal::BaseSpan&>(handle);
85 inline const Internal::BaseSpan& GetImplementation(const Dali::Toolkit::Text::BaseSpan& baseSpan)
87 DALI_ASSERT_ALWAYS(baseSpan && "baseSpan handle is empty");
89 const BaseObject& handle = baseSpan.GetBaseObject();
91 return static_cast<const Internal::BaseSpan&>(handle);
96 } // namespace Toolkit
98 // Allow BaseSpan to be treated as a POD type
100 struct TypeTraits<Dali::Toolkit::Text::Internal::BaseSpan> : public Dali::BasicTypes<Dali::Toolkit::Text::Internal::BaseSpan>
104 IS_TRIVIAL_TYPE = true
110 #endif // DALI_TOOLKIT_INTERNAL_TEXT_BASE_SPAN_IMPL_H