Merge "Use Renderer::BlendMode::USE_ACTOR_OPACITY instead to use depth write mode...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / spannable / spans / italic-span-impl.h
1 #ifndef DALI_TOOLKIT_INTERNAL_TEXT_ITALIC_SPAN_IMPL_H
2 #define DALI_TOOLKIT_INTERNAL_TEXT_ITALIC_SPAN_IMPL_H
3
4 /*
5  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali-toolkit/devel-api/text/spans/italic-span.h>
23 #include <memory>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/internal/text/logical-model-impl.h>
27 #include <dali-toolkit/internal/text/spannable/spans/base-span-impl.h>
28
29 namespace Dali
30 {
31 namespace Toolkit
32 {
33 namespace Text
34 {
35 namespace Internal
36 {
37 class ItalicSpan;
38 using ItalicSpanPtr = IntrusivePtr<ItalicSpan>;
39
40 /**
41  * @copydoc Dali::Toolkit::Text::ItalicSpan
42  */
43 class ItalicSpan : public BaseSpan
44 {
45 public:
46   /**
47    * @brief Creates a new ItalicSpan object.
48    */
49   static Dali::Toolkit::Text::ItalicSpan New();
50
51   /**
52    * Default Constructor
53    */
54   ItalicSpan();
55
56   ///< Deleted copy constructor
57   ItalicSpan(const ItalicSpan&) = delete;
58
59   ///< Deleted move constructor
60   ItalicSpan(ItalicSpan&&) = delete;
61
62   ///< Deleted copy assignment operator
63   ItalicSpan& operator=(const ItalicSpan&) = delete;
64
65   ///< Deleted move assignment operator
66   ItalicSpan& operator=(ItalicSpan&&) = delete;
67
68   /**
69    * @brief Destructor.
70    *
71    * A reference counted object may only be deleted by calling Unreference().
72    */
73   ~ItalicSpan() override;
74
75   //Methods for internal only
76   /**
77    * @copydoc Dali::Toolkit::Text::BaseSpan::CreateStyleCharacterRun
78    */
79   void CreateStyleCharacterRun(IntrusivePtr<LogicalModel>& logicalModel, const Dali::Toolkit::Text::Range& range) const override;
80
81 }; // class ItalicSpan
82
83 } // namespace Internal
84
85 // Helpers for public-api forwarding methods
86
87 inline Internal::ItalicSpan& GetImplementation(Dali::Toolkit::Text::ItalicSpan& italicSpan)
88 {
89   DALI_ASSERT_ALWAYS(italicSpan && "italicSpan handle is empty");
90
91   BaseObject& object = italicSpan.GetBaseObject();
92
93   return static_cast<Internal::ItalicSpan&>(object);
94 }
95
96 inline const Internal::ItalicSpan& GetImplementation(const Dali::Toolkit::Text::ItalicSpan& italicSpan)
97 {
98   DALI_ASSERT_ALWAYS(italicSpan && "italicSpan handle is empty");
99
100   const BaseObject& object = italicSpan.GetBaseObject();
101
102   return static_cast<const Internal::ItalicSpan&>(object);
103 }
104
105 } // namespace Text
106
107 } // namespace Toolkit
108
109 } // namespace Dali
110
111
112 #endif // DALI_TOOLKIT_INTERNAL_TEXT_ITALIC_SPAN_IMPL_H