1 #ifndef DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H
2 #define DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H
5 * Copyright (c) 2021 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/public-api/common/intrusive-ptr.h>
25 #include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
26 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
35 typedef IntrusivePtr<ArcVisual> ArcVisualPtr;
38 * The visual which renders an arc to the control's quad
40 * The following properties are required for create an ArcVisual
42 * | %Property Name | Type |
43 * |-----------------|-------------|
44 * | THICKNESS | FLOAT |
45 * | START_ANGLE | FLOAT |
46 * | SWEEP_ANGLE | FLOAT |
49 class ArcVisual : public Visual::Base
53 * @brief Create a new arc visual.
55 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
56 * @param[in] properties A Property::Map containing settings for this visual
57 * @return A smart-pointer to the newly allocated visual.
59 static ArcVisualPtr New(VisualFactoryCache& factoryCache, const Property::Map& properties);
61 public: // from Visual
63 * @copydoc Visual::Base::CreatePropertyMap
65 void DoCreatePropertyMap(Property::Map& map) const override;
68 * @copydoc Visual::Base::CreateInstancePropertyMap
70 void DoCreateInstancePropertyMap(Property::Map& map) const override;
76 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
78 ArcVisual(VisualFactoryCache& factoryCache);
81 * @brief A reference counted object may only be deleted by calling Unreference().
86 * @copydoc Visual::Base::OnInitialize
88 void OnInitialize() override;
91 * @copydoc Visual::Base::DoSetProperties
93 void DoSetProperties(const Property::Map& propertyMap) override;
96 * @copydoc Visual::Base::DoSetOnScene
98 void DoSetOnScene(Actor& actor) override;
101 * @copydoc Visual::Base::DoSetOffScene
103 void DoSetOffScene(Actor& actor) override;
106 * @copydoc Visual::Base::OnSetTransform
108 void OnSetTransform() override;
112 ArcVisual(const ArcVisual& arcVisual) = delete;
115 ArcVisual& operator=(const ArcVisual& arcVisual) = delete;
118 float mThickness; ///< The thickness of the arc.
119 float mRadius; ///< The radius of the arc.
120 float mStartAngle; ///< The start angle of the arc.
121 float mSweepAngle; ///< The sweep angle of the arc.
122 Property::Index mRadiusIndex; ///< The index of the radius property.
123 Property::Index mThicknessIndex; ///< The index of the thickness property.
124 Property::Index mStartAngleIndex; ///< The index of the start angle property.
125 Property::Index mSweepAngleIndex; ///< The index of the sweep angle property.
126 DevelArcVisual::Cap::Type mCapType; ///< The cap type.
129 } // namespace Internal
131 } // namespace Toolkit
135 #endif /* DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H */