1 /*
2  * Copyright (c) 2023 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 FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_SELECT_MODEL_IMPL_H
17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_SELECT_MODEL_IMPL_H
18 
19 #include <optional>
20 #include <string>
21 
22 #include "frameworks/core/components_ng/pattern/select/select_model.h"
23 
24 namespace OHOS::Ace::Framework {
25 class SelectModelImpl : public SelectModel {
26 public:
27     void Create(const std::vector<SelectParam>& params) override;
28     void SetSelected(int32_t idx) override;
29     void SetValue(const std::string& value) override;
30     void SetFontSize(const Dimension& value) override;
31     void SetFontWeight(const FontWeight& value) override;
32     void SetFontFamily(const std::vector<std::string>& value) override;
33     void SetItalicFontStyle(const Ace::FontStyle& value) override;
34     void SetFontColor(const Color& color) override;
35     void SetSelectedOptionBgColor(const Color& color) override;
36     void SetSelectedOptionFontSize(const Dimension& value) override;
37     void SetSelectedOptionFontWeight(const FontWeight& value) override;
38     void SetSelectedOptionFontFamily(const std::vector<std::string>& value) override;
39     void SetSelectedOptionItalicFontStyle(const Ace::FontStyle& value) override;
40     void SetSelectedOptionFontColor(const Color& color) override;
41     void SetOptionBgColor(const Color& color) override;
42     void SetOptionFontSize(const Dimension& value) override;
43     void SetOptionFontWeight(const FontWeight& value) override;
44     void SetOptionFontFamily(const std::vector<std::string>& value) override;
45     void SetOptionItalicFontStyle(const Ace::FontStyle& value) override;
46     void SetOptionFontColor(const Color& color) override;
47     void SetOnSelect(NG::SelectEvent&& onSelect) override;
48     void SetWidth(Dimension& value) override;
49     void SetHeight(Dimension& value) override;
50     void SetSize(Dimension& width, Dimension& height) override;
51     void SetPaddings(const std::optional<CalcDimension>& top, const std::optional<CalcDimension>& bottom,
52         const std::optional<CalcDimension>& left, const std::optional<CalcDimension>& right) override;
53     void SetPadding(const CalcDimension& value) override;
54     void SetPaddingLeft(const CalcDimension& value) override;
55     void SetPaddingTop(const CalcDimension& value) override;
56     void SetPaddingRight(const CalcDimension& value) override;
57     void SetPaddingBottom(const CalcDimension& value) override;
58     void SetSpace(const Dimension& value) override;
59     void SetArrowPosition(const ArrowPosition value) override;
60     void SetMenuAlign(const MenuAlign& menuAlign) override;
61     void SetSelectChangeEvent(NG::SelectChangeEvent&& selectChangeEvent) override;
62     void SetValueChangeEvent(NG::ValueChangeEvent&& valueChangeEvent) override;
63     void SetOptionWidth(const Dimension& value) override;
64     void SetOptionHeight(const Dimension& value) override;
65     void SetOptionWidthFitTrigger(bool isFitTrigger) override;
66     void SetHasOptionWidth(bool haveOptionWidth) override;
67     void SetMenuBackgroundColor(const Color& color) override;
68     void SetMenuBackgroundBlurStyle(const BlurStyleOption& blurStyle) override;
SetDivider(const NG::SelectDivider & divider)69     void SetDivider(const NG::SelectDivider& divider) override {}
SetControlSize(const std::optional<ControlSize> & controlSize)70     void SetControlSize(const std::optional<ControlSize>& controlSize) override {}
71     void SetLayoutDirection(TextDirection value) override;
GetControlSize()72     ControlSize GetControlSize() override { return ControlSize{}; }
73 };
74 } // namespace OHOS::Ace::Framework
75 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_SELECT_MODEL_IMPL_H
76