1 #ifndef DALI_TOOLKIT_TEXT_SPANNABLE_STRING_H
2 #define DALI_TOOLKIT_TEXT_SPANNABLE_STRING_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/spannable.h>
31 namespace Internal DALI_INTERNAL
33 class SpannableString;
37 * @brief Interface for text that has spans objects attached to ranges of it.
38 * It provides uniform APIs for read-only access to many different kinds of formatted character sequences.
40 * @note An instance of this class cannot be created.
43 class DALI_TOOLKIT_API SpannableString : public Spannable
47 * @brief Create an initialized SpannableString.
49 * @param[in] text the text to be formatted
51 * @return A handle to a newly allocated Dali resource
53 static SpannableString New(const std::string& text);
56 * @brief Creates an uninitialized SpannableString handle.
58 * Calling member functions with an uninitialized SpannableString handle is not allowed.
63 * @brief Copy constructor.
65 * @param[in] rhs A reference to the copied handle
67 SpannableString(const SpannableString& rhs);
70 * @brief Move constructor.
72 * @param[in] rhs A reference to the handle to move
74 SpannableString(SpannableString&& rhs);
77 * @brief Assignment operator.
79 * @param[in] handle A reference to the copied handle
80 * @return A reference to this
82 SpannableString& operator=(const SpannableString& handle);
85 * @brief Move assignment operator.
87 * @param[in] rhs A reference to the handle to move
88 * @return A reference to this handle
90 SpannableString& operator=(SpannableString&& rhs);
93 * @brief Non virtual destructor.
99 * @brief Downcasts to a SpannableString handle.
100 * If handle is not a SpannableString, the returned handle is left uninitialized.
102 * @param[in] handle Handle to an object
103 * @return SpannableString handle or an uninitialized handle
105 static SpannableString DownCast(BaseHandle handle);
107 public: // Not intended for application developers
110 * @brief Internal constructor.
112 * @param[in] spannableString Pointer to internal SpannableString
114 explicit DALI_INTERNAL SpannableString(Internal::SpannableString* spannableString);
120 } // namespace Toolkit
124 #endif // DALI_TOOLKIT_TEXT_SPANNABLE_STRING_H