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_FORM_MODEL_IMPL_H 17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_FORM_MODEL_IMPL_H 18 19 #include "core/components_ng/pattern/indexer/indexer_model.h" 20 21 namespace OHOS::Ace::Framework { 22 class IndexerModelImpl : public OHOS::Ace::IndexerModel { 23 public: 24 void Create(std::vector<std::string>& indexerArray, int32_t selectedVal) override; 25 void SetSelectedColor(const std::optional<Color>& color) override; 26 void SetColor(const std::optional<Color>& color) override; 27 void SetPopupColor(const std::optional<Color>& color) override; 28 void SetSelectedBackgroundColor(const std::optional<Color>& color) override; 29 void SetPopupBackground(const std::optional<Color>& color) override; 30 void SetUsingPopup(bool state) override; 31 void SetSelectedFont(std::optional<Dimension>& fontSize, std::optional<FontWeight>& fontWeight, 32 std::optional<std::vector<std::string>>& fontFamily, std::optional<FontStyle>& fontStyle) override; 33 void SetPopupFont(std::optional<Dimension>& fontSize, std::optional<FontWeight>& fontWeight, 34 std::optional<std::vector<std::string>>& fontFamily, std::optional<FontStyle>& fontStyle) override; 35 void SetFont(std::optional<Dimension>& fontSize, std::optional<FontWeight>& fontWeight, 36 std::optional<std::vector<std::string>>& fontFamily, std::optional<FontStyle>& fontStyle) override; 37 void SetItemSize(const Dimension& value) override; 38 void SetAlignStyle(int32_t value) override; 39 void SetOnSelected(std::function<void(const int32_t selected)>&& onSelect) override; 40 void SetOnRequestPopupData( 41 std::function<std::vector<std::string>(const int32_t selected)>&& RequestPopupData) override; 42 void SetOnPopupSelected(std::function<void(const int32_t selected)>&& onPopupSelected) override; 43 void SetTextStyle(TextStyle& textStyle, std::optional<Dimension>& fontSize, std::optional<FontWeight>& fontWeight, 44 std::optional<std::vector<std::string>>& fontFamily, std::optional<FontStyle>& fontStyle); SetAutoCollapse(bool state)45 void SetAutoCollapse(bool state) override {} SetEnableHapticFeedback(bool state)46 void SetEnableHapticFeedback(bool state) override {} 47 }; 48 } // namespace OHOS::Ace::Framework 49 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_FORM_MODEL_IMPL_H 50