1 #ifndef DALI_TOOLKIT_TEXT_BACKGROUND_COLOR_SPAN_H
2 #define DALI_TOOLKIT_TEXT_BACKGROUND_COLOR_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/base-span.h>
23 #include <dali/public-api/math/vector4.h>
31 namespace Internal DALI_INTERNAL
33 class BackgroundColorSpan;
37 * @brief BackgroundColorSpan is a handle to an object that specifies the background-color for range of characters.
39 class DALI_TOOLKIT_API BackgroundColorSpan : public BaseSpan
43 * @brief Create an initialized BackgroundColorSpan.
45 * @param[in] color The background color.
47 * @return A handle to a newly allocated Dali resource
49 static BackgroundColorSpan New(const Vector4 &color);
52 * @brief Creates an uninitialized BackgroundColorSpan handle.
54 * Calling member functions with an uninitialized BackgroundColorSpan handle is not allowed.
56 BackgroundColorSpan();
59 * @brief Copy constructor.
60 * @param[in] rhs A reference to the copied handle
62 BackgroundColorSpan(const BackgroundColorSpan& rhs);
65 * @brief Move constructor.
66 * @param[in] rhs A reference to the handle to move
68 BackgroundColorSpan(BackgroundColorSpan&& rhs);
71 * @brief Assignment operator.
72 * @param[in] rhs A reference to the copied handle
73 * @return A reference to this
75 BackgroundColorSpan& operator=(const BackgroundColorSpan& rhs);
78 * @brief Move assignment operator.
79 * @param[in] rhs A reference to the moved handle
80 * @return A reference to this
82 BackgroundColorSpan& operator=(BackgroundColorSpan&& rhs);
85 * @brief Non virtual destructor.
87 ~BackgroundColorSpan();
90 * @brief Downcasts to a BackgroundColorSpan handle.
91 * If handle is not a BackgroundColorSpan, the returned handle is left uninitialized.
93 * @param[in] handle Handle to an object
94 * @return BackgroundColorSpan handle or an uninitialized handle
96 static BackgroundColorSpan DownCast(BaseHandle handle);
100 * @brief Retrive the background-color.
102 * @return A background-color value.
104 const Vector4 GetBackgroundColor() const;
107 * @brief Retrieve whether the background-color is defined.
109 * @return The return is true if background-color is defined, otherwise false.
111 bool IsBackgroundColorDefined() const;
113 public: // Not intended for application developers
116 * @brief This constructor is used internally to Create an initialized BackgroundColorSpan handle.
118 * @param[in] colorSpan Pointer to internal BackgroundColorSpan
120 explicit DALI_INTERNAL BackgroundColorSpan(Internal::BackgroundColorSpan* colorSpan);
126 } // namespace Toolkit
130 #endif // DALI_TOOLKIT_TEXT_BACKGROUND_COLOR_SPAN_H