diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUIGeneratedNativeModule.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUIGeneratedNativeModule.ts index 4bde52cc2d6e2fa6327a30bb7fcc8fb2f84e641f..78a8417cc58e6736ee721e4928eb748e50d02e69 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUIGeneratedNativeModule.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUIGeneratedNativeModule.ts @@ -4674,6 +4674,26 @@ export class ArkUIGeneratedNativeModule { @ani.unsafe.Direct native static _TextFieldOps_registerTextFieldValueCallback(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetWidth(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetHeight(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetPadding(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetMargin(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetBorder(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetBorderWidth(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetBorderColor(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetBorderStyle(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetBorderRadius(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct + native static _TextFieldOps_textFieldOpsSetBackgroundColor(node: KPointer, thisArray: KSerializerBuffer, thisLength: int32): KPointer + @ani.unsafe.Direct native static _ToggleOps_registerIsOnCallback(node: KPointer, isOn: KInt, thisArray: KSerializerBuffer, thisLength: int32): KPointer @ani.unsafe.Direct native static _ActionSheet_show(thisArray: KSerializerBuffer, thisLength: int32): undefined diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/textInput.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/textInput.ts index 00fc8c8c830ce14047756a43ba0d759026debc7e..4f7f2625b86a2320994fd55ba0e6f4274eba67f9 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/textInput.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/textInput.ts @@ -25,9 +25,9 @@ import { Deserializer } from "./peers/Deserializer" import { CallbackTransformer } from "./peers/CallbackTransformer" import { ComponentBase } from "./../ComponentBase" import { PeerNode } from "./../PeerNode" -import { ArkCommonMethodPeer, Bindable, CommonMethod, CustomBuilder, TextDecorationOptions, InputCounterOptions, ArkCommonMethodComponent, ArkCommonMethodStyle, TextContentControllerBase, TextContentControllerBaseInternal, SelectionOptions } from "./common" -import { ResourceColor, Dimension, Font, Length, ResourceStr, PX, VP, FP, LPX, Percentage } from "./units" -import { TextOverflow, FontStyle, FontWeight, CopyOptions, TextAlign, TextContentStyle, BarState, WordBreak, LineBreakStrategy, TextHeightAdaptivePolicy, EllipsisMode, Color } from "./enums" +import { LayoutPolicy, ArkCommonMethodPeer, Bindable, CommonMethod, CustomBuilder, TextDecorationOptions, InputCounterOptions, ArkCommonMethodComponent, ArkCommonMethodStyle, TextContentControllerBase, TextContentControllerBaseInternal, SelectionOptions } from "./common" +import { LocalizedBorderRadiuses, BorderRadiuses, LocalizedEdgeColors, EdgeColors, LocalizedEdgeWidths, EdgeWidths, EdgeStyles, BorderOptions, LocalizedPadding, Padding, ResourceColor, Dimension, Font, Length, ResourceStr, PX, VP, FP, LPX, Percentage } from "./units" +import { BorderStyle, TextOverflow, FontStyle, FontWeight, CopyOptions, TextAlign, TextContentStyle, BarState, WordBreak, LineBreakStrategy, TextHeightAdaptivePolicy, EllipsisMode, Color } from "./enums" import { Callback_Boolean_Void } from "./navigation" import { EditableTextOnChangeCallback, PreviewText, TextChangeOptions, CaretStyle, InsertValue, DeleteValue, EditMenuOptions, AutoCapitalizationMode, EditableTextChangeValue, KeyboardAppearance } from "./textCommon" import { Callback_String_Void } from "./gridRow" @@ -1754,6 +1754,87 @@ export class ArkTextInputComponent extends ArkCommonMethodComponent implements T } return false; } + public width(value: Length | undefined | Length | LayoutPolicy | undefined): this { + if (this.checkPriority("width")) { + const value_type = runtimeType(value) + if ((RuntimeType.NUMBER == value_type) || (RuntimeType.STRING == value_type) || (RuntimeType.OBJECT == value_type) || (RuntimeType.OBJECT == value_type) || (RuntimeType.UNDEFINED == value_type)) { + const value_casted = value as (Length | LayoutPolicy | undefined) + TextFieldOpsHandWritten.hookTextFieldSetWidth(this.getPeer().peer.ptr, + value_casted); + return this + } + throw new Error("Can not select appropriate overload") + } + return this + } + public height(value: Length | undefined | Length | LayoutPolicy | undefined): this { + if (this.checkPriority("height")) { + const value_type = runtimeType(value) + if ((RuntimeType.NUMBER == value_type) || (RuntimeType.STRING == value_type) || (RuntimeType.OBJECT == value_type) || (RuntimeType.OBJECT == value_type) || (RuntimeType.UNDEFINED == value_type)) { + const value_casted = value as (Length | LayoutPolicy | undefined) + TextFieldOpsHandWritten.hookTextFieldSetHeight(this.getPeer().peer.ptr, + value_casted); + return this + } + throw new Error("Can not select appropriate overload") + } + return this + } + public padding(value: Padding | Length | LocalizedPadding | undefined): this { + if (this.checkPriority("padding")) { + TextFieldOpsHandWritten.hookTextFieldSetPadding(this.getPeer().peer.ptr, value) + return this + } + return this + } + public margin(value: Padding | Length | LocalizedPadding | undefined): this { + if (this.checkPriority("margin")) { + TextFieldOpsHandWritten.hookTextFieldSetMargin(this.getPeer().peer.ptr, value) + return this + } + return this + } + public border(value: BorderOptions | undefined): this { + if (this.checkPriority("border")) { + TextFieldOpsHandWritten.hookTextFieldSetBorder(this.getPeer().peer.ptr, value) + return this + } + return this + } + public borderStyle(value: BorderStyle | EdgeStyles | undefined): this { + if (this.checkPriority("borderStyle")) { + TextFieldOpsHandWritten.hookTextFieldSetBorderStyle(this.getPeer().peer.ptr, value) + return this + } + return this + } + public borderWidth(value: Length | EdgeWidths | LocalizedEdgeWidths | undefined): this { + if (this.checkPriority("borderWidth")) { + TextFieldOpsHandWritten.hookTextFieldSetBorderWidth(this.getPeer().peer.ptr, value) + return this + } + return this + } + public borderColor(value: ResourceColor | EdgeColors | LocalizedEdgeColors | undefined): this { + if (this.checkPriority("borderColor")) { + TextFieldOpsHandWritten.hookTextFieldSetBorderColor(this.getPeer().peer.ptr, value) + return this + } + return this + } + public borderRadius(value: Length | BorderRadiuses | LocalizedBorderRadiuses | undefined): this { + if (this.checkPriority("borderRadius")) { + TextFieldOpsHandWritten.hookTextFieldSetBorderRadius(this.getPeer().peer.ptr, value) + return this + } + return this + } + public backgroundColor(value: ResourceColor | undefined): this { + if (this.checkPriority("backgroundColor")) { + TextFieldOpsHandWritten.hookTextFieldSetBackgroundColor(this.getPeer().peer.ptr, value) + } + return this + } public setTextInputOptions(value?: TextInputOptions): this { if (this.checkPriority("setTextInputOptions")) { const value_casted = value as (TextInputOptions | undefined) diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/textfieldops.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/textfieldops.ts index 84defb66699034a0a6cfb3bf459779380ff02ac9..24088cf1c8ed016165d9888d969b486c45983d73 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/textfieldops.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/textfieldops.ts @@ -16,7 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! -import { ResourceStr } from "./units" +import { ResourceStr, Length, Padding, LocalizedPadding, BorderOptions, EdgeWidths, LocalizedEdgeWidths, ResourceColor, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, EdgeStyles } from "./units" +import { LayoutPolicy } from "./common" +import { BorderStyle, Color } from "./enums" import { Resource } from "global.resource" import { TypeChecker, ArkUIGeneratedNativeModule } from "#components" import { Finalizable, runtimeType, RuntimeType, SerializerBase, registerCallback, wrapCallback, toPeerPtr, KPointer, MaterializedBase, NativeBuffer, KInt, KBoolean, KStringPtr } from "@koalaui/interop" @@ -33,6 +35,56 @@ export class TextFieldOps { const callback_casted = callback as (TextFieldValueCallback) return TextFieldOps.registerTextFieldValueCallback_serialize(node_casted, value_casted, callback_casted) } + public static textFieldOpsSetWidth(node: KPointer, value?: Length | LayoutPolicy): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (Length | LayoutPolicy | undefined) + return TextFieldOps.textFieldOpsSetWidth_serialize(node_casted, value_casted) + } + public static textFieldOpsSetHeight(node: KPointer, value?: Length | LayoutPolicy): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (Length | LayoutPolicy | undefined) + return TextFieldOps.textFieldOpsSetHeight_serialize(node_casted, value_casted) + } + public static textFieldOpsSetPadding(node: KPointer, value?: Padding | Length | LocalizedPadding): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (Padding | Length | LocalizedPadding | undefined) + return TextFieldOps.textFieldOpsSetPadding_serialize(node_casted, value_casted) + } + public static textFieldOpsSetMargin(node: KPointer, value?: Padding | Length | LocalizedPadding): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (Padding | Length | LocalizedPadding | undefined) + return TextFieldOps.textFieldOpsSetMargin_serialize(node_casted, value_casted) + } + public static textFieldOpsSetBorder(node: KPointer, value?: BorderOptions): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (BorderOptions | undefined) + return TextFieldOps.textFieldOpsSetBorder_serialize(node_casted, value_casted) + } + public static textFieldOpsSetBorderWidth(node: KPointer, value?: Length | EdgeWidths | LocalizedEdgeWidths): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (Length | EdgeWidths | LocalizedEdgeWidths | undefined) + return TextFieldOps.textFieldOpsSetBorderWidth_serialize(node_casted, value_casted) + } + public static textFieldOpsSetBorderColor(node: KPointer, value?: ResourceColor | EdgeColors | LocalizedEdgeColors): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (ResourceColor | EdgeColors | LocalizedEdgeColors | undefined) + return TextFieldOps.textFieldOpsSetBorderColor_serialize(node_casted, value_casted) + } + public static textFieldOpsSetBorderStyle(node: KPointer, value?: BorderStyle | EdgeStyles): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (BorderStyle | EdgeStyles | undefined) + return TextFieldOps.textFieldOpsSetBorderStyle_serialize(node_casted, value_casted) + } + public static textFieldOpsSetBorderRadius(node: KPointer, value?: Length | BorderRadiuses | LocalizedBorderRadiuses): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (Length | BorderRadiuses | LocalizedBorderRadiuses | undefined) + return TextFieldOps.textFieldOpsSetBorderRadius_serialize(node_casted, value_casted) + } + public static textFieldOpsSetBackgroundColor(node: KPointer, value?: ResourceColor): KPointer { + const node_casted = node as (KPointer) + const value_casted = value as (ResourceColor | undefined) + return TextFieldOps.textFieldOpsSetBackgroundColor_serialize(node_casted, value_casted) + } private static registerTextFieldValueCallback_serialize(node: KPointer, value: ResourceStr, callback: TextFieldValueCallback): KPointer { const thisSerializer : Serializer = Serializer.hold() let value_type : int32 = RuntimeType.UNDEFINED @@ -52,5 +104,352 @@ export class TextFieldOps { thisSerializer.release() return retval } + private static textFieldOpsSetWidth_serialize(node: KPointer, value?: Length | LayoutPolicy): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + let value_value_type : int32 = RuntimeType.UNDEFINED + value_value_type = runtimeType(value_value) + if (((RuntimeType.NUMBER) == (value_value_type)) || ((RuntimeType.STRING) == (value_value_type)) || (((RuntimeType.OBJECT) == (value_value_type)) && (TypeChecker.isResource(value_value, false, false, false, false, false)))) { + thisSerializer.writeInt8(0 as int32) + const value_value_0 = value_value as Length + thisSerializer.writeLength(value_value_0) + } + else if (((RuntimeType.OBJECT) == (value_value_type)) && (TypeChecker.isLayoutPolicy(value_value))) { + thisSerializer.writeInt8(1 as int32) + const value_value_1 = value_value as LayoutPolicy + thisSerializer.writeLayoutPolicy(value_value_1) + } + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetWidth(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } + private static textFieldOpsSetHeight_serialize(node: KPointer, value?: Length | LayoutPolicy): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + let value_value_type : int32 = RuntimeType.UNDEFINED + value_value_type = runtimeType(value_value) + if (((RuntimeType.NUMBER) == (value_value_type)) || ((RuntimeType.STRING) == (value_value_type)) || (((RuntimeType.OBJECT) == (value_value_type)) && (TypeChecker.isResource(value_value, false, false, false, false, false)))) { + thisSerializer.writeInt8(0 as int32) + const value_value_0 = value_value as Length + thisSerializer.writeLength(value_value_0) + } + else if (((RuntimeType.OBJECT) == (value_value_type)) && (TypeChecker.isLayoutPolicy(value_value))) { + thisSerializer.writeInt8(1 as int32) + const value_value_1 = value_value as LayoutPolicy + thisSerializer.writeLayoutPolicy(value_value_1) + } + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetHeight(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } + private static textFieldOpsSetPadding_serialize(node: KPointer, value?: Padding | Length | LocalizedPadding): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + let value_value_type : int32 = RuntimeType.UNDEFINED + value_value_type = runtimeType(value_value) + if (TypeChecker.isPadding(value_value, false, false, false, false)) { + thisSerializer.writeInt8(0 as int32) + const value_value_0 = value_value as Padding + const value_value_0_top = value_value_0.top + let value_value_0_top_type : int32 = RuntimeType.UNDEFINED + value_value_0_top_type = runtimeType(value_value_0_top) + thisSerializer.writeInt8(value_value_0_top_type as int32) + if ((RuntimeType.UNDEFINED) != (value_value_0_top_type)) { + const value_value_0_top_value = value_value_0_top! + thisSerializer.writeLength(value_value_0_top_value) + } + const value_value_0_right = value_value_0.right + let value_value_0_right_type : int32 = RuntimeType.UNDEFINED + value_value_0_right_type = runtimeType(value_value_0_right) + thisSerializer.writeInt8(value_value_0_right_type as int32) + if ((RuntimeType.UNDEFINED) != (value_value_0_right_type)) { + const value_value_0_right_value = value_value_0_right! + thisSerializer.writeLength(value_value_0_right_value) + } + const value_value_0_bottom = value_value_0.bottom + let value_value_0_bottom_type : int32 = RuntimeType.UNDEFINED + value_value_0_bottom_type = runtimeType(value_value_0_bottom) + thisSerializer.writeInt8(value_value_0_bottom_type as int32) + if ((RuntimeType.UNDEFINED) != (value_value_0_bottom_type)) { + const value_value_0_bottom_value = value_value_0_bottom! + thisSerializer.writeLength(value_value_0_bottom_value) + } + const value_value_0_left = value_value_0.left + let value_value_0_left_type : int32 = RuntimeType.UNDEFINED + value_value_0_left_type = runtimeType(value_value_0_left) + thisSerializer.writeInt8(value_value_0_left_type as int32) + if ((RuntimeType.UNDEFINED) != (value_value_0_left_type)) { + const value_value_0_left_value = value_value_0_left! + thisSerializer.writeLength(value_value_0_left_value) + } + } + else if (((RuntimeType.NUMBER) == (value_value_type)) || ((RuntimeType.STRING) == (value_value_type)) || (((RuntimeType.OBJECT) == (value_value_type)) && (TypeChecker.isResource(value_value, false, false, false, false, false)))) { + thisSerializer.writeInt8(1 as int32) + const value_value_1 = value_value as Length + thisSerializer.writeLength(value_value_1) + } + else if (TypeChecker.isLocalizedPadding(value_value, true, false, true, false)) { + thisSerializer.writeInt8(2 as int32) + const value_value_2 = value_value as LocalizedPadding + thisSerializer.writeLocalizedPadding(value_value_2) + } + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetPadding(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } + private static textFieldOpsSetMargin_serialize(node: KPointer, value?: Padding | Length | LocalizedPadding): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + let value_value_type : int32 = RuntimeType.UNDEFINED + value_value_type = runtimeType(value_value) + if (TypeChecker.isPadding(value_value, false, false, false, false)) { + thisSerializer.writeInt8(0 as int32) + const value_value_0 = value_value as Padding + const value_value_0_top = value_value_0.top + let value_value_0_top_type : int32 = RuntimeType.UNDEFINED + value_value_0_top_type = runtimeType(value_value_0_top) + thisSerializer.writeInt8(value_value_0_top_type as int32) + if ((RuntimeType.UNDEFINED) != (value_value_0_top_type)) { + const value_value_0_top_value = value_value_0_top! + thisSerializer.writeLength(value_value_0_top_value) + } + const value_value_0_right = value_value_0.right + let value_value_0_right_type : int32 = RuntimeType.UNDEFINED + value_value_0_right_type = runtimeType(value_value_0_right) + thisSerializer.writeInt8(value_value_0_right_type as int32) + if ((RuntimeType.UNDEFINED) != (value_value_0_right_type)) { + const value_value_0_right_value = value_value_0_right! + thisSerializer.writeLength(value_value_0_right_value) + } + const value_value_0_bottom = value_value_0.bottom + let value_value_0_bottom_type : int32 = RuntimeType.UNDEFINED + value_value_0_bottom_type = runtimeType(value_value_0_bottom) + thisSerializer.writeInt8(value_value_0_bottom_type as int32) + if ((RuntimeType.UNDEFINED) != (value_value_0_bottom_type)) { + const value_value_0_bottom_value = value_value_0_bottom! + thisSerializer.writeLength(value_value_0_bottom_value) + } + const value_value_0_left = value_value_0.left + let value_value_0_left_type : int32 = RuntimeType.UNDEFINED + value_value_0_left_type = runtimeType(value_value_0_left) + thisSerializer.writeInt8(value_value_0_left_type as int32) + if ((RuntimeType.UNDEFINED) != (value_value_0_left_type)) { + const value_value_0_left_value = value_value_0_left! + thisSerializer.writeLength(value_value_0_left_value) + } + } + else if (((RuntimeType.NUMBER) == (value_value_type)) || ((RuntimeType.STRING) == (value_value_type)) || (((RuntimeType.OBJECT) == (value_value_type)) && (TypeChecker.isResource(value_value, false, false, false, false, false)))) { + thisSerializer.writeInt8(1 as int32) + const value_value_1 = value_value as Length + thisSerializer.writeLength(value_value_1) + } + else if (TypeChecker.isLocalizedPadding(value_value, true, false, true, false)) { + thisSerializer.writeInt8(2 as int32) + const value_value_2 = value_value as LocalizedPadding + thisSerializer.writeLocalizedPadding(value_value_2) + } + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetMargin(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } + private static textFieldOpsSetBorder_serialize(node: KPointer, value?: BorderOptions): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + thisSerializer.writeBorderOptions(value_value) + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetBorder(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } + private static textFieldOpsSetBorderWidth_serialize(node: KPointer, value?: Length | EdgeWidths | LocalizedEdgeWidths): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + let value_value_type : int32 = RuntimeType.UNDEFINED + value_value_type = runtimeType(value_value) + if (((RuntimeType.NUMBER) == (value_value_type)) || ((RuntimeType.STRING) == (value_value_type)) || (((RuntimeType.OBJECT) == (value_value_type)) && (TypeChecker.isResource(value_value, false, false, false, false, false)))) { + thisSerializer.writeInt8(0 as int32) + const value_value_0 = value_value as Length + thisSerializer.writeLength(value_value_0) + } + else if (TypeChecker.isEdgeWidths(value_value, true, false, true, false)) { + thisSerializer.writeInt8(1 as int32) + const value_value_1 = value_value as EdgeWidths + thisSerializer.writeEdgeWidths(value_value_1) + } + else if (TypeChecker.isLocalizedEdgeWidths(value_value, true, false, true, false)) { + thisSerializer.writeInt8(2 as int32) + const value_value_2 = value_value as LocalizedEdgeWidths + thisSerializer.writeLocalizedEdgeWidths(value_value_2) + } + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetBorderWidth(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } + private static textFieldOpsSetBorderColor_serialize(node: KPointer, value?: ResourceColor | EdgeColors | LocalizedEdgeColors): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + let value_value_type : int32 = RuntimeType.UNDEFINED + value_value_type = runtimeType(value_value) + if ((TypeChecker.isColor(value_value)) || (RuntimeType.NUMBER == value_value_type) || (RuntimeType.STRING == value_value_type) || (RuntimeType.OBJECT == value_value_type)) { + thisSerializer.writeInt8(0 as int32) + const value_value_0 = value_value as ResourceColor + let value_value_0_type : int32 = RuntimeType.UNDEFINED + value_value_0_type = runtimeType(value_value_0) + if (TypeChecker.isColor(value_value_0)) { + thisSerializer.writeInt8(0 as int32) + const value_value_0_0 = value_value_0 as Color + thisSerializer.writeInt32(TypeChecker.Color_ToNumeric(value_value_0_0)) + } + else if (RuntimeType.NUMBER == value_value_0_type) { + thisSerializer.writeInt8(1 as int32) + const value_value_0_1 = value_value_0 as number + thisSerializer.writeNumber(value_value_0_1) + } + else if (RuntimeType.STRING == value_value_0_type) { + thisSerializer.writeInt8(2 as int32) + const value_value_0_2 = value_value_0 as string + thisSerializer.writeString(value_value_0_2) + } + else if (RuntimeType.OBJECT == value_value_0_type) { + thisSerializer.writeInt8(3 as int32) + const value_value_0_3 = value_value_0 as Resource + thisSerializer.writeResource(value_value_0_3) + } + } + else if (TypeChecker.isEdgeColors(value_value, true, false, true, false)) { + thisSerializer.writeInt8(1 as int32) + const value_value_1 = value_value as EdgeColors + thisSerializer.writeEdgeColors(value_value_1) + } + else if (TypeChecker.isLocalizedEdgeColors(value_value, true, false, true, false)) { + thisSerializer.writeInt8(2 as int32) + const value_value_2 = value_value as LocalizedEdgeColors + thisSerializer.writeLocalizedEdgeColors(value_value_2) + } + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetBorderColor(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } + private static textFieldOpsSetBorderStyle_serialize(node: KPointer, value?: BorderStyle | EdgeStyles): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + let value_value_type : int32 = RuntimeType.UNDEFINED + value_value_type = runtimeType(value_value) + if (TypeChecker.isBorderStyle(value_value)) { + thisSerializer.writeInt8(0 as int32) + const value_value_0 = value_value as BorderStyle + thisSerializer.writeInt32(TypeChecker.BorderStyle_ToNumeric(value_value_0)) + } + else if (RuntimeType.OBJECT == value_value_type) { + thisSerializer.writeInt8(1 as int32) + const value_value_1 = value_value as EdgeStyles + thisSerializer.writeEdgeStyles(value_value_1) + } + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetBorderStyle(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } + private static textFieldOpsSetBorderRadius_serialize(node: KPointer, value?: Length | BorderRadiuses | LocalizedBorderRadiuses): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + let value_value_type : int32 = RuntimeType.UNDEFINED + value_value_type = runtimeType(value_value) + if (((RuntimeType.NUMBER) == (value_value_type)) || ((RuntimeType.STRING) == (value_value_type)) || (((RuntimeType.OBJECT) == (value_value_type)) && (TypeChecker.isResource(value_value, false, false, false, false, false)))) { + thisSerializer.writeInt8(0 as int32) + const value_value_0 = value_value as Length + thisSerializer.writeLength(value_value_0) + } + else if (TypeChecker.isBorderRadiuses(value_value, false, false, false, false)) { + thisSerializer.writeInt8(1 as int32) + const value_value_1 = value_value as BorderRadiuses + thisSerializer.writeBorderRadiuses(value_value_1) + } + else if (TypeChecker.isLocalizedBorderRadiuses(value_value, false, false, false, false)) { + thisSerializer.writeInt8(2 as int32) + const value_value_2 = value_value as LocalizedBorderRadiuses + thisSerializer.writeLocalizedBorderRadiuses(value_value_2) + } + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetBorderRadius(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } + private static textFieldOpsSetBackgroundColor_serialize(node: KPointer, value?: ResourceColor): KPointer { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + thisSerializer.writeInt8(value_type as int32) + if ((RuntimeType.UNDEFINED) != (value_type)) { + const value_value = value! + let value_value_type : int32 = RuntimeType.UNDEFINED + value_value_type = runtimeType(value_value) + if (TypeChecker.isColor(value_value)) { + thisSerializer.writeInt8(0 as int32) + const value_value_0 = value_value as Color + thisSerializer.writeInt32(TypeChecker.Color_ToNumeric(value_value_0)) + } + else if (RuntimeType.NUMBER == value_value_type) { + thisSerializer.writeInt8(1 as int32) + const value_value_1 = value_value as number + thisSerializer.writeNumber(value_value_1) + } + else if (RuntimeType.STRING == value_value_type) { + thisSerializer.writeInt8(2 as int32) + const value_value_2 = value_value as string + thisSerializer.writeString(value_value_2) + } + else if (RuntimeType.OBJECT == value_value_type) { + thisSerializer.writeInt8(3 as int32) + const value_value_3 = value_value as Resource + thisSerializer.writeResource(value_value_3) + } + } + const retval = ArkUIGeneratedNativeModule._TextFieldOps_textFieldOpsSetBackgroundColor(node, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + return retval + } } export type TextFieldValueCallback = (value: ResourceStr) => void; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/TextFieldOpsHandWritten.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/TextFieldOpsHandWritten.ts index a18a9b1890f2f8deebe8a329c40afa2b0da57218..9fae01e1df8a5e4dc7ad16156fe39b3d34da4998 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/TextFieldOpsHandWritten.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/TextFieldOpsHandWritten.ts @@ -14,7 +14,7 @@ */ import { KPointer } from "@koalaui/interop" -import { TextFieldOps, Bindable, ResourceStr } from "../component" +import { TextFieldOps, Bindable, ResourceStr, Length, LayoutPolicy, BorderRadiuses, LocalizedBorderRadiuses, EdgeStyles, BorderStyle, ResourceColor, EdgeColors, LocalizedEdgeColors, LocalizedEdgeWidths, EdgeWidths, BorderOptions, Padding, LocalizedPadding } from "../component" export class TextFieldOpsHandWritten { static hookTextFieldInputValueImpl(node: KPointer, value: Bindable) { @@ -22,4 +22,44 @@ export class TextFieldOpsHandWritten { value.onChange(v) }) } + + static hookTextFieldSetWidth(node: KPointer, value?: Length | LayoutPolicy) { + TextFieldOps.textFieldOpsSetWidth(node, value) + } + + static hookTextFieldSetHeight(node: KPointer, value?: Length | LayoutPolicy) { + TextFieldOps.textFieldOpsSetHeight(node, value) + } + + static hookTextFieldSetPadding(node: KPointer, value?: Padding | Length | LocalizedPadding) { + TextFieldOps.textFieldOpsSetPadding(node, value) + } + + static hookTextFieldSetMargin(node: KPointer, value?: Padding | Length | LocalizedPadding) { + TextFieldOps.textFieldOpsSetMargin(node, value) + } + + static hookTextFieldSetBorder(node: KPointer, value?: BorderOptions) { + TextFieldOps.textFieldOpsSetBorder(node, value) + } + + static hookTextFieldSetBorderWidth(node: KPointer, value?: Length | EdgeWidths | LocalizedEdgeWidths) { + TextFieldOps.textFieldOpsSetBorderWidth(node, value) + } + + static hookTextFieldSetBorderColor(node: KPointer, value?: ResourceColor | EdgeColors | LocalizedEdgeColors) { + TextFieldOps.textFieldOpsSetBorderColor(node, value) + } + + static hookTextFieldSetBorderStyle(node: KPointer, value?: BorderStyle | EdgeStyles) { + TextFieldOps.textFieldOpsSetBorderStyle(node, value) + } + + static hookTextFieldSetBorderRadius(node: KPointer, value?: Length | BorderRadiuses | LocalizedBorderRadiuses) { + TextFieldOps.textFieldOpsSetBorderRadius(node, value) + } + + static hookTextFieldSetBackgroundColor(node: KPointer, value?: ResourceColor) { + TextFieldOps.textFieldOpsSetBackgroundColor(node, value) + } } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/arkoala_api_generated.h b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/arkoala_api_generated.h index 81fea370cbf6798ecc46f0c28356684901d88262..bf6aadf6032e4102edddaab6aef8c6a55a075ce7 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/arkoala_api_generated.h +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/arkoala_api_generated.h @@ -24776,6 +24776,26 @@ typedef struct GENERATED_ArkUITextFieldOpsAccessor { Ark_NativePointer (*registerTextFieldValueCallback)(Ark_NativePointer node, const Ark_ResourceStr* value, const TextFieldValueCallback* callback); + Ark_NativePointer (*textFieldOpsSetWidth)(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value); + Ark_NativePointer (*textFieldOpsSetHeight)(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value); + Ark_NativePointer (*textFieldOpsSetPadding)(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value); + Ark_NativePointer (*textFieldOpsSetMargin)(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value); + Ark_NativePointer (*textFieldOpsSetBorder)(Ark_NativePointer node, + const Opt_BorderOptions* value); + Ark_NativePointer (*textFieldOpsSetBorderWidth)(Ark_NativePointer node, + const Opt_Union_Length_EdgeWidths_LocalizedEdgeWidths* value); + Ark_NativePointer (*textFieldOpsSetBorderColor)(Ark_NativePointer node, + const Opt_Union_ResourceColor_EdgeColors_LocalizedEdgeColors* value); + Ark_NativePointer (*textFieldOpsSetBorderStyle)(Ark_NativePointer node, + const Opt_Union_BorderStyle_EdgeStyles* value); + Ark_NativePointer (*textFieldOpsSetBorderRadius)(Ark_NativePointer node, + const Opt_Union_Length_BorderRadiuses_LocalizedBorderRadiuses* value); + Ark_NativePointer (*textFieldOpsSetBackgroundColor)(Ark_NativePointer node, + const Opt_ResourceColor* value); } GENERATED_ArkUITextFieldOpsAccessor; typedef struct GENERATED_ArkUIActionSheetAccessor { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/bridge_generated.cc b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/bridge_generated.cc index 2edfa8022fcebbad96b94d0ded9882d0f07b74be..a7dcb1e9f192845e06e657bf14bb2f327589fb6a 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/bridge_generated.cc +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/bridge_generated.cc @@ -35495,6 +35495,378 @@ Ark_NativePointer impl_TextFieldOps_registerTextFieldValueCallback(Ark_NativePoi return GetAccessors()->getTextFieldOpsAccessor()->registerTextFieldValueCallback(node, (const Ark_ResourceStr*)&value_value, (const TextFieldValueCallback*)&callback_value); } KOALA_INTEROP_DIRECT_3(TextFieldOps_registerTextFieldValueCallback, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetWidth(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Union_Length_LayoutPolicy value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + const Ark_Int8 value_value_buf__selector = thisDeserializer.readInt8(); + Ark_Union_Length_LayoutPolicy value_value_buf_ = {}; + value_value_buf_.selector = value_value_buf__selector; + if (value_value_buf__selector == 0) { + value_value_buf_.selector = 0; + value_value_buf_.value0 = thisDeserializer.readLength(); + } + else if (value_value_buf__selector == 1) { + value_value_buf_.selector = 1; + value_value_buf_.value1 = thisDeserializer.readLayoutPolicy(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf_ has to be chosen through deserialisation."); + } + value_value_buf.value = static_cast(value_value_buf_); + } + Opt_Union_Length_LayoutPolicy value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetWidth(node, (const Opt_Union_Length_LayoutPolicy*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetWidth, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetHeight(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Union_Length_LayoutPolicy value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + const Ark_Int8 value_value_buf__selector = thisDeserializer.readInt8(); + Ark_Union_Length_LayoutPolicy value_value_buf_ = {}; + value_value_buf_.selector = value_value_buf__selector; + if (value_value_buf__selector == 0) { + value_value_buf_.selector = 0; + value_value_buf_.value0 = thisDeserializer.readLength(); + } + else if (value_value_buf__selector == 1) { + value_value_buf_.selector = 1; + value_value_buf_.value1 = thisDeserializer.readLayoutPolicy(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf_ has to be chosen through deserialisation."); + } + value_value_buf.value = static_cast(value_value_buf_); + } + Opt_Union_Length_LayoutPolicy value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetHeight(node, (const Opt_Union_Length_LayoutPolicy*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetHeight, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetPadding(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Union_Padding_Length_LocalizedPadding value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + const Ark_Int8 value_value_buf__selector = thisDeserializer.readInt8(); + Ark_Union_Padding_Length_LocalizedPadding value_value_buf_ = {}; + value_value_buf_.selector = value_value_buf__selector; + if (value_value_buf__selector == 0) { + value_value_buf_.selector = 0; + Ark_Padding value_value_buf__u = {}; + const auto value_value_buf__u_top_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Length value_value_buf__u_top_buf = {}; + value_value_buf__u_top_buf.tag = value_value_buf__u_top_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf__u_top_buf_runtimeType)) + { + value_value_buf__u_top_buf.value = thisDeserializer.readLength(); + } + value_value_buf__u.top = value_value_buf__u_top_buf; + const auto value_value_buf__u_right_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Length value_value_buf__u_right_buf = {}; + value_value_buf__u_right_buf.tag = value_value_buf__u_right_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf__u_right_buf_runtimeType)) + { + value_value_buf__u_right_buf.value = thisDeserializer.readLength(); + } + value_value_buf__u.right = value_value_buf__u_right_buf; + const auto value_value_buf__u_bottom_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Length value_value_buf__u_bottom_buf = {}; + value_value_buf__u_bottom_buf.tag = value_value_buf__u_bottom_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf__u_bottom_buf_runtimeType)) + { + value_value_buf__u_bottom_buf.value = thisDeserializer.readLength(); + } + value_value_buf__u.bottom = value_value_buf__u_bottom_buf; + const auto value_value_buf__u_left_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Length value_value_buf__u_left_buf = {}; + value_value_buf__u_left_buf.tag = value_value_buf__u_left_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf__u_left_buf_runtimeType)) + { + value_value_buf__u_left_buf.value = thisDeserializer.readLength(); + } + value_value_buf__u.left = value_value_buf__u_left_buf; + value_value_buf_.value0 = value_value_buf__u; + } + else if (value_value_buf__selector == 1) { + value_value_buf_.selector = 1; + value_value_buf_.value1 = thisDeserializer.readLength(); + } + else if (value_value_buf__selector == 2) { + value_value_buf_.selector = 2; + value_value_buf_.value2 = thisDeserializer.readLocalizedPadding(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf_ has to be chosen through deserialisation."); + } + value_value_buf.value = static_cast(value_value_buf_); + } + Opt_Union_Padding_Length_LocalizedPadding value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetPadding(node, (const Opt_Union_Padding_Length_LocalizedPadding*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetPadding, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetMargin(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Union_Padding_Length_LocalizedPadding value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + const Ark_Int8 value_value_buf__selector = thisDeserializer.readInt8(); + Ark_Union_Padding_Length_LocalizedPadding value_value_buf_ = {}; + value_value_buf_.selector = value_value_buf__selector; + if (value_value_buf__selector == 0) { + value_value_buf_.selector = 0; + Ark_Padding value_value_buf__u = {}; + const auto value_value_buf__u_top_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Length value_value_buf__u_top_buf = {}; + value_value_buf__u_top_buf.tag = value_value_buf__u_top_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf__u_top_buf_runtimeType)) + { + value_value_buf__u_top_buf.value = thisDeserializer.readLength(); + } + value_value_buf__u.top = value_value_buf__u_top_buf; + const auto value_value_buf__u_right_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Length value_value_buf__u_right_buf = {}; + value_value_buf__u_right_buf.tag = value_value_buf__u_right_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf__u_right_buf_runtimeType)) + { + value_value_buf__u_right_buf.value = thisDeserializer.readLength(); + } + value_value_buf__u.right = value_value_buf__u_right_buf; + const auto value_value_buf__u_bottom_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Length value_value_buf__u_bottom_buf = {}; + value_value_buf__u_bottom_buf.tag = value_value_buf__u_bottom_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf__u_bottom_buf_runtimeType)) + { + value_value_buf__u_bottom_buf.value = thisDeserializer.readLength(); + } + value_value_buf__u.bottom = value_value_buf__u_bottom_buf; + const auto value_value_buf__u_left_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Length value_value_buf__u_left_buf = {}; + value_value_buf__u_left_buf.tag = value_value_buf__u_left_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf__u_left_buf_runtimeType)) + { + value_value_buf__u_left_buf.value = thisDeserializer.readLength(); + } + value_value_buf__u.left = value_value_buf__u_left_buf; + value_value_buf_.value0 = value_value_buf__u; + } + else if (value_value_buf__selector == 1) { + value_value_buf_.selector = 1; + value_value_buf_.value1 = thisDeserializer.readLength(); + } + else if (value_value_buf__selector == 2) { + value_value_buf_.selector = 2; + value_value_buf_.value2 = thisDeserializer.readLocalizedPadding(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf_ has to be chosen through deserialisation."); + } + value_value_buf.value = static_cast(value_value_buf_); + } + Opt_Union_Padding_Length_LocalizedPadding value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetMargin(node, (const Opt_Union_Padding_Length_LocalizedPadding*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetMargin, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetBorder(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_BorderOptions value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + value_value_buf.value = thisDeserializer.readBorderOptions(); + } + Opt_BorderOptions value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetBorder(node, (const Opt_BorderOptions*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetBorder, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetBorderWidth(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Union_Length_EdgeWidths_LocalizedEdgeWidths value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + const Ark_Int8 value_value_buf__selector = thisDeserializer.readInt8(); + Ark_Union_Length_EdgeWidths_LocalizedEdgeWidths value_value_buf_ = {}; + value_value_buf_.selector = value_value_buf__selector; + if (value_value_buf__selector == 0) { + value_value_buf_.selector = 0; + value_value_buf_.value0 = thisDeserializer.readLength(); + } + else if (value_value_buf__selector == 1) { + value_value_buf_.selector = 1; + value_value_buf_.value1 = thisDeserializer.readEdgeWidths(); + } + else if (value_value_buf__selector == 2) { + value_value_buf_.selector = 2; + value_value_buf_.value2 = thisDeserializer.readLocalizedEdgeWidths(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf_ has to be chosen through deserialisation."); + } + value_value_buf.value = static_cast(value_value_buf_); + } + Opt_Union_Length_EdgeWidths_LocalizedEdgeWidths value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetBorderWidth(node, (const Opt_Union_Length_EdgeWidths_LocalizedEdgeWidths*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetBorderWidth, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetBorderColor(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Union_ResourceColor_EdgeColors_LocalizedEdgeColors value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + const Ark_Int8 value_value_buf__selector = thisDeserializer.readInt8(); + Ark_Union_ResourceColor_EdgeColors_LocalizedEdgeColors value_value_buf_ = {}; + value_value_buf_.selector = value_value_buf__selector; + if (value_value_buf__selector == 0) { + value_value_buf_.selector = 0; + const Ark_Int8 value_value_buf__u_selector = thisDeserializer.readInt8(); + Ark_ResourceColor value_value_buf__u = {}; + value_value_buf__u.selector = value_value_buf__u_selector; + if (value_value_buf__u_selector == 0) { + value_value_buf__u.selector = 0; + value_value_buf__u.value0 = static_cast(thisDeserializer.readInt32()); + } + else if (value_value_buf__u_selector == 1) { + value_value_buf__u.selector = 1; + value_value_buf__u.value1 = static_cast(thisDeserializer.readNumber()); + } + else if (value_value_buf__u_selector == 2) { + value_value_buf__u.selector = 2; + value_value_buf__u.value2 = static_cast(thisDeserializer.readString()); + } + else if (value_value_buf__u_selector == 3) { + value_value_buf__u.selector = 3; + value_value_buf__u.value3 = thisDeserializer.readResource(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf__u has to be chosen through deserialisation."); + } + value_value_buf_.value0 = static_cast(value_value_buf__u); + } + else if (value_value_buf__selector == 1) { + value_value_buf_.selector = 1; + value_value_buf_.value1 = thisDeserializer.readEdgeColors(); + } + else if (value_value_buf__selector == 2) { + value_value_buf_.selector = 2; + value_value_buf_.value2 = thisDeserializer.readLocalizedEdgeColors(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf_ has to be chosen through deserialisation."); + } + value_value_buf.value = static_cast(value_value_buf_); + } + Opt_Union_ResourceColor_EdgeColors_LocalizedEdgeColors value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetBorderColor(node, (const Opt_Union_ResourceColor_EdgeColors_LocalizedEdgeColors*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetBorderColor, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetBorderStyle(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Union_BorderStyle_EdgeStyles value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + const Ark_Int8 value_value_buf__selector = thisDeserializer.readInt8(); + Ark_Union_BorderStyle_EdgeStyles value_value_buf_ = {}; + value_value_buf_.selector = value_value_buf__selector; + if (value_value_buf__selector == 0) { + value_value_buf_.selector = 0; + value_value_buf_.value0 = static_cast(thisDeserializer.readInt32()); + } + else if (value_value_buf__selector == 1) { + value_value_buf_.selector = 1; + value_value_buf_.value1 = thisDeserializer.readEdgeStyles(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf_ has to be chosen through deserialisation."); + } + value_value_buf.value = static_cast(value_value_buf_); + } + Opt_Union_BorderStyle_EdgeStyles value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetBorderStyle(node, (const Opt_Union_BorderStyle_EdgeStyles*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetBorderStyle, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetBorderRadius(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_Union_Length_BorderRadiuses_LocalizedBorderRadiuses value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + const Ark_Int8 value_value_buf__selector = thisDeserializer.readInt8(); + Ark_Union_Length_BorderRadiuses_LocalizedBorderRadiuses value_value_buf_ = {}; + value_value_buf_.selector = value_value_buf__selector; + if (value_value_buf__selector == 0) { + value_value_buf_.selector = 0; + value_value_buf_.value0 = thisDeserializer.readLength(); + } + else if (value_value_buf__selector == 1) { + value_value_buf_.selector = 1; + value_value_buf_.value1 = thisDeserializer.readBorderRadiuses(); + } + else if (value_value_buf__selector == 2) { + value_value_buf_.selector = 2; + value_value_buf_.value2 = thisDeserializer.readLocalizedBorderRadiuses(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf_ has to be chosen through deserialisation."); + } + value_value_buf.value = static_cast(value_value_buf_); + } + Opt_Union_Length_BorderRadiuses_LocalizedBorderRadiuses value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetBorderRadius(node, (const Opt_Union_Length_BorderRadiuses_LocalizedBorderRadiuses*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetBorderRadius, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) +Ark_NativePointer impl_TextFieldOps_textFieldOpsSetBackgroundColor(Ark_NativePointer node, KSerializerBuffer thisArray, int32_t thisLength) { + Deserializer thisDeserializer(thisArray, thisLength); + const auto value_value_buf_runtimeType = static_cast(thisDeserializer.readInt8()); + Opt_ResourceColor value_value_buf = {}; + value_value_buf.tag = value_value_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (value_value_buf_runtimeType)) + { + const Ark_Int8 value_value_buf__selector = thisDeserializer.readInt8(); + Ark_ResourceColor value_value_buf_ = {}; + value_value_buf_.selector = value_value_buf__selector; + if (value_value_buf__selector == 0) { + value_value_buf_.selector = 0; + value_value_buf_.value0 = static_cast(thisDeserializer.readInt32()); + } + else if (value_value_buf__selector == 1) { + value_value_buf_.selector = 1; + value_value_buf_.value1 = static_cast(thisDeserializer.readNumber()); + } + else if (value_value_buf__selector == 2) { + value_value_buf_.selector = 2; + value_value_buf_.value2 = static_cast(thisDeserializer.readString()); + } + else if (value_value_buf__selector == 3) { + value_value_buf_.selector = 3; + value_value_buf_.value3 = thisDeserializer.readResource(); + } + else { + INTEROP_FATAL("One of the branches for value_value_buf_ has to be chosen through deserialisation."); + } + value_value_buf.value = static_cast(value_value_buf_); + } + Opt_ResourceColor value_value = value_value_buf;; + return GetAccessors()->getTextFieldOpsAccessor()->textFieldOpsSetBackgroundColor(node, (const Opt_ResourceColor*)&value_value); +} +KOALA_INTEROP_DIRECT_3(TextFieldOps_textFieldOpsSetBackgroundColor, Ark_NativePointer, Ark_NativePointer, KSerializerBuffer, int32_t) void impl_ActionSheet_show(KSerializerBuffer thisArray, int32_t thisLength) { Deserializer thisDeserializer(thisArray, thisLength); Ark_ActionSheetOptions value_value = thisDeserializer.readActionSheetOptions();; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/dummy_impl.cc b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/dummy_impl.cc index 8d71cc5c4e57236a8cac82d734185c9a46d752b5..6a13b5106a5455b21005e1c3e261f9941695103b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/dummy_impl.cc +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/dummy_impl.cc @@ -29101,6 +29101,146 @@ namespace OHOS::Ace::NG::GeneratedModifier { appendGroupedLog(1, out); return nullptr; } + Ark_NativePointer TextFieldOpsSetWidthImpl(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetWidth("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } + Ark_NativePointer TextFieldOpsSetHeightImpl(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetHeight("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } + Ark_NativePointer TextFieldOpsSetPaddingImpl(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetPadding("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } + Ark_NativePointer TextFieldOpsSetMarginImpl(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetMargin("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } + Ark_NativePointer TextFieldOpsSetBorderImpl(Ark_NativePointer node, + const Opt_BorderOptions* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetBorder("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } + Ark_NativePointer TextFieldOpsSetBorderWidthImpl(Ark_NativePointer node, + const Opt_Union_Length_EdgeWidths_LocalizedEdgeWidths* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetBorderWidth("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } + Ark_NativePointer TextFieldOpsSetBorderColorImpl(Ark_NativePointer node, + const Opt_Union_ResourceColor_EdgeColors_LocalizedEdgeColors* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetBorderColor("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } + Ark_NativePointer TextFieldOpsSetBorderStyleImpl(Ark_NativePointer node, + const Opt_Union_BorderStyle_EdgeStyles* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetBorderStyle("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } + Ark_NativePointer TextFieldOpsSetBorderRadiusImpl(Ark_NativePointer node, + const Opt_Union_Length_BorderRadiuses_LocalizedBorderRadiuses* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetBorderRadius("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } + Ark_NativePointer TextFieldOpsSetBackgroundColorImpl(Ark_NativePointer node, + const Opt_ResourceColor* value) + { + if (!needGroupedLog(1)) + return nullptr; + string out("textFieldOpsSetBackgroundColor("); + WriteToString(&out, node); + out.append(", "); + WriteToString(&out, value); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } } // TextFieldOpsAccessor namespace ActionSheetAccessor { void ShowImpl(const Ark_ActionSheetOptions* value) @@ -44560,6 +44700,16 @@ namespace OHOS::Ace::NG::GeneratedModifier { { static const GENERATED_ArkUITextFieldOpsAccessor TextFieldOpsAccessorImpl { TextFieldOpsAccessor::RegisterTextFieldValueCallbackImpl, + TextFieldOpsAccessor::TextFieldOpsSetWidthImpl, + TextFieldOpsAccessor::TextFieldOpsSetHeightImpl, + TextFieldOpsAccessor::TextFieldOpsSetPaddingImpl, + TextFieldOpsAccessor::TextFieldOpsSetMarginImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderWidthImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderColorImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderStyleImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderRadiusImpl, + TextFieldOpsAccessor::TextFieldOpsSetBackgroundColorImpl, }; return &TextFieldOpsAccessorImpl; } diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/real_impl.cc b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/real_impl.cc index da86d42707f341ff6a0483eae698de954646b6b6..31b58705c6db78f53b6b1cd7050625c196524177 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/real_impl.cc +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/native/src/generated/real_impl.cc @@ -14608,6 +14608,106 @@ namespace OHOS::Ace::NG::GeneratedModifier { //undefinedModelNG::SetRegisterTextFieldValueCallback(frameNode, convValue); return {}; } + Ark_NativePointer TextFieldOpsSetWidthImpl(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetWidth(frameNode, convValue); + return {}; + } + Ark_NativePointer TextFieldOpsSetHeightImpl(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetHeight(frameNode, convValue); + return {}; + } + Ark_NativePointer TextFieldOpsSetPaddingImpl(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetPadding(frameNode, convValue); + return {}; + } + Ark_NativePointer TextFieldOpsSetMarginImpl(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetMargin(frameNode, convValue); + return {}; + } + Ark_NativePointer TextFieldOpsSetBorderImpl(Ark_NativePointer node, + const Opt_BorderOptions* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetBorder(frameNode, convValue); + return {}; + } + Ark_NativePointer TextFieldOpsSetBorderWidthImpl(Ark_NativePointer node, + const Opt_Union_Length_EdgeWidths_LocalizedEdgeWidths* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetBorderWidth(frameNode, convValue); + return {}; + } + Ark_NativePointer TextFieldOpsSetBorderColorImpl(Ark_NativePointer node, + const Opt_Union_ResourceColor_EdgeColors_LocalizedEdgeColors* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetBorderColor(frameNode, convValue); + return {}; + } + Ark_NativePointer TextFieldOpsSetBorderStyleImpl(Ark_NativePointer node, + const Opt_Union_BorderStyle_EdgeStyles* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetBorderStyle(frameNode, convValue); + return {}; + } + Ark_NativePointer TextFieldOpsSetBorderRadiusImpl(Ark_NativePointer node, + const Opt_Union_Length_BorderRadiuses_LocalizedBorderRadiuses* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetBorderRadius(frameNode, convValue); + return {}; + } + Ark_NativePointer TextFieldOpsSetBackgroundColorImpl(Ark_NativePointer node, + const Opt_ResourceColor* value) + { + auto frameNode = reinterpret_cast(node); + CHECK_NULL_VOID(frameNode); + //auto convValue = Converter::Convert(node); + //auto convValue = Converter::OptConvert(node); // for enums + //undefinedModelNG::SetTextFieldOpsSetBackgroundColor(frameNode, convValue); + return {}; + } } // TextFieldOpsAccessor namespace ActionSheetAccessor { void ShowImpl(const Ark_ActionSheetOptions* value) @@ -22161,6 +22261,16 @@ namespace OHOS::Ace::NG::GeneratedModifier { { static const GENERATED_ArkUITextFieldOpsAccessor TextFieldOpsAccessorImpl { TextFieldOpsAccessor::RegisterTextFieldValueCallbackImpl, + TextFieldOpsAccessor::TextFieldOpsSetWidthImpl, + TextFieldOpsAccessor::TextFieldOpsSetHeightImpl, + TextFieldOpsAccessor::TextFieldOpsSetPaddingImpl, + TextFieldOpsAccessor::TextFieldOpsSetMarginImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderWidthImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderColorImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderStyleImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderRadiusImpl, + TextFieldOpsAccessor::TextFieldOpsSetBackgroundColorImpl, }; return &TextFieldOpsAccessorImpl; } diff --git a/frameworks/core/components_ng/pattern/text_field/text_field_model_static.cpp b/frameworks/core/components_ng/pattern/text_field/text_field_model_static.cpp index 16893a8532e864818fc0a97b8692c94af59ea0ae..975699243ca053c0049168b6db88ce44039ff0ac 100644 --- a/frameworks/core/components_ng/pattern/text_field/text_field_model_static.cpp +++ b/frameworks/core/components_ng/pattern/text_field/text_field_model_static.cpp @@ -733,4 +733,93 @@ void TextFieldModelStatic::SetDefaultCancelIcon(FrameNode* frameNode) TextFieldModelNG::SetCancelIconColor(frameNode, color); TextFieldModelNG::SetCanacelIconSrc(frameNode, srcStr); } + +void TextFieldModelStatic::SetWidthAuto(FrameNode* frameNode, bool val) +{ + CHECK_NULL_VOID(frameNode); + auto layoutProperty = frameNode->GetLayoutProperty(); + CHECK_NULL_VOID(layoutProperty); + layoutProperty->UpdateWidthAuto(val); +} + +void TextFieldModelStatic::SetPadding(FrameNode* frameNode, const NG::PaddingProperty& newPadding, + bool tmp) +{ + CHECK_NULL_VOID(frameNode); + if (tmp) { + auto pattern = frameNode->GetPattern(); + CHECK_NULL_VOID(pattern); + auto theme = pattern->GetTheme(); + CHECK_NULL_VOID(theme); + auto themePadding = theme->GetPadding(); + PaddingProperty paddings; + paddings.top = NG::CalcLength(themePadding.Top().ConvertToPx()); + paddings.bottom = NG::CalcLength(themePadding.Bottom().ConvertToPx()); + paddings.left = NG::CalcLength(themePadding.Left().ConvertToPx()); + paddings.right = NG::CalcLength(themePadding.Right().ConvertToPx()); + ViewAbstract::SetPadding(paddings); + ACE_UPDATE_NODE_PAINT_PROPERTY(TextFieldPaintProperty, PaddingByUser, paddings, frameNode); + return; + } + NG::ViewAbstract::SetPadding(frameNode, newPadding); + ACE_UPDATE_NODE_PAINT_PROPERTY(TextFieldPaintProperty, PaddingByUser, newPadding, frameNode); +} + +void TextFieldModelStatic::SetMargin(FrameNode* frameNode) +{ + CHECK_NULL_VOID(frameNode); + auto layoutProperty = frameNode->GetLayoutProperty(); + CHECK_NULL_VOID(layoutProperty); + const auto& margin = layoutProperty->GetMarginProperty(); + CHECK_NULL_VOID(margin); + bool isRTL = layoutProperty->GetNonAutoLayoutDirection() == TextDirection::RTL; + + MarginProperty userMargin; + userMargin.top = margin->top; + userMargin.bottom = margin->bottom; + userMargin.left = margin->left.has_value() ? margin->left : + (isRTL ? margin->end : margin->start); + userMargin.right = margin->right.has_value() ? margin->right : + (isRTL ? margin->start : margin->end); + ACE_UPDATE_NODE_PAINT_PROPERTY(TextFieldPaintProperty, MarginByUser, userMargin, frameNode); +} + +void TextFieldModelStatic::SetBackBorder(FrameNode* frameNode) +{ + CHECK_NULL_VOID(frameNode); + auto renderContext = frameNode->GetRenderContext(); + CHECK_NULL_VOID(renderContext); + if (renderContext->HasBorderRadius()) { + auto renderContext = frameNode->GetRenderContext(); + CHECK_NULL_VOID(renderContext); + auto layoutProperty = frameNode->GetLayoutProperty(); + CHECK_NULL_VOID(layoutProperty); + + bool isRTL = layoutProperty->GetNonAutoLayoutDirection() == TextDirection::RTL; + auto radius = renderContext->GetBorderRadius().value(); + + radius.radiusTopLeft = radius.radiusTopLeft.has_value() ? radius.radiusTopLeft : + (isRTL ? radius.radiusTopEnd : radius.radiusTopStart); + radius.radiusTopRight = radius.radiusTopRight.has_value() ? radius.radiusTopRight : + (isRTL ? radius.radiusTopStart : radius.radiusTopEnd); + radius.radiusBottomLeft = radius.radiusBottomLeft.has_value() ? radius.radiusBottomLeft : + (isRTL ? radius.radiusBottomEnd : radius.radiusBottomStart); + radius.radiusBottomRight = radius.radiusBottomRight.has_value() ? radius.radiusBottomRight : + (isRTL ? radius.radiusBottomStart : radius.radiusBottomEnd); + + ACE_UPDATE_NODE_PAINT_PROPERTY(TextFieldPaintProperty, BorderRadiusFlagByUser, radius, frameNode); + } + if (renderContext->HasBorderColor()) { + ACE_UPDATE_NODE_PAINT_PROPERTY( + TextFieldPaintProperty, BorderColorFlagByUser, renderContext->GetBorderColor().value(), frameNode); + } + if (renderContext->HasBorderWidth()) { + ACE_UPDATE_NODE_PAINT_PROPERTY( + TextFieldPaintProperty, BorderWidthFlagByUser, renderContext->GetBorderWidth().value(), frameNode); + } + if (renderContext->HasBorderStyle()) { + ACE_UPDATE_NODE_PAINT_PROPERTY( + TextFieldPaintProperty, BorderStyleFlagByUser, renderContext->GetBorderStyle().value(), frameNode); + } +} } // namespace OHOS::Ace::NG diff --git a/frameworks/core/components_ng/pattern/text_field/text_field_model_static.h b/frameworks/core/components_ng/pattern/text_field/text_field_model_static.h index 2c2361981d904b520c309c650e4623f5f72fbd05..18d5891fbb4656d745cdb9b32307955af0f1ec45 100644 --- a/frameworks/core/components_ng/pattern/text_field/text_field_model_static.h +++ b/frameworks/core/components_ng/pattern/text_field/text_field_model_static.h @@ -97,6 +97,11 @@ public: static void SetSelectAllValue(FrameNode* frameNode, const std::optional& isSelectAllValue); static void SetDefaultCancelIcon(FrameNode* frameNode); + static void SetWidthAuto(FrameNode* frameNode, bool val); + static void SetPadding(FrameNode* frameNode, const NG::PaddingProperty& newPadding, bool tmp); + static void SetMargin(FrameNode* frameNode); + static void SetBackBorder(FrameNode* frameNode); + private: }; 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 dc14f4a698cc09b046ef3f4467900b632a31a343..18efe664b30886e681d8743fe96513790a934621 100644 --- a/frameworks/core/interfaces/native/generated/interface/arkoala_api_generated.h +++ b/frameworks/core/interfaces/native/generated/interface/arkoala_api_generated.h @@ -24764,6 +24764,26 @@ typedef struct GENERATED_ArkUITextFieldOpsAccessor { Ark_NativePointer (*registerTextFieldValueCallback)(Ark_NativePointer node, const Ark_ResourceStr* value, const TextFieldValueCallback* callback); + Ark_NativePointer (*textFieldOpsSetWidth)(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value); + Ark_NativePointer (*textFieldOpsSetHeight)(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value); + Ark_NativePointer (*textFieldOpsSetPadding)(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value); + Ark_NativePointer (*textFieldOpsSetMargin)(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value); + Ark_NativePointer (*textFieldOpsSetBorder)(Ark_NativePointer node, + const Opt_BorderOptions* value); + Ark_NativePointer (*textFieldOpsSetBorderWidth)(Ark_NativePointer node, + const Opt_Union_Length_EdgeWidths_LocalizedEdgeWidths* value); + Ark_NativePointer (*textFieldOpsSetBorderColor)(Ark_NativePointer node, + const Opt_Union_ResourceColor_EdgeColors_LocalizedEdgeColors* value); + Ark_NativePointer (*textFieldOpsSetBorderStyle)(Ark_NativePointer node, + const Opt_Union_BorderStyle_EdgeStyles* value); + Ark_NativePointer (*textFieldOpsSetBorderRadius)(Ark_NativePointer node, + const Opt_Union_Length_BorderRadiuses_LocalizedBorderRadiuses* value); + Ark_NativePointer (*textFieldOpsSetBackgroundColor)(Ark_NativePointer node, + const Opt_ResourceColor* value); } GENERATED_ArkUITextFieldOpsAccessor; typedef struct GENERATED_ArkUIActionSheetAccessor { diff --git a/frameworks/core/interfaces/native/implementation/text_field_ops_accessor.cpp b/frameworks/core/interfaces/native/implementation/text_field_ops_accessor.cpp index d10f7aeacc34c8cd4b20d20a2a0804579d52bb58..e21cdb95cb18e853ec82cbe6a6908fb673208a92 100644 --- a/frameworks/core/interfaces/native/implementation/text_field_ops_accessor.cpp +++ b/frameworks/core/interfaces/native/implementation/text_field_ops_accessor.cpp @@ -16,10 +16,12 @@ #include "core/interfaces/native/utility/reverse_converter.h" #include "arkoala_api_generated.h" #include "core/components_ng/base/frame_node.h" +#include "core/components_ng/base/view_abstract_model_static.h" #include "core/components_ng/pattern/text_field/text_field_model_static.h" #include "core/components_ng/pattern/text_field/text_field_pattern.h" #include "core/interfaces/native/utility/callback_helper.h" #include "core/interfaces/native/utility/converter.h" +#include "core/interfaces/native/utility/validators.h" namespace OHOS::Ace::NG::GeneratedModifier { namespace TextFieldOpsAccessor { @@ -47,11 +49,189 @@ Ark_NativePointer RegisterTextFieldValueCallbackImpl(Ark_NativePointer node, TextFieldModelStatic::SetOnChangeEvent(frameNode, std::move(onEvent)); return node; } +Ark_NativePointer TextFieldOpsSetWidthImpl(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + Converter::VisitUnion(*value, + [frameNode](const Ark_Length& value) { + auto result = Converter::OptConvert(value); + TextFieldModelStatic::SetWidthAuto(frameNode, false); + Validator::ValidateNonNegative(result); + if (!result) { + ViewAbstract::ClearWidthOrHeight(frameNode, true); + return; + } + ViewAbstractModelStatic::SetWidth(frameNode, *result); + }, + [frameNode](const Ark_LayoutPolicy& value) { + LOGE("ARKOALA: TextFieldOpsSetWidthImpl: Ark_LayoutPolicy is not supported.\n"); + }, + []() {} + ); + + // todo: auto set + // if (jsValue->IsString() && jsValue->ToString() == "auto") { + // ViewAbstractModel::ClearWidthOrHeight(frameNode, true); + // TextFieldModel::GetInstance()->SetWidthAuto(frameNode, true); + // return; + // } + + return {}; +} +Ark_NativePointer TextFieldOpsSetHeightImpl(Ark_NativePointer node, + const Opt_Union_Length_LayoutPolicy* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + Converter::VisitUnion(*value, + [frameNode](const Ark_Length& value) { + auto result = Converter::OptConvert(value); + Validator::ValidateNonNegative(result); + if (!result) { + ViewAbstract::ClearWidthOrHeight(frameNode, false); + return; + } + ViewAbstractModelStatic::SetHeight(frameNode, *result); + }, + [frameNode](const Ark_LayoutPolicy& value) { + LOGE("ARKOALA: TextFieldOpsSetHeightImpl: Ark_LayoutPolicy is not supported.\n"); + }, + []() {} + ); + return {}; +} +Ark_NativePointer TextFieldOpsSetPaddingImpl(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + auto padding = Converter::OptConvertPtr(value); + ViewAbstractModelStatic::SetPadding(frameNode, padding); + if (padding) { + TextFieldModelStatic::SetPadding(frameNode, padding.value(), false); + } else { + TextFieldModelStatic::SetPadding(frameNode, NG::PaddingProperty(), true); + } + return {}; +} +Ark_NativePointer TextFieldOpsSetMarginImpl(Ark_NativePointer node, + const Opt_Union_Padding_Length_LocalizedPadding* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + ViewAbstractModelStatic::SetMargin(frameNode, Converter::OptConvertPtr(value)); + TextFieldModelStatic::SetMargin(frameNode); + return {}; +} +Ark_NativePointer TextFieldOpsSetBorderImpl(Ark_NativePointer node, + const Opt_BorderOptions* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + auto optValue = Converter::GetOptPtr(value); + CHECK_NULL_RETURN(optValue, nullptr); + auto style = Converter::OptConvert(optValue->style); + if (style) { + ViewAbstractModelStatic::SetBorderStyle(frameNode, style.value()); + } + auto width = Converter::OptConvert(optValue->width); + if (width) { + ViewAbstractModelStatic::SetBorderWidth(frameNode, width.value()); + } + auto color = Converter::OptConvert(optValue->color); + if (color) { + ViewAbstractModelStatic::SetBorderColor(frameNode, color.value()); + } + auto radius = Converter::OptConvert(optValue->radius); + if (radius) { + ViewAbstractModelStatic::SetBorderRadius(frameNode, radius.value()); + } + auto dashGap = Converter::OptConvert(optValue->dashGap); + if (dashGap) { + ViewAbstractModelStatic::SetDashGap(frameNode, dashGap.value()); + } + auto dashWidth = Converter::OptConvert(optValue->dashWidth); + if (dashWidth) { + ViewAbstractModelStatic::SetDashWidth(frameNode, dashWidth.value()); + } + TextFieldModelStatic::SetBackBorder(frameNode); + return {}; +} +Ark_NativePointer TextFieldOpsSetBorderWidthImpl(Ark_NativePointer node, + const Opt_Union_Length_EdgeWidths_LocalizedEdgeWidths* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + auto width = Converter::OptConvertPtr(value); + if (width) { + ViewAbstractModelStatic::SetBorderWidth(frameNode, width.value()); + } + TextFieldModelStatic::SetBackBorder(frameNode); + return {}; +} +Ark_NativePointer TextFieldOpsSetBorderColorImpl(Ark_NativePointer node, + const Opt_Union_ResourceColor_EdgeColors_LocalizedEdgeColors* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + auto color = Converter::OptConvertPtr(value); + if (color) { + ViewAbstractModelStatic::SetBorderColor(frameNode, color.value()); + } + TextFieldModelStatic::SetBackBorder(frameNode); + return {}; +} +Ark_NativePointer TextFieldOpsSetBorderStyleImpl(Ark_NativePointer node, + const Opt_Union_BorderStyle_EdgeStyles* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + auto style = Converter::OptConvertPtr(value); + if (style) { + ViewAbstractModelStatic::SetBorderStyle(frameNode, style.value()); + } + TextFieldModelStatic::SetBackBorder(frameNode); + return {}; +} +Ark_NativePointer TextFieldOpsSetBorderRadiusImpl(Ark_NativePointer node, + const Opt_Union_Length_BorderRadiuses_LocalizedBorderRadiuses* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + auto radiuses = Converter::OptConvertPtr(value); + if (radiuses) { + ViewAbstractModelStatic::SetBorderRadius(frameNode, radiuses.value()); + } + TextFieldModelStatic::SetBackBorder(frameNode); + return {}; +} +Ark_NativePointer TextFieldOpsSetBackgroundColorImpl(Ark_NativePointer node, + const Opt_ResourceColor* value) +{ + auto frameNode = reinterpret_cast(node); + CHECK_NULL_RETURN(frameNode, nullptr); + auto color = Converter::OptConvertPtr(value); + ViewAbstractModelStatic::SetBackgroundColor(frameNode, color); + TextFieldModelStatic::SetBackgroundColor(frameNode, color); + return {}; +} } // TextFieldOpsAccessor const GENERATED_ArkUITextFieldOpsAccessor* GetTextFieldOpsAccessor() { static const GENERATED_ArkUITextFieldOpsAccessor TextFieldOpsAccessorImpl { TextFieldOpsAccessor::RegisterTextFieldValueCallbackImpl, + TextFieldOpsAccessor::TextFieldOpsSetWidthImpl, + TextFieldOpsAccessor::TextFieldOpsSetHeightImpl, + TextFieldOpsAccessor::TextFieldOpsSetPaddingImpl, + TextFieldOpsAccessor::TextFieldOpsSetMarginImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderWidthImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderColorImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderStyleImpl, + TextFieldOpsAccessor::TextFieldOpsSetBorderRadiusImpl, + TextFieldOpsAccessor::TextFieldOpsSetBackgroundColorImpl, }; return &TextFieldOpsAccessorImpl; }