diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/generated/component/richEditor.ets b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/generated/component/richEditor.ets index a66f2a35759fa010440bc3e4cb2dc081d23f7f51..01333174f7860b0b7418cea639540daa41b9075a 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/generated/component/richEditor.ets +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/generated/component/richEditor.ets @@ -87,6 +87,11 @@ export class RichEditorBaseController implements MaterializedBase { this.setTypingStyle_serialize(value_casted) return } + public setTypingParagraphStyle(value: RichEditorParagraphStyle): void { + const value_casted = value as (RichEditorParagraphStyle) + this.setTypingParagraphStyle_serialize(value_casted) + return + } public setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void { const selectionStart_casted = selectionStart as (number) const selectionEnd_casted = selectionEnd as (number) @@ -133,6 +138,12 @@ export class RichEditorBaseController implements MaterializedBase { ArkUIGeneratedNativeModule._RichEditorBaseController_setTypingStyle(this.peer!.ptr, thisSerializer.asBuffer(), thisSerializer.length()) thisSerializer.release() } + setTypingParagraphStyle_serialize(style: RichEditorParagraphStyle): void { + const thisSerializer : SerializerBase = SerializerBase.hold() + RichEditorTextStyle_serializer.write(thisSerializer, value) + ArkUIGeneratedNativeModule._RichEditorBaseController_setTypingParagraphStyle(this.peer!.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } setSelection_serialize(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void { const thisSerializer : SerializerBase = SerializerBase.hold() if (options !== undefined) { @@ -569,6 +580,18 @@ export class ArkRichEditorPeer extends ArkCommonMethodPeer { ArkUIGeneratedNativeModule._RichEditorAttribute_setMaxLines(this.peer.ptr, thisSerializer.asBuffer(), thisSerializer.length()) thisSerializer.release() } + setEnableAutoSpacingAttribute(value: boolean | undefined): void { + const thisSerializer : SerializerBase = SerializerBase.hold() + if (value !== undefined) { + thisSerializer.writeInt8(RuntimeType.OBJECT) + const valueTmpValue = value! + thisSerializer.writeBoolean(valueTmpValue) + } else { + thisSerializer.writeInt8(RuntimeType.UNDEFINED) + } + ArkUIGeneratedNativeModule._RichEditorAttribute_setEnableAutoSpacing(this.peer.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } setKeyboardAppearanceAttribute(value: KeyboardAppearance | undefined): void { const thisSerializer : SerializerBase = SerializerBase.hold() if (value !== undefined) { @@ -986,6 +1009,9 @@ export interface RichEditorAttribute extends CommonMethod { maxLines(value: number | undefined): this { throw new Error("Unimplemented method maxLines") } + enableAutoSpacing(value: boolean | undefined): this{ + throw new Error ("Unimplemented method enableAutoSpacing") + } keyboardAppearance(value: KeyboardAppearance | undefined): this { throw new Error("Unimplemented method keyboardAppearance") } @@ -1034,6 +1060,7 @@ export class ArkRichEditorStyle extends ArkCommonMethodStyle implements RichEdit barState_value?: BarState | undefined maxLength_value?: number | undefined maxLines_value?: number | undefined + enableAutoSpacing_value?: boolean | undefined keyboardAppearance_value?: KeyboardAppearance | undefined stopBackPress_value?: boolean | undefined attributeModifier_value?: AttributeModifier | AttributeModifier | undefined @@ -1124,6 +1151,9 @@ export class ArkRichEditorStyle extends ArkCommonMethodStyle implements RichEdit maxLines(value: number | undefined): this { return this } + enableAutoSpacingAttribute(value: boolean | undefined): this { + return this + } keyboardAppearance(value: KeyboardAppearance | undefined): this { return this } @@ -1397,6 +1427,14 @@ export class ArkRichEditorComponent extends ArkCommonMethodComponent implements } return this } + public enableAutoSpacing(value: boolean | undefined): this { + if (this.checkPriority("enableAutoSpacing")) { + const value_casted = value as (boolean | undefined) + this.getPeer()?.setEnableAutoSpacingAttribute(value_casted) + return this + } + return this + } public keyboardAppearance(value: KeyboardAppearance | undefined): this { if (this.checkPriority("keyboardAppearance")) { const value_casted = value as (KeyboardAppearance | undefined) diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/framework/native/src/generated/arkoala_api_generated.h b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/framework/native/src/generated/arkoala_api_generated.h index 90c520ec12ba454e4a5cc78417f671b6b1501f30..a650145897bb8e4c37393311a86517efc3ee26fa 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/framework/native/src/generated/arkoala_api_generated.h +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/framework/native/src/generated/arkoala_api_generated.h @@ -21184,6 +21184,9 @@ typedef struct GENERATED_ArkUIRichEditorModifier { const Opt_Number* value); void (*setMaxLines)(Ark_NativePointer node, const Opt_Number* value); + void (*setEnableAutoSpacing)(Ark_NativePointer node, + const Opt_Boolean* value); + void (*setKeyboardAppearance)(Ark_NativePointer node, const Opt_KeyboardAppearance* value); void (*setStopBackPress)(Ark_NativePointer node, @@ -24935,6 +24938,8 @@ typedef struct GENERATED_ArkUIRichEditorBaseControllerAccessor { Ark_RichEditorTextStyle (*getTypingStyle)(Ark_RichEditorBaseController peer); void (*setTypingStyle)(Ark_RichEditorBaseController peer, const Ark_RichEditorTextStyle* value); + void (*setTypingParagraphStyle)(Ark_RichEditorBaseController peer, + const Ark_RichEditorParagraphStyle* value); void (*setSelection)(Ark_RichEditorBaseController peer, const Ark_Number* selectionStart, const Ark_Number* selectionEnd, diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/framework/native/src/generated/bridge_generated.cc b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/framework/native/src/generated/bridge_generated.cc index c0dc1983adf1b80f87db62b41c4855878146d7c3..d5f76227089d24da00253c6f785940a4b35ecdfa 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/framework/native/src/generated/bridge_generated.cc +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/framework/native/src/generated/bridge_generated.cc @@ -13311,6 +13311,21 @@ void impl_RichEditorAttribute_setMaxLength(Ark_NativePointer thisPtr, KSerialize GetNodeModifiers()->getRichEditorModifier()->setMaxLength(self, static_cast(&valueValueTemp)); } KOALA_INTEROP_DIRECT_V3(RichEditorAttribute_setMaxLength, Ark_NativePointer, KSerializerBuffer, int32_t) +void impl_RichEditorAttribute_setEnableAutoSpacing(Ark_NativePointer thisPtr, KSerializerBuffer thisArray, int32_t thisLength) { + Ark_NodeHandle self = reinterpret_cast(thisPtr); + DeserializerBase thisDeserializer(thisArray, thisLength); + const auto valueValueTempTmpBuf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Boolean valueValueTempTmpBuf = {}; + valueValueTempTmpBuf.tag = valueValueTempTmpBuf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((valueValueTempTmpBuf_runtimeType) != (INTEROP_RUNTIME_UNDEFINED)) { + { + valueValueTempTmpBuf.value = thisDeserializer.readBoolean(); + } + Opt_Boolean valueValueTemp = valueValueTempTmpBuf;; + GetNodeModifiers()->getRichEditorModifier()->setEnableAutoSpacing(self, static_cast(&valueValueTemp)); + } +} +KOALA_INTEROP_DIRECT_V3(RichEditorAttribute_setEnableAutoSpacing, Ark_NativePointer, KSerializerBuffer, int32_t) void impl_RichEditorAttribute_setMaxLines(Ark_NativePointer thisPtr, KSerializerBuffer thisArray, int32_t thisLength) { Ark_NodeHandle self = reinterpret_cast(thisPtr); DeserializerBase thisDeserializer(thisArray, thisLength); @@ -33064,6 +33079,13 @@ void impl_RichEditorBaseController_setTypingStyle(Ark_NativePointer thisPtr, KSe GetAccessors()->getRichEditorBaseControllerAccessor()->setTypingStyle(self, static_cast(&valueValueTemp)); } KOALA_INTEROP_DIRECT_V3(RichEditorBaseController_setTypingStyle, Ark_NativePointer, KSerializerBuffer, int32_t) +void impl_RichEditorBaseController_setTypingParagraphStyle(Ark_NativePointer thisPtr, KSerializerBuffer thisArray, int32_t thisLength) { + Ark_RichEditorBaseController self = reinterpret_cast(thisPtr); + DeserializerBase thisDeserializer(thisArray, thisLength); + Ark_RichEditorParagraphStyle valueValueTemp = RichEditorParagraphStyle_serializer::read(thisDeserializer);; + GetAccessors()->getRichEditorBaseControllerAccessor()->setTypingParagraphStyle(self, static_cast(&valueValueTemp)); +} +KOALA_INTEROP_DIRECT_V3(RichEditorBaseController_setTypingParagraphStyle, Ark_NativePointer, KSerializerBuffer, int32_t) void impl_RichEditorBaseController_setSelection(Ark_NativePointer thisPtr, KInteropNumber selectionStart, KInteropNumber selectionEnd, KSerializerBuffer thisArray, int32_t thisLength) { Ark_RichEditorBaseController self = reinterpret_cast(thisPtr); DeserializerBase thisDeserializer(thisArray, thisLength); diff --git a/frameworks/core/components_ng/pattern/rich_editor/rich_editor_model_static.cpp b/frameworks/core/components_ng/pattern/rich_editor/rich_editor_model_static.cpp index 781aae6080d2ffbb160a253625825207d398f4fd..440e5d93bed7451b9502a73a9cf8c945f1146a3b 100644 --- a/frameworks/core/components_ng/pattern/rich_editor/rich_editor_model_static.cpp +++ b/frameworks/core/components_ng/pattern/rich_editor/rich_editor_model_static.cpp @@ -201,4 +201,12 @@ void RichEditorModelStatic::SetMaxLength(FrameNode* frameNode, std::optionalSetMaxLength(value); } + +void RichEditorModelStatic::SetEnableAutoSpacing(FrameNode* frameNode, bool enabled) +{ + CHECK_NULL_VOID(frameNode); + auto pattern = frameNode->GetPattern(); + CHECK_NULL_VOID(pattern); + pattern->SetEnableAutoSpacing(enabled); +} } // namespace OHOS::Ace::NG diff --git a/frameworks/core/components_ng/pattern/rich_editor/rich_editor_model_static.h b/frameworks/core/components_ng/pattern/rich_editor/rich_editor_model_static.h index 7e18a2113328e7e0f1ff8bb9342ce8cca1266dc1..262807a4135c7beee967eb9f2c219e20f4087569 100644 --- a/frameworks/core/components_ng/pattern/rich_editor/rich_editor_model_static.h +++ b/frameworks/core/components_ng/pattern/rich_editor/rich_editor_model_static.h @@ -42,6 +42,7 @@ public: std::function& buildFunc, SelectMenuParam& menuParam); static void SetMaxLength(FrameNode* frameNode, std::optional value); static void SetMaxLines(FrameNode* frameNode, uint32_t value); + static void SetEnableAutoSpacing(FrameNode* frameNode, bool enabled); void SetDraggable(bool draggable); static void SetSelectionMenuOptions(FrameNode* frameNode, const OnCreateMenuCallback&& onCreateMenuCallback, const OnMenuItemClickCallback&& onMenuItemClick); diff --git a/frameworks/core/interfaces/native/generated/interface/arkoala_api_generated.h b/frameworks/core/interfaces/native/generated/interface/arkoala_api_generated.h index 90c520ec12ba454e4a5cc78417f671b6b1501f30..2ddde3af5432eeb38801d9134187f4435ea049d0 100644 --- a/frameworks/core/interfaces/native/generated/interface/arkoala_api_generated.h +++ b/frameworks/core/interfaces/native/generated/interface/arkoala_api_generated.h @@ -21184,6 +21184,8 @@ typedef struct GENERATED_ArkUIRichEditorModifier { const Opt_Number* value); void (*setMaxLines)(Ark_NativePointer node, const Opt_Number* value); + void (*setEnableAutoSpacing)(Ark_NativePointer node, + const Opt_Boolean* value); void (*setKeyboardAppearance)(Ark_NativePointer node, const Opt_KeyboardAppearance* value); void (*setStopBackPress)(Ark_NativePointer node, @@ -24935,6 +24937,8 @@ typedef struct GENERATED_ArkUIRichEditorBaseControllerAccessor { Ark_RichEditorTextStyle (*getTypingStyle)(Ark_RichEditorBaseController peer); void (*setTypingStyle)(Ark_RichEditorBaseController peer, const Ark_RichEditorTextStyle* value); + void (*setTypingParagraphStyle)(Ark_RichEditorBaseController peer, + const Ark_RichEditorParagraphStyle* value); void (*setSelection)(Ark_RichEditorBaseController peer, const Ark_Number* selectionStart, const Ark_Number* selectionEnd, diff --git a/frameworks/core/interfaces/native/implementation/rich_editor_base_controller_accessor.cpp b/frameworks/core/interfaces/native/implementation/rich_editor_base_controller_accessor.cpp index f58bbec50ee6e79e790f1f7deacfa93d0d2333ae..ffe2df934d272aadaf53fa8b65eb3c38ea2c5e41 100644 --- a/frameworks/core/interfaces/native/implementation/rich_editor_base_controller_accessor.cpp +++ b/frameworks/core/interfaces/native/implementation/rich_editor_base_controller_accessor.cpp @@ -199,6 +199,14 @@ void SetTypingStyleImpl(Ark_RichEditorBaseController peer, auto typingStyle = Converter::OptConvert(*value); peer->SetTypingStyle(typingStyle, textStyle); } +void SetTypingParagraphStyleImpl(Ark_RichEditorBaseController peer, + const Ark_RichEditorParagraphStyle* value) +{ + // CHECK_NULL_VOID(peer); + // CHECK_NULL_VOID(value); + // auto typingParagraphStyle = Converter::OptConvert(*value); + // peer->SetTypingParagraphStyle(typingParagraphStyle); +} void SetSelectionImpl(Ark_RichEditorBaseController peer, const Ark_Number* selectionStart, const Ark_Number* selectionEnd, @@ -258,6 +266,7 @@ const GENERATED_ArkUIRichEditorBaseControllerAccessor* GetRichEditorBaseControll RichEditorBaseControllerAccessor::CloseSelectionMenuImpl, RichEditorBaseControllerAccessor::GetTypingStyleImpl, RichEditorBaseControllerAccessor::SetTypingStyleImpl, + RichEditorBaseControllerAccessor::SetTypingParagraphStyleImpl, RichEditorBaseControllerAccessor::SetSelectionImpl, RichEditorBaseControllerAccessor::IsEditingImpl, RichEditorBaseControllerAccessor::StopEditingImpl, diff --git a/frameworks/core/interfaces/native/implementation/rich_editor_base_controller_peer_impl.h b/frameworks/core/interfaces/native/implementation/rich_editor_base_controller_peer_impl.h index 993cc92c4ba26fbf00722cc0afd1c4f925c2a68f..ebcd726feaf2381984976d87176f3ee5068c6db0 100755 --- a/frameworks/core/interfaces/native/implementation/rich_editor_base_controller_peer_impl.h +++ b/frameworks/core/interfaces/native/implementation/rich_editor_base_controller_peer_impl.h @@ -82,6 +82,13 @@ public: } } + void SetTypingParagraphStyle(std::optional typingParagraphStyle) + { + if (auto controller = handler_.Upgrade(); controller) { + controller->SetTypingParagraphStyle(typingParagraphStyle); + } + } + void SetSelection(int32_t selectionStart, int32_t selectionEnd, const std::optional& options, bool isForward) override { diff --git a/frameworks/core/interfaces/native/implementation/rich_editor_modifier.cpp b/frameworks/core/interfaces/native/implementation/rich_editor_modifier.cpp index 8127c61a5d64a328955fb841300dd60c79c077f2..d1547ce0222033105520109d839cc15728a30388 100644 --- a/frameworks/core/interfaces/native/implementation/rich_editor_modifier.cpp +++ b/frameworks/core/interfaces/native/implementation/rich_editor_modifier.cpp @@ -656,6 +656,14 @@ void SetMaxLinesImpl(Ark_NativePointer node, Validator::ValidatePositive(convValue); RichEditorModelNG::SetMaxLines(frameNode, convValue.value_or(UINT_MAX)); } +void SetEnableAutoSpacingImpl(Ark_NativePointer node, + const Opt_Boolean* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + auto convValue = Converter::OptConvertPtr(value); + RichEditorModelNG::SetEnableAutoSpacing(frameNode, convValue.value_or(false)); +} void SetKeyboardAppearanceImpl(Ark_NativePointer node, const Opt_KeyboardAppearance* value) { @@ -768,6 +776,7 @@ const GENERATED_ArkUIRichEditorModifier* GetRichEditorModifier() RichEditorAttributeModifier::SetBarStateImpl, RichEditorAttributeModifier::SetMaxLengthImpl, RichEditorAttributeModifier::SetMaxLinesImpl, + RichEditorAttributeModifier::SetEnableAutoSpacingImpl, RichEditorAttributeModifier::SetKeyboardAppearanceImpl, RichEditorAttributeModifier::SetStopBackPressImpl, RichEditorAttributeModifier::SetBindSelectionMenuImpl,