1 #ifndef DALI_TOOLKIT_TEXT_BASE_SPAN_H
2 #define DALI_TOOLKIT_TEXT_BASE_SPAN_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/public-api/object/base-handle.h>
31 namespace Internal DALI_INTERNAL
37 * @brief Base structure for different text-spans.
38 * The application can attach and detach spans on range of text for text-controller.
39 * Used to modify text style dynamically at runtime on character level.
41 * A text-span contains set of attributes of specific style for text.
43 * To receive a particular text-span, the application has to create span through its builder.
45 * @note An instance of this class cannot be created.
48 class DALI_TOOLKIT_API BaseSpan : public BaseHandle
52 * @brief Creates an uninitialized BaseSpan handle.
54 * Calling member functions with an uninitialized BaseSpan handle is not allowed.
59 * @brief Copy constructor.
61 * @param[in] rhs A reference to the copied handle
63 BaseSpan(const BaseSpan& rhs);
66 * @brief Move constructor.
68 * @param[in] rhs A reference to the handle to move
70 BaseSpan(BaseSpan&& rhs);
73 * @brief Assignment operator.
75 * @param[in] handle A reference to the copied handle
76 * @return A reference to this
78 BaseSpan& operator=(const BaseSpan& handle);
81 * @brief Move assignment operator.
83 * @param[in] rhs A reference to the handle to move
84 * @return A reference to this handle
86 BaseSpan& operator=(BaseSpan&& rhs);
89 * @brief Non virtual destructor.
94 * @brief Downcasts to a BaseSpan handle.
95 * If handle is not a BaseSpan, the returned handle is left uninitialized.
97 * @param[in] handle Handle to an object
98 * @return BaseSpan handle or an uninitialized handle
100 static BaseSpan DownCast(BaseHandle handle);
102 public: // Not intended for application developers
105 * @brief Internal constructor.
107 * @param[in] baseSpan Pointer to internal BaseSpan
109 explicit DALI_INTERNAL BaseSpan(Internal::BaseSpan* baseSpan);
115 } // namespace Toolkit
117 // Allow BaseSpan to be treated as a POD type
119 struct TypeTraits<Dali::Toolkit::Text::BaseSpan> : public BasicTypes<Dali::Toolkit::Text::BaseSpan>
123 IS_TRIVIAL_TYPE = true
129 #endif // DALI_TOOLKIT_TEXT_BASE_SPAN_H