1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_INSPECTOR_SHAPE_CONTAINER_COMPOSED_ELEMENT_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_INSPECTOR_SHAPE_CONTAINER_COMPOSED_ELEMENT_H
18 
19 #include "core/components/shape/render_shape_container.h"
20 #include "core/components/shape/shape_container_component.h"
21 #include "core/components/shape/shape_container_element.h"
22 #include "core/components_v2/inspector/inspector_composed_element.h"
23 #include "core/pipeline/base/composed_element.h"
24 
25 namespace OHOS::Ace::V2 {
26 
27 class ACE_EXPORT ShapeContainerComposedElement : public InspectorComposedElement {
28     DECLARE_ACE_TYPE(ShapeContainerComposedElement, InspectorComposedElement)
29 
30 public:
31     static std::string LineCapStyleToString(LineCapStyle lineCapStyle);
32     static std::string LineJoinStyleToString(LineJoinStyle lineJoinStyle);
33 
ShapeContainerComposedElement(const ComposeId & id)34     explicit ShapeContainerComposedElement(const ComposeId& id) : InspectorComposedElement(id) {}
35     ~ShapeContainerComposedElement() override = default;
36     void Dump() override;
37     std::unique_ptr<JsonValue> ToJsonObject() const override;
38 
39     std::string GetAntiAlias() const;
40     std::string GetFill() const;
41     std::string GetFillOpacity() const;
42     std::string GetStroke() const;
43     std::string GetStrokeDashOffset() const;
44     std::string GetStrokeLineCap() const;
45     std::string GetStrokeLineJoin() const;
46     std::string GetStrokeMiterLimit() const;
47     std::string GetStrokeOpacity() const;
48     std::string GetStrokeWidth() const;
49     std::unique_ptr<JsonValue> GetViewBox() const;
50     std::unique_ptr<JsonValue> GetStrokeDashArray() const;
51     std::unique_ptr<JsonValue> GetMesh() const;
52 
GetTargetTypeId()53     AceType::IdType GetTargetTypeId() const override
54     {
55         return ShapeContainerElement::TypeId();
56     }
57 };
58 
59 } // namespace OHOS::Ace::V2
60 
61 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_INSPECTOR_SHAPE_CONTAINER_COMPOSED_ELEMENT_H