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/devel-api/text/spans/span-enumerations.h>
23 #include <dali-toolkit/public-api/dali-toolkit-common.h>
24 #include <dali/public-api/object/base-handle.h>
32 namespace Internal DALI_INTERNAL
38 * @brief Base structure for different text-spans.
39 * The application can attach and detach spans on range of text for text-controller.
40 * Used to modify text style dynamically at runtime on character level.
42 * A text-span contains set of attributes of specific style for text.
44 * To receive a particular text-span, the application has to create span through its builder.
46 * @note An instance of this class cannot be created.
49 class DALI_TOOLKIT_API BaseSpan : public BaseHandle
53 * @brief Creates an uninitialized BaseSpan handle.
55 * Calling member functions with an uninitialized BaseSpan handle is not allowed.
60 * @brief Copy constructor.
62 * @param[in] rhs A reference to the copied handle
64 BaseSpan(const BaseSpan& rhs);
67 * @brief Move constructor.
69 * @param[in] rhs A reference to the handle to move
71 BaseSpan(BaseSpan&& rhs);
74 * @brief Assignment operator.
76 * @param[in] handle A reference to the copied handle
77 * @return A reference to this
79 BaseSpan& operator=(const BaseSpan& handle);
82 * @brief Move assignment operator.
84 * @param[in] rhs A reference to the handle to move
85 * @return A reference to this handle
87 BaseSpan& operator=(BaseSpan&& rhs);
90 * @brief Non virtual destructor.
95 * @brief Retrive the span type.
97 * @return A span type value.
99 const Dali::Toolkit::Text::SpanType::Value GetSpanType() const;
102 * @brief Downcasts to a BaseSpan handle.
103 * If handle is not a BaseSpan, the returned handle is left uninitialized.
105 * @param[in] handle Handle to an object
106 * @return BaseSpan handle or an uninitialized handle
108 static BaseSpan DownCast(BaseHandle handle);
110 public: // Not intended for application developers
113 * @brief Internal constructor.
115 * @param[in] baseSpan Pointer to internal BaseSpan
117 explicit DALI_INTERNAL BaseSpan(Internal::BaseSpan* baseSpan);
123 } // namespace Toolkit
125 // Allow BaseSpan to be treated as a POD type
127 struct TypeTraits<Dali::Toolkit::Text::BaseSpan> : public BasicTypes<Dali::Toolkit::Text::BaseSpan>
131 IS_TRIVIAL_TYPE = true
137 #endif // DALI_TOOLKIT_TEXT_BASE_SPAN_H