1 /*
2  * Copyright (c) 2024 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_NG_PROPERTIES_CONSTRAINT_FLAGS_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PROPERTIES_CONSTRAINT_FLAGS_H
18 #include "core/components_ng/property/layout_constraint.h"
19 namespace OHOS::Ace::NG {
20 struct ConstraintFlags {
21     /**
22     * @brief Compare previous layout constraint and current layout constraint to update flags.
23     *
24     * @param preConstraint previous layout constraint
25     * @param constraint current layout constraint
26     */
27     void UpdateFlags(
28         const std::optional<LayoutConstraintF>& preConstraint, const std::optional<LayoutConstraintF>& constraint);
29 
30     std::string ToString() const;
31 
32     bool idealSize = false;
33     bool parentIdealSize = false;
34     bool minSize = false;
35     bool maxSize = false;
36     bool percentRef = false;
37     bool scaleProperty = false;
38 };
39 } // namespace OHOS::Ace::NG
40 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PROPERTIES_CONSTRAINT_FLAGS_H
41