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_RICH_EDITOR_MODEL_IMPL_H 17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_RICH_EDITOR_MODEL_IMPL_H 18 19 #include "core/components_ng/pattern/rich_editor/rich_editor_model_ng.h" 20 namespace OHOS::Ace::Framework { 21 class ACE_EXPORT RichEditorModelImpl : public RichEditorModel { 22 void Create(bool isStyledStringMode = false) override {} 23 RefPtr<RichEditorBaseControllerBase> GetRichEditorController() override; SetOnReady(std::function<void ()> && func)24 void SetOnReady(std::function<void()>&& func) override {} SetOnSelect(std::function<void (const BaseEventInfo *)> && func)25 void SetOnSelect(std::function<void(const BaseEventInfo*)>&& func) override {} SetOnSelectionChange(std::function<void (const BaseEventInfo *)> && func)26 void SetOnSelectionChange(std::function<void(const BaseEventInfo*)>&& func) override {} SetAboutToIMEInput(std::function<bool (const NG::RichEditorInsertValue &)> && func)27 void SetAboutToIMEInput(std::function<bool(const NG::RichEditorInsertValue&)>&& func) override {} SetOnIMEInputComplete(std::function<void (const NG::RichEditorAbstractSpanResult &)> && func)28 void SetOnIMEInputComplete(std::function<void(const NG::RichEditorAbstractSpanResult&)>&& func) override {} SetOnDidIMEInput(std::function<void (const TextRange &)> && func)29 void SetOnDidIMEInput(std::function<void(const TextRange&)>&& func) override {} SetAboutToDelete(std::function<bool (const NG::RichEditorDeleteValue &)> && func)30 void SetAboutToDelete(std::function<bool(const NG::RichEditorDeleteValue&)>&& func) override {} SetOnDeleteComplete(std::function<void ()> && func)31 void SetOnDeleteComplete(std::function<void()>&& func) override {} 32 void SetCustomKeyboard(std::function<void()>&& func, bool supportAvoidance = false) override {} SetCopyOption(CopyOptions & copyOptions)33 void SetCopyOption(CopyOptions& copyOptions) override {} BindSelectionMenu(NG::TextSpanType & editorType,NG::TextResponseType & responseType,std::function<void ()> & buildFunc,NG::SelectMenuParam & menuParam)34 void BindSelectionMenu(NG::TextSpanType& editorType, NG::TextResponseType& responseType, 35 std::function<void()>& buildFunc, NG::SelectMenuParam& menuParam) override {} SetOnPaste(std::function<void (NG::TextCommonEvent &)> && func)36 void SetOnPaste(std::function<void(NG::TextCommonEvent&)>&& func) override {} SetPlaceholder(PlaceholderOptions & options)37 void SetPlaceholder(PlaceholderOptions& options) override {} SetTextDetectEnable(bool value)38 void SetTextDetectEnable(bool value) override {} SetSupportPreviewText(bool value)39 void SetSupportPreviewText(bool value) override {} SetTextDetectConfig(const TextDetectConfig & textDetectConfig)40 void SetTextDetectConfig(const TextDetectConfig& textDetectConfig) override {} SetSelectedBackgroundColor(const Color & selectedColor)41 void SetSelectedBackgroundColor(const Color& selectedColor) override {} SetCaretColor(const Color & color)42 void SetCaretColor(const Color& color) override {} SetOnEditingChange(std::function<void (const bool &)> && func)43 void SetOnEditingChange(std::function<void(const bool&)>&& func) override {} SetOnSubmit(std::function<void (int32_t,NG::TextFieldCommonEvent &)> && func)44 void SetOnSubmit(std::function<void(int32_t, NG::TextFieldCommonEvent&)>&& func) override {} SetEnterKeyType(TextInputAction value)45 void SetEnterKeyType(TextInputAction value) override {} SetOnWillChange(std::function<bool (const NG::RichEditorChangeValue &)> && func)46 void SetOnWillChange(std::function<bool(const NG::RichEditorChangeValue&)>&& func) override {} SetOnDidChange(std::function<void (const NG::RichEditorChangeValue &)> && func)47 void SetOnDidChange(std::function<void(const NG::RichEditorChangeValue&)>&& func) override {} SetOnCut(std::function<void (NG::TextCommonEvent &)> && func)48 void SetOnCut(std::function<void(NG::TextCommonEvent&)>&& func) override {} SetOnCopy(std::function<void (NG::TextCommonEvent &)> && func)49 void SetOnCopy(std::function<void(NG::TextCommonEvent&)>&& func) override {} 50 }; 51 } // namespace OHOS::Ace::Framework 52 53 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_MODELS_RICH_EDITOR_MODEL_IMPL_H 54