1 /* 2 * Copyright (c) 2022 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_WATER_FLOW_COMPOSED_ELEMENT_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_INSPECTOR_WATER_FLOW_COMPOSED_ELEMENT_H 18 19 #include "core/components_v2/water_flow/water_flow_component.h" 20 #include "core/components_v2/inspector/inspector_composed_element.h" 21 #include "core/components_v2/water_flow/render_water_flow.h" 22 #include "core/components_v2/water_flow/water_flow_element.h" 23 #include "core/pipeline/base/composed_element.h" 24 25 namespace OHOS::Ace::V2 { 26 27 class ACE_EXPORT WaterFlowComposedElement : public InspectorComposedElement { DECLARE_ACE_TYPE(WaterFlowComposedElement,InspectorComposedElement)28 DECLARE_ACE_TYPE(WaterFlowComposedElement, InspectorComposedElement) 29 30 public: 31 explicit WaterFlowComposedElement(const ComposeId& id) : InspectorComposedElement(id) {} 32 ~WaterFlowComposedElement() override = default; 33 34 void Dump() override; 35 36 std::unique_ptr<JsonValue> ToJsonObject() const override; 37 std::string GetColumnsTemplate() const; 38 std::string GetRowsTemplate() const; 39 std::string GetColumnsGap() const; 40 std::string GetRowsGap() const; 41 std::string GetlayoutDirection() const; 42 std::string GetItemConstraintSize() const; 43 GetTargetTypeId()44 AceType::IdType GetTargetTypeId() const override 45 { 46 return WaterFlowElement::TypeId(); 47 } 48 49 private: 50 void AddChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent) override; 51 void UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent) override; 52 void DeleteChildWithSlot(int32_t slot) override; 53 ACE_DISALLOW_COPY_AND_MOVE(WaterFlowComposedElement); 54 }; 55 56 } // namespace OHOS::Ace::V2 57 58 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_V2_INSPECTOR_WATER_FLOW_COMPOSED_ELEMENT_H