diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/FrameNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/FrameNode.ts index 12a9e4adc3ed126be359f3883138d59441178e8d..4faf425278e7b43d771bd3eaff7599e9513820a0 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/FrameNode.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/FrameNode.ts @@ -57,6 +57,9 @@ import { ArkSearchNode } from './handwritten/modifiers/ArkSearchNode' import { ArkSwiperNode } from "./handwritten/modifiers/ArkSwiperNode"; import { ArkTextAreaNode } from './handwritten/modifiers/ArkTextAreaNode' import { ArkTextInputNode } from './handwritten/modifiers/ArkTextInputNode' +import { ArkTextNode } from './handwritten/modifiers/ArkTextNode' +import { ArkMarqueeNode } from './handwritten/modifiers/ArkMarqueeNode' +import { ArkSymbolGlyphNode } from './handwritten/modifiers/ArkSymbolGlyphNode' import { ArkXComponentNode } from "./handwritten/modifiers/ArkXComponentNode" import { ModifierType } from './handwritten/modifiers/ArkCommonModifier' import { ListOptions, ListAttribute, ArkListPeer } from './component/list' @@ -90,8 +93,9 @@ import { SearchOptions, SearchAttribute, ArkSearchPeer } from './component/searc import { SwiperController, SwiperAttribute, ArkSwiperPeer } from './component/swiper' import { TextAreaOptions, TextAreaAttribute, ArkTextAreaPeer } from './component/textArea' import { TextInputOptions, TextInputAttribute, ArkTextInputPeer } from './component/textInput' -import { ArkTextNode } from './handwritten/modifiers/ArkTextNode' import { TextOptions, TextAttribute, ArkTextPeer } from './component/text' +import { MarqueeOptions, MarqueeAttribute, ArkMarqueePeer } from './component/marquee' +import { SymbolGlyphAttribute, ArkSymbolGlyphPeer } from './component/symbolglyph' import { XComponentParameters, XComponentOptions, NativeXComponentParameters, XComponentAttribute, TypedXComponentPeerInternal } from "./component/xcomponent" import { XComponentType } from './component/enums' import { Deserializer } from "./component/peers/Deserializer"; @@ -1221,9 +1225,9 @@ export namespace typeNode { constructor(uiContext: UIContext, type: string, attrCreator: (node: FrameNode, type: ModifierType) => ArkSearchNode) { super(uiContext, type, attrCreator); } - initialize(options: SearchOptions): SearchAttribute { + initialize(value?: SearchOptions): SearchAttribute { let arkSearchNode = this.attribute as ArkSearchNode; - return arkSearchNode!.initialize(options); + return arkSearchNode!.initialize(value); } } @@ -1241,9 +1245,9 @@ export namespace typeNode { constructor(uiContext: UIContext, type: string, attrCreator: (node: FrameNode, type: ModifierType) => ArkTextAreaNode) { super(uiContext, type, attrCreator); } - initialize(options: TextAreaOptions): TextAreaAttribute { + initialize(value?: TextAreaOptions): TextAreaAttribute { let arkTextAreaNode = this.attribute as ArkTextAreaNode; - return arkTextAreaNode!.initialize(options); + return arkTextAreaNode!.initialize(value); } } @@ -1251,9 +1255,9 @@ export namespace typeNode { constructor(uiContext: UIContext, type: string, attrCreator: (node: FrameNode, type: ModifierType) => ArkTextInputNode) { super(uiContext, type, attrCreator); } - initialize(options: TextInputOptions): TextInputAttribute { + initialize(value?: TextInputOptions): TextInputAttribute { let arkTextInputNode = this.attribute as ArkTextInputNode; - return arkTextInputNode!.initialize(options); + return arkTextInputNode!.initialize(value); } } @@ -1267,6 +1271,26 @@ export namespace typeNode { } } + class MarqueeFrameNode extends TypedFrameNode { + constructor(uiContext: UIContext, type: string, attrCreator: (node: FrameNode, type: ModifierType) => ArkMarqueeNode) { + super(uiContext, type, attrCreator); + } + initialize(value: MarqueeOptions): MarqueeAttribute { + let arkMarqueeNode = this.attribute as ArkMarqueeNode; + return arkMarqueeNode!.initialize(value); + } + } + + class SymbolGlyphFrameNode extends TypedFrameNode { + constructor(uiContext: UIContext, type: string, attrCreator: (node: FrameNode, type: ModifierType) => ArkSymbolGlyphNode) { + super(uiContext, type, attrCreator); + } + initialize(value?: Resource): SymbolGlyphAttribute { + let arkSymbolGlyphNode = this.attribute as ArkSymbolGlyphNode; + return arkSymbolGlyphNode!.initialize(value); + } + } + class XComponentFrameNode extends TypedFrameNode { constructor(uiContext: UIContext, type: string, attrCreator: (node: FrameNode, type: ModifierType) => ArkXComponentNode) { super(uiContext, type, attrCreator); @@ -1551,7 +1575,7 @@ export namespace typeNode { } // @ts-ignore - function createSearchNode(context: UIContext, type: string): SearchFrameNode { + function createSearchNode(context: UIContext, type: 'Search'): SearchFrameNode { return new SearchFrameNode(context, 'Search', (node: FrameNode, type: ModifierType): ArkSearchNode => { let arknode = new ArkSearchNode(); const retval = ArkUIGeneratedNativeModule._FrameNode_getFrameNodePtr(toPeerPtr(node)); @@ -1573,7 +1597,7 @@ export namespace typeNode { } // @ts-ignore - function createTextAreaNode(context: UIContext, type: string): TextAreaFrameNode { + function createTextAreaNode(context: UIContext, type: 'TextArea'): TextAreaFrameNode { return new TextAreaFrameNode(context, 'TextArea', (node: FrameNode, type: ModifierType): ArkTextAreaNode => { let arknode = new ArkTextAreaNode(); const retval = ArkUIGeneratedNativeModule._FrameNode_getFrameNodePtr(toPeerPtr(node)); @@ -1584,7 +1608,7 @@ export namespace typeNode { } // @ts-ignore - function createTextInputNode(context: UIContext, type: string): TextInputFrameNode { + function createTextInputNode(context: UIContext, type: 'TextInput'): TextInputFrameNode { return new TextInputFrameNode(context, 'TextInput', (node: FrameNode, type: ModifierType): ArkTextInputNode => { let arknode = new ArkTextInputNode(); const retval = ArkUIGeneratedNativeModule._FrameNode_getFrameNodePtr(toPeerPtr(node)); @@ -1605,6 +1629,38 @@ export namespace typeNode { }); } + class ArkMarqueePeerCustom extends ArkMarqueePeer { + constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { + super(peerPtr, id, name, flags) + } + } + // @ts-ignore + function createMarqueeNode(context: UIContext, type: 'Marquee'): MarqueeFrameNode { + return new MarqueeFrameNode(context, 'Marquee', (node: FrameNode, type: ModifierType): ArkMarqueeNode => { + let arknode = new ArkMarqueeNode(); + const retval = ArkUIGeneratedNativeModule._FrameNode_getFrameNodePtr(toPeerPtr(node)); + const peer = new ArkMarqueePeerCustom(retval, node._nodeId as int32, "Marquee", 0); + arknode.setPeer(peer); + return arknode; + }); + } + + class ArkSymbolGlyphPeerCustom extends ArkSymbolGlyphPeer { + constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { + super(peerPtr, id, name, flags) + } + } + // @ts-ignore + function createSymbolGlyphNode(context: UIContext, type: 'SymbolGlyph'): SymbolGlyphFrameNode { + return new SymbolGlyphFrameNode(context, 'SymbolGlyph', (node: FrameNode, type: ModifierType): ArkSymbolGlyphNode => { + let arknode = new ArkSymbolGlyphNode(); + const retval = ArkUIGeneratedNativeModule._FrameNode_getFrameNodePtr(toPeerPtr(node)); + const peer = new ArkSymbolGlyphPeerCustom(retval, node._nodeId as int32, "SymbolGlyph", 0); + arknode.setPeer(peer); + return arknode; + }); + } + // @ts-ignore function createXComponentNode(context: UIContext, type: string): XComponentFrameNode { let xcFrameNode = new XComponentFrameNode(context, 'XComponent', (node: FrameNode, type: ModifierType): ArkXComponentNode => { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkMarqueeNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkMarqueeNode.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8d1814e209ef3dae9dba3432cc624ab34be188f --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkMarqueeNode.ts @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { InteropNativeModule } from "@koalaui/interop"; + +import { ArkBaseNode } from "./ArkBaseNode"; +import { MarqueeAttribute, ResourceColor, Length, FontWeight, MarqueeUpdateStrategy } from "../../component"; +import { ArkMarqueePeer, MarqueeOptions } from "../../component"; +import { Resource } from "global.resource"; + +export class ArkMarqueeNode extends ArkBaseNode implements MarqueeAttribute { + constructParam(...param: Object[]): this { + InteropNativeModule._NativeLog("list constructParam enter") + return this; + } + + getPeer() : ArkMarqueePeer { + return this.peer as ArkMarqueePeer + } + initialize(options: MarqueeOptions): this { + const options_casted = options as (MarqueeOptions) + this.getPeer()?.setMarqueeOptionsAttribute(options_casted) + this.markDirty(); + return this; + } + allowChildTypes(): string[] { + return ["MarqueeItem", "MarqueeItemGroup"]; + } + setMarqueeOptions(options: MarqueeOptions): this { + const options_casted = options as (MarqueeOptions) + this.getPeer()?.setMarqueeOptionsAttribute(options_casted) + this.markDirty(); + return this; + } + fontColor(value: ResourceColor | undefined): this { + const value_casted = value as (ResourceColor | undefined) + this.getPeer()?.fontColorAttribute(value_casted) + this.markDirty(); + return this; + } + fontSize(value: Length | undefined): this { + const value_casted = value as (Length | undefined) + this.getPeer()?.fontSizeAttribute(value_casted) + this.markDirty(); + return this; + } + allowScale(value: boolean | undefined): this { + const value_casted = value as (boolean | undefined) + this.getPeer()?.allowScaleAttribute(value_casted) + this.markDirty(); + return this; + } + fontWeight(value: number | FontWeight | string | undefined): this { + const value_casted = value as (number | FontWeight | string | undefined) + this.getPeer()?.fontWeightAttribute(value_casted) + this.markDirty(); + return this; + } + fontFamily(value: string | Resource | undefined): this { + const value_casted = value as (string | Resource | undefined) + this.getPeer()?.fontFamilyAttribute(value_casted) + this.markDirty(); + return this; + } + marqueeUpdateStrategy(value: MarqueeUpdateStrategy | undefined): this { + const value_casted = value as (MarqueeUpdateStrategy | undefined) + this.getPeer()?.marqueeUpdateStrategyAttribute(value_casted) + this.markDirty(); + return this; + } + onStart(value: (() => void) | undefined): this { + const value_casted = value as ((() => void) | undefined) + this.getPeer()?.onStartAttribute(value_casted) + this.markDirty(); + return this; + } + onBounce(value: (() => void) | undefined): this { + const value_casted = value as ((() => void) | undefined) + this.getPeer()?.onBounceAttribute(value_casted) + this.markDirty(); + return this; + } + onFinish(value: (() => void) | undefined): this { + const value_casted = value as ((() => void) | undefined) + this.getPeer()?.onFinishAttribute(value_casted) + this.markDirty(); + return this; + } +} \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSearchNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSearchNode.ts index f8474d8f68429ce9ee1904fe6ebecdd1e0a22822..c5a9e268925b4ded3146ad1c6e84b4fa5138abc3 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSearchNode.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSearchNode.ts @@ -36,6 +36,7 @@ export class ArkSearchNode extends ArkBaseNode implements SearchAttribute { initialize(options?: SearchOptions): this { const options_casted = options as (SearchOptions | undefined) this.getPeer()?.setSearchOptionsAttribute(options_casted) + this.markDirty(); return this; } allowChildTypes(): string[] { @@ -43,200 +44,248 @@ export class ArkSearchNode extends ArkBaseNode implements SearchAttribute { } setSearchOptions(options?: SearchOptions): this { this.getPeer().setSearchOptionsAttribute(options); + this.markDirty(); return this; } fontColor(value: ResourceColor | undefined): this { this.getPeer().fontColorAttribute(value); + this.markDirty(); return this; } searchIcon(value: IconOptions | SymbolGlyphModifier | undefined): this { this.getPeer().searchIconAttribute(value); + this.markDirty(); return this; } cancelButton(value: CancelButtonOptions | CancelButtonSymbolOptions | undefined): this { this.getPeer().cancelButtonAttribute(value); + this.markDirty(); return this; } textIndent(value: Dimension | undefined): this { this.getPeer().textIndentAttribute(value); + this.markDirty(); return this; } onEditChange(value: ((isVisible: boolean) => void) | undefined): this { this.getPeer().onEditChangeAttribute(value); + this.markDirty(); return this; } selectedBackgroundColor(value: ResourceColor | undefined): this { this.getPeer().selectedBackgroundColorAttribute(value); + this.markDirty(); return this; } caretStyle(value: CaretStyle | undefined): this { this.getPeer().caretStyleAttribute(value); + this.markDirty(); return this; } placeholderColor(value: ResourceColor | undefined): this { this.getPeer().placeholderColorAttribute(value); + this.markDirty(); return this; } placeholderFont(value: Font | undefined): this { this.getPeer().placeholderFontAttribute(value); + this.markDirty(); return this; } textFont(value: Font | undefined): this { this.getPeer().textFontAttribute(value); + this.markDirty(); return this; } enterKeyType(value: EnterKeyType | undefined): this { this.getPeer().enterKeyTypeAttribute(value); + this.markDirty(); return this; } onChange(value: EditableTextOnChangeCallback | undefined): this { this.getPeer().onChangeAttribute(value); + this.markDirty(); return this; } onTextSelectionChange(value: OnTextSelectionChangeCallback | undefined): this { this.getPeer().onTextSelectionChangeAttribute(value); + this.markDirty(); return this; } onContentScroll(value: OnContentScrollCallback | undefined): this { this.getPeer().onContentScrollAttribute(value); + this.markDirty(); return this; } onCopy(value: ((breakpoints: string) => void) | undefined): this { this.getPeer().onCopyAttribute(value); + this.markDirty(); return this; } onCut(value: ((breakpoints: string) => void) | undefined): this { this.getPeer().onCutAttribute(value); + this.markDirty(); return this; } onPaste(value: OnPasteCallback | undefined): this { this.getPeer().onPasteAttribute(value); + this.markDirty(); return this; } copyOption(value: CopyOptions | undefined): this { this.getPeer().copyOptionAttribute(value); + this.markDirty(); return this; } maxLength(value: number | undefined): this { this.getPeer().maxLengthAttribute(value); + this.markDirty(); return this; } textAlign(value: TextAlign | undefined): this { this.getPeer().textAlignAttribute(value); + this.markDirty(); return this; } enableKeyboardOnFocus(value: boolean | undefined): this { this.getPeer().enableKeyboardOnFocusAttribute(value); + this.markDirty(); return this; } selectionMenuHidden(value: boolean | undefined): this { this.getPeer().selectionMenuHiddenAttribute(value); + this.markDirty(); return this; } minFontSize(value: number | string | Resource | undefined): this { this.getPeer().minFontSizeAttribute(value); + this.markDirty(); return this; } maxFontSize(value: number | string | Resource | undefined): this { this.getPeer().maxFontSizeAttribute(value); + this.markDirty(); return this; } minFontScale(value: number | Resource | undefined): this { this.getPeer().minFontScaleAttribute(value); + this.markDirty(); return this; } maxFontScale(value: number | Resource | undefined): this { this.getPeer().maxFontScaleAttribute(value); + this.markDirty(); return this; } decoration(value: TextDecorationOptions | undefined): this { this.getPeer().decorationAttribute(value); + this.markDirty(); return this; } letterSpacing(value: number | string | Resource | undefined): this { this.getPeer().letterSpacingAttribute(value); + this.markDirty(); return this; } lineHeight(value: number | string | Resource | undefined): this { this.getPeer().lineHeightAttribute(value); + this.markDirty(); return this; } type(value: SearchType | undefined): this { this.getPeer().typeAttribute(value); + this.markDirty(); return this; } fontFeature(value: string | undefined): this { this.getPeer().fontFeatureAttribute(value); + this.markDirty(); return this; } onWillInsert(value: ((parameter: InsertValue) => boolean) | undefined): this { this.getPeer().onWillInsertAttribute(value); + this.markDirty(); return this; } onDidInsert(value: ((parameter: InsertValue) => void) | undefined): this { this.getPeer().onDidInsertAttribute(value); + this.markDirty(); return this; } onWillDelete(value: ((parameter: DeleteValue) => boolean) | undefined): this { this.getPeer().onWillDeleteAttribute(value); + this.markDirty(); return this; } onDidDelete(value: ((parameter: DeleteValue) => void) | undefined): this { this.getPeer().onDidDeleteAttribute(value); + this.markDirty(); return this; } editMenuOptions(value: EditMenuOptions | undefined): this { this.getPeer().editMenuOptionsAttribute(value); + this.markDirty(); return this; } enablePreviewText(value: boolean | undefined): this { this.getPeer().enablePreviewTextAttribute(value); + this.markDirty(); return this; } enableHapticFeedback(value: boolean | undefined): this { this.getPeer().enableHapticFeedbackAttribute(value); + this.markDirty(); return this; } autoCapitalizationMode(value: AutoCapitalizationMode | undefined): this { this.getPeer().autoCapitalizationModeAttribute(value); + this.markDirty(); return this; } halfLeading(value: boolean | undefined): this { this.getPeer().halfLeadingAttribute(value); + this.markDirty(); return this; } stopBackPress(value: boolean | undefined): this { this.getPeer().stopBackPressAttribute(value); + this.markDirty(); return this; } onWillChange(value: ((parameter: EditableTextChangeValue) => boolean) | undefined): this { this.getPeer().onWillChangeAttribute(value); + this.markDirty(); return this; } keyboardAppearance(value: KeyboardAppearance | undefined): this { this.getPeer().keyboardAppearanceAttribute(value); + this.markDirty(); return this; } searchButton(value: string | undefined, option?: SearchButtonOptions): this { this.getPeer().searchButtonAttribute(value); + this.markDirty(); return this; } inputFilter(value: ResourceStr | undefined, error?: ((breakpoints: string) => void)): this { this.getPeer().inputFilterAttribute(value, error); + this.markDirty(); return this; } customKeyboard(value: CustomBuilder | undefined, options?: KeyboardOptions): this { this.getPeer().customKeyboardAttribute(value, options); + this.markDirty(); return this; } onSubmit(value: SearchSubmitCallback | ((breakpoints: string) => void) | undefined): this { - // todo: type check - // this.getPeer().onSubmit0Attribute(value); - // this.getPeer().onSubmit1Attribute(value); + const value_casted = value as (SearchSubmitCallback | undefined) + this.getPeer()?.onSubmit1Attribute(value_casted) + this.markDirty(); return this; } _onChangeEvent_value(callback: (breakpoints: string) => void): void { this.getPeer()._onChangeEvent_valueAttribute(callback); + this.markDirty(); return; } } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphModifier.ts deleted file mode 100644 index a3fc548e8c81adc2b90df4178e6cd965241fabba..0000000000000000000000000000000000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphModifier.ts +++ /dev/null @@ -1,14 +0,0 @@ -// /* -// * Copyright (c) 2025 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphNode.ts index a3fc548e8c81adc2b90df4178e6cd965241fabba..adcb44e6121ff86672df4f2e41f012911fb3e5c6 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphNode.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphNode.ts @@ -1,14 +1,107 @@ -// /* -// * Copyright (c) 2025 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ \ No newline at end of file +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { InteropNativeModule, runtimeType, RuntimeType } from "@koalaui/interop"; + +import { ArkBaseNode } from "./ArkBaseNode"; +import { SymbolGlyphAttribute, ResourceColor, FontWeight, SymbolEffect, SymbolEffectStrategy, SymbolRenderingStrategy } from "../../component"; +import { ArkSymbolGlyphPeer } from "../../component"; +import { Resource } from "global.resource"; + +export class ArkSymbolGlyphNode extends ArkBaseNode implements SymbolGlyphAttribute { + constructParam(...param: Object[]): this { + InteropNativeModule._NativeLog("list constructParam enter") + return this; + } + getPeer() : ArkSymbolGlyphPeer { + return this.peer as ArkSymbolGlyphPeer + } + initialize(value?: Resource): this { + const value_casted = value as (Resource | undefined) + this.getPeer()?.setSymbolGlyphOptionsAttribute(value_casted) + this.markDirty(); + return this; + } + allowChildTypes(): string[] { + return ["SymbolGlyphItem", "SymbolGlyphItemGroup"]; + } + setSymbolGlyphOptions(value?: Resource): this { + const value_casted = value as (Resource | undefined) + this.getPeer()?.setSymbolGlyphOptionsAttribute(value_casted) + this.markDirty(); + return this; + } + fontSize(value: number | string | Resource | undefined): this { + const value_casted = value as (number | string | Resource | undefined) + this.getPeer()?.fontSizeAttribute(value_casted) + this.markDirty(); + return this; + } + fontColor(value: Array | undefined): this { + const value_casted = value as (Array | undefined) + this.getPeer()?.fontColorAttribute(value_casted) + this.markDirty(); + return this; + } + fontWeight(value: number | FontWeight | string | undefined): this { + const value_casted = value as (number | FontWeight | string | undefined) + this.getPeer()?.fontWeightAttribute(value_casted) + this.markDirty(); + return this; + } + effectStrategy(value: SymbolEffectStrategy | undefined): this { + const value_casted = value as (SymbolEffectStrategy | undefined) + this.getPeer()?.effectStrategyAttribute(value_casted) + this.markDirty(); + return this; + } + renderingStrategy(value: SymbolRenderingStrategy | undefined): this { + const value_casted = value as (SymbolRenderingStrategy | undefined) + this.getPeer()?.renderingStrategyAttribute(value_casted) + this.markDirty(); + return this; + } + minFontScale(value: number | Resource | undefined): this { + const value_casted = value as (number | Resource | undefined) + this.getPeer()?.minFontScaleAttribute(value_casted) + this.markDirty(); + return this; + } + maxFontScale(value: number | Resource | undefined): this { + const value_casted = value as (number | Resource | undefined) + this.getPeer()?.maxFontScaleAttribute(value_casted) + this.markDirty(); + return this; + } + symbolEffect(symbolEffect: SymbolEffect | undefined, isActive?: number | boolean | undefined): this { + const symbolEffect_type = runtimeType(symbolEffect) + const isActive_type = runtimeType(isActive) + if (((RuntimeType.OBJECT == symbolEffect_type) || (RuntimeType.UNDEFINED == symbolEffect_type)) && ((RuntimeType.BOOLEAN == isActive_type) || (RuntimeType.UNDEFINED == isActive_type))) { + const symbolEffect_casted = symbolEffect as (SymbolEffect | undefined) + const isActive_casted = isActive as (boolean | undefined) + this.getPeer()?.symbolEffect0Attribute(symbolEffect_casted, isActive_casted) + this.markDirty(); + return this + } + if (((RuntimeType.OBJECT == symbolEffect_type) || (RuntimeType.UNDEFINED == symbolEffect_type)) && ((RuntimeType.NUMBER == isActive_type) || (RuntimeType.UNDEFINED == isActive_type))) { + const symbolEffect_casted = symbolEffect as (SymbolEffect | undefined) + const triggerValue_casted = isActive as (number | undefined) + this.getPeer()?.symbolEffect1Attribute(symbolEffect_casted, triggerValue_casted) + this.markDirty(); + return this + } + return this; + } +} \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextAreaNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextAreaNode.ts index 51490e1d5ad4ced4393d1acdc7f14a12d3fbf0ad..ace81c6fb1e0f0df4df19840b46a31380e19b299 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextAreaNode.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextAreaNode.ts @@ -32,6 +32,7 @@ export class ArkTextAreaNode extends ArkBaseNode implements TextAreaAttribute initialize(options?: TextAreaOptions): this { const options_casted = options as (TextAreaOptions | undefined) this.getPeer()?.setTextAreaOptionsAttribute(options_casted) + this.markDirty(); return this; } allowChildTypes(): string[] { @@ -39,248 +40,308 @@ export class ArkTextAreaNode extends ArkBaseNode implements TextAreaAttribute } placeholderColor(value: ResourceColor | undefined): this { this.getPeer().placeholderColorAttribute(value); + this.markDirty(); return this; } placeholderFont(value: Font | undefined): this { this.getPeer().placeholderFontAttribute(value); + this.markDirty(); return this; } enterKeyType(value: EnterKeyType | undefined): this { this.getPeer().enterKeyTypeAttribute(value); + this.markDirty(); return this; } textAlign(value: TextAlign | undefined): this { this.getPeer().textAlignAttribute(value); + this.markDirty(); return this; } caretColor(value: ResourceColor | undefined): this { this.getPeer().caretColorAttribute(value); + this.markDirty(); return this; } fontColor(value: ResourceColor | undefined): this { this.getPeer().fontColorAttribute(value); + this.markDirty(); return this; } fontSize(value: Length | undefined): this { this.getPeer().fontSizeAttribute(value); + this.markDirty(); return this; } fontStyle(value: FontStyle | undefined): this { this.getPeer().fontStyleAttribute(value); + this.markDirty(); return this; } fontWeight(value: number | FontWeight | string | undefined): this { this.getPeer().fontWeightAttribute(value); + this.markDirty(); return this; } fontFamily(value: ResourceStr | undefined): this { this.getPeer().fontFamilyAttribute(value); + this.markDirty(); return this; } textOverflow(value: TextOverflow | undefined): this { this.getPeer().textOverflowAttribute(value); + this.markDirty(); return this; } textIndent(value: Dimension | undefined): this { this.getPeer().textIndentAttribute(value); + this.markDirty(); return this; } caretStyle(value: CaretStyle | undefined): this { this.getPeer().caretStyleAttribute(value); + this.markDirty(); return this; } selectedBackgroundColor(value: ResourceColor | undefined): this { this.getPeer().selectedBackgroundColorAttribute(value); + this.markDirty(); return this; } onSubmit(value: ((enterKey: EnterKeyType) => void) | TextAreaSubmitCallback | undefined): this { - // todo: type check - // this.getPeer().onSubmit0Attribute(value); - // this.getPeer().onSubmit1Attribute(value); + const value_casted = value as (TextAreaSubmitCallback | undefined) + this.getPeer()?.onSubmit1Attribute(value_casted) + this.markDirty(); return this; } onChange(value: EditableTextOnChangeCallback | undefined): this { this.getPeer().onChangeAttribute(value); + this.markDirty(); return this; } onTextSelectionChange(value: ((first: number, last: number) => void) | undefined): this { this.getPeer().onTextSelectionChangeAttribute(value); + this.markDirty(); return this; } onContentScroll(value: ((first: number, last: number) => void) | undefined): this { this.getPeer().onContentScrollAttribute(value); + this.markDirty(); return this; } onEditChange(value: ((isVisible: boolean) => void) | undefined): this { this.getPeer().onEditChangeAttribute(value); + this.markDirty(); return this; } onCopy(value: ((breakpoints: string) => void) | undefined): this { this.getPeer().onCopyAttribute(value); + this.markDirty(); return this; } onCut(value: ((breakpoints: string) => void) | undefined): this { this.getPeer().onCutAttribute(value); + this.markDirty(); return this; } onPaste(value: ((value: string, event: PasteEvent) => void) | undefined): this { this.getPeer().onPasteAttribute(value); + this.markDirty(); return this; } copyOption(value: CopyOptions | undefined): this { this.getPeer().copyOptionAttribute(value); + this.markDirty(); return this; } enableKeyboardOnFocus(value: boolean | undefined): this { this.getPeer().enableKeyboardOnFocusAttribute(value); + this.markDirty(); return this; } maxLength(value: number | undefined): this { this.getPeer().maxLengthAttribute(value); + this.markDirty(); return this; } style(value: TextContentStyle | undefined): this { this.getPeer().styleAttribute(value); + this.markDirty(); return this; } barState(value: BarState | undefined): this { this.getPeer().barStateAttribute(value); + this.markDirty(); return this; } selectionMenuHidden(value: boolean | undefined): this { this.getPeer().selectionMenuHiddenAttribute(value); + this.markDirty(); return this; } minFontSize(value: number | string | Resource | undefined): this { this.getPeer().minFontSizeAttribute(value); + this.markDirty(); return this; } maxFontSize(value: number | string | Resource | undefined): this { this.getPeer().maxFontSizeAttribute(value); + this.markDirty(); return this; } minFontScale(value: number | Resource | undefined): this { this.getPeer().minFontScaleAttribute(value); + this.markDirty(); return this; } maxFontScale(value: number | Resource | undefined): this { this.getPeer().maxFontScaleAttribute(value); + this.markDirty(); return this; } heightAdaptivePolicy(value: TextHeightAdaptivePolicy | undefined): this { this.getPeer().heightAdaptivePolicyAttribute(value); + this.markDirty(); return this; } maxLines(value: number | undefined): this { this.getPeer().maxLinesAttribute(value); + this.markDirty(); return this; } wordBreak(value: WordBreak | undefined): this { this.getPeer().wordBreakAttribute(value); + this.markDirty(); return this; } lineBreakStrategy(value: LineBreakStrategy | undefined): this { this.getPeer().lineBreakStrategyAttribute(value); + this.markDirty(); return this; } decoration(value: TextDecorationOptions | undefined): this { this.getPeer().decorationAttribute(value); + this.markDirty(); return this; } letterSpacing(value: number | string | Resource | undefined): this { this.getPeer().letterSpacingAttribute(value); + this.markDirty(); return this; } lineSpacing(value: LengthMetrics | undefined): this { this.getPeer().lineSpacingAttribute(value); + this.markDirty(); return this; } lineHeight(value: number | string | Resource | undefined): this { this.getPeer().lineHeightAttribute(value); + this.markDirty(); return this; } type(value: TextAreaType | undefined): this { this.getPeer().typeAttribute(value); + this.markDirty(); return this; } enableAutoFill(value: boolean | undefined): this { this.getPeer().enableAutoFillAttribute(value); + this.markDirty(); return this; } contentType(value: ContentType | undefined): this { this.getPeer().contentTypeAttribute(value); + this.markDirty(); return this; } fontFeature(value: string | undefined): this { this.getPeer().fontFeatureAttribute(value); + this.markDirty(); return this; } onWillInsert(value: ((parameter: InsertValue) => boolean) | undefined): this { this.getPeer().onWillInsertAttribute(value); + this.markDirty(); return this; } onDidInsert(value: ((parameter: InsertValue) => void) | undefined): this { this.getPeer().onDidInsertAttribute(value); + this.markDirty(); return this; } onWillDelete(value: ((parameter: DeleteValue) => boolean) | undefined): this { this.getPeer().onWillDeleteAttribute(value); + this.markDirty(); return this; } onDidDelete(value: ((parameter: DeleteValue) => void) | undefined): this { this.getPeer().onDidDeleteAttribute(value); + this.markDirty(); return this; } editMenuOptions(value: EditMenuOptions | undefined): this { this.getPeer().editMenuOptionsAttribute(value); + this.markDirty(); return this; } enablePreviewText(value: boolean | undefined): this { this.getPeer().enablePreviewTextAttribute(value); + this.markDirty(); return this; } enableHapticFeedback(value: boolean | undefined): this { this.getPeer().enableHapticFeedbackAttribute(value); + this.markDirty(); return this; } autoCapitalizationMode(value: AutoCapitalizationMode | undefined): this { this.getPeer().autoCapitalizationModeAttribute(value); + this.markDirty(); return this; } halfLeading(value: boolean | undefined): this { this.getPeer().halfLeadingAttribute(value); + this.markDirty(); return this; } ellipsisMode(value: EllipsisMode | undefined): this { this.getPeer().ellipsisModeAttribute(value); + this.markDirty(); return this; } stopBackPress(value: boolean | undefined): this { this.getPeer().stopBackPressAttribute(value); + this.markDirty(); return this; } onWillChange(value: ((parameter: EditableTextChangeValue) => boolean) | undefined): this { this.getPeer().onWillChangeAttribute(value); + this.markDirty(); return this; } keyboardAppearance(value: KeyboardAppearance | undefined): this { this.getPeer().keyboardAppearanceAttribute(value); + this.markDirty(); return this; } inputFilter(value: ResourceStr | undefined, error?: ((breakpoints: string) => void) | undefined): this { this.getPeer().inputFilterAttribute(value, error); + this.markDirty(); return this; } showCounter(value: boolean | undefined, options?: InputCounterOptions | undefined): this { this.getPeer().showCounterAttribute(value, options); + this.markDirty(); return this; } customKeyboard(value: CustomBuilder | undefined, options?: KeyboardOptions | undefined): this { this.getPeer().customKeyboardAttribute(value, options); + this.markDirty(); return this; } _onChangeEvent_text(callback: (text: ResourceStr) => void): void { this.getPeer()._onChangeEvent_textAttribute(callback); + this.markDirty(); return; } } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextInputNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextInputNode.ts index d492d39c59852e10e7d225ff67b0625f60e8e1b9..4e08849521b7d5748be8233e1cc0003ce6c9e5c2 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextInputNode.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextInputNode.ts @@ -32,6 +32,7 @@ export class ArkTextInputNode extends ArkBaseNode implements TextInputAttribute initialize(options?: TextInputOptions): this { const options_casted = options as (TextInputOptions | undefined) this.getPeer()?.setTextInputOptionsAttribute(options_casted) + this.markDirty(); return this; } allowChildTypes(): string[] { @@ -39,296 +40,377 @@ export class ArkTextInputNode extends ArkBaseNode implements TextInputAttribute } type(value: InputType | undefined): this { this.getPeer().typeAttribute(value); + this.markDirty(); return this; } contentType(value: ContentType | undefined): this { this.getPeer().contentTypeAttribute(value); + this.markDirty(); return this; } placeholderColor(value: ResourceColor | undefined): this { this.getPeer().placeholderColorAttribute(value); + this.markDirty(); return this; } textOverflow(value: TextOverflow | undefined): this { this.getPeer().textOverflowAttribute(value); + this.markDirty(); return this; } textIndent(value: Dimension | undefined): this { this.getPeer().textIndentAttribute(value); + this.markDirty(); return this; } placeholderFont(value: Font | undefined): this { this.getPeer().placeholderFontAttribute(value); + this.markDirty(); return this; } enterKeyType(value: EnterKeyType | undefined): this { this.getPeer().enterKeyTypeAttribute(value); + this.markDirty(); return this; } caretColor(value: ResourceColor | undefined): this { this.getPeer().caretColorAttribute(value); + this.markDirty(); return this; } onEditChanged(value: ((isVisible: boolean) => void) | undefined): this { this.getPeer().onEditChangedAttribute(value); + this.markDirty(); return this; } onEditChange(value: ((isVisible: boolean) => void) | undefined): this { this.getPeer().onEditChangeAttribute(value); + this.markDirty(); return this; } onSubmit(value: OnSubmitCallback | undefined): this { this.getPeer().onSubmitAttribute(value); + this.markDirty(); return this; } onChange(value: EditableTextOnChangeCallback | undefined): this { this.getPeer().onChangeAttribute(value); + this.markDirty(); return this; } onTextSelectionChange(value: OnTextSelectionChangeCallback | undefined): this { this.getPeer().onTextSelectionChangeAttribute(value); + this.markDirty(); return this; } onContentScroll(value: OnContentScrollCallback | undefined): this { this.getPeer().onContentScrollAttribute(value); + this.markDirty(); return this; } maxLength(value: number | undefined): this { this.getPeer().maxLengthAttribute(value); + this.markDirty(); return this; } fontColor(value: ResourceColor | undefined): this { this.getPeer().fontColorAttribute(value); + this.markDirty(); return this; } fontSize(value: Length | undefined): this { this.getPeer().fontSizeAttribute(value); + this.markDirty(); return this; } fontStyle(value: FontStyle | undefined): this { this.getPeer().fontStyleAttribute(value); + this.markDirty(); return this; } fontWeight(value: number | FontWeight | string | undefined): this { this.getPeer().fontWeightAttribute(value); + this.markDirty(); return this; } fontFamily(value: ResourceStr | undefined): this { this.getPeer().fontFamilyAttribute(value); + this.markDirty(); return this; } onCopy(value: ((breakpoints: string) => void) | undefined): this { this.getPeer().onCopyAttribute(value); + this.markDirty(); return this; } onCut(value: ((breakpoints: string) => void) | undefined): this { this.getPeer().onCutAttribute(value); + this.markDirty(); return this; } onPaste(value: OnPasteCallback | undefined): this { this.getPeer().onPasteAttribute(value); + this.markDirty(); return this; } copyOption(value: CopyOptions | undefined): this { this.getPeer().copyOptionAttribute(value); + this.markDirty(); return this; } showPasswordIcon(value: boolean | undefined): this { this.getPeer().showPasswordIconAttribute(value); + this.markDirty(); return this; } textAlign(value: TextAlign | undefined): this { this.getPeer().textAlignAttribute(value); + this.markDirty(); return this; } style(value: TextContentStyle | TextInputStyle | undefined): this { this.getPeer().styleAttribute(value); + this.markDirty(); return this; } caretStyle(value: CaretStyle | undefined): this { this.getPeer().caretStyleAttribute(value); + this.markDirty(); return this; } selectedBackgroundColor(value: ResourceColor | undefined): this { this.getPeer().selectedBackgroundColorAttribute(value); + this.markDirty(); return this; } caretPosition(value: number | undefined): this { this.getPeer().caretPositionAttribute(value); + this.markDirty(); return this; } enableKeyboardOnFocus(value: boolean | undefined): this { this.getPeer().enableKeyboardOnFocusAttribute(value); + this.markDirty(); return this; } passwordIcon(value: PasswordIcon | undefined): this { this.getPeer().passwordIconAttribute(value); + this.markDirty(); return this; } showError(value: ResourceStr | undefined): this { this.getPeer().showErrorAttribute(value); + this.markDirty(); return this; } showUnit(value: CustomBuilder | undefined): this { this.getPeer().showUnitAttribute(value); + this.markDirty(); return this; } showUnderline(value: boolean | undefined): this { this.getPeer().showUnderlineAttribute(value); + this.markDirty(); return this; } underlineColor(value: ResourceColor | UnderlineColor | undefined): this { this.getPeer().underlineColorAttribute(value); + this.markDirty(); return this; } selectionMenuHidden(value: boolean | undefined): this { this.getPeer().selectionMenuHiddenAttribute(value); + this.markDirty(); return this; } barState(value: BarState | undefined): this { this.getPeer().barStateAttribute(value); + this.markDirty(); return this; } maxLines(value: number | undefined): this { this.getPeer().maxLinesAttribute(value); + this.markDirty(); return this; } wordBreak(value: WordBreak | undefined): this { this.getPeer().wordBreakAttribute(value); + this.markDirty(); return this; } lineBreakStrategy(value: LineBreakStrategy | undefined): this { this.getPeer().lineBreakStrategyAttribute(value); + this.markDirty(); return this; } cancelButton(value: CancelButtonOptions | CancelButtonSymbolOptions | undefined): this { - // todo: type check - // this.getPeer().cancelButton0Attribute(value); - // this.getPeer().cancelButton1Attribute(value); + if ((value === undefined) || (value instanceof CancelButtonOptions)) { + const value_casted = value as (CancelButtonOptions | undefined) + this.getPeer()?.cancelButton0Attribute(value_casted) + this.markDirty(); + return this + } + if ((value === undefined) || (value instanceof CancelButtonSymbolOptions)) { + const value_casted = value as (CancelButtonSymbolOptions | undefined) + this.getPeer()?.cancelButton1Attribute(value_casted) + this.markDirty(); + return this + } return this; } selectAll(value: boolean | undefined): this { this.getPeer().selectAllAttribute(value); + this.markDirty(); return this; } minFontSize(value: number | string | Resource | undefined): this { this.getPeer().minFontSizeAttribute(value); + this.markDirty(); return this; } maxFontSize(value: number | string | Resource | undefined): this { this.getPeer().maxFontSizeAttribute(value); + this.markDirty(); return this; } minFontScale(value: number | Resource | undefined): this { this.getPeer().minFontScaleAttribute(value); + this.markDirty(); return this; } maxFontScale(value: number | Resource | undefined): this { this.getPeer().maxFontScaleAttribute(value); + this.markDirty(); return this; } heightAdaptivePolicy(value: TextHeightAdaptivePolicy | undefined): this { this.getPeer().heightAdaptivePolicyAttribute(value); + this.markDirty(); return this; } enableAutoFill(value: boolean | undefined): this { this.getPeer().enableAutoFillAttribute(value); + this.markDirty(); return this; } decoration(value: TextDecorationOptions | undefined): this { this.getPeer().decorationAttribute(value); + this.markDirty(); return this; } letterSpacing(value: number | string | Resource | undefined): this { this.getPeer().letterSpacingAttribute(value); + this.markDirty(); return this; } lineHeight(value: number | string | Resource | undefined): this { this.getPeer().lineHeightAttribute(value); + this.markDirty(); return this; } passwordRules(value: string | undefined): this { this.getPeer().passwordRulesAttribute(value); + this.markDirty(); return this; } fontFeature(value: string | undefined): this { this.getPeer().fontFeatureAttribute(value); + this.markDirty(); return this; } showPassword(value: boolean | undefined): this { this.getPeer().showPasswordAttribute(value); + this.markDirty(); return this; } onSecurityStateChange(value: ((isVisible: boolean) => void) | undefined): this { this.getPeer().onSecurityStateChangeAttribute(value); + this.markDirty(); return this; } onWillInsert(value: ((parameter: InsertValue) => boolean) | undefined): this { this.getPeer().onWillInsertAttribute(value); + this.markDirty(); return this; } onDidInsert(value: ((parameter: InsertValue) => void) | undefined): this { this.getPeer().onDidInsertAttribute(value); + this.markDirty(); return this; } onWillDelete(value: ((parameter: DeleteValue) => boolean) | undefined): this { this.getPeer().onWillDeleteAttribute(value); + this.markDirty(); return this; } onDidDelete(value: ((parameter: DeleteValue) => void) | undefined): this { this.getPeer().onDidDeleteAttribute(value); + this.markDirty(); return this; } editMenuOptions(value: EditMenuOptions | undefined): this { this.getPeer().editMenuOptionsAttribute(value); + this.markDirty(); return this; } enablePreviewText(value: boolean | undefined): this { this.getPeer().enablePreviewTextAttribute(value); + this.markDirty(); return this; } enableHapticFeedback(value: boolean | undefined): this { this.getPeer().enableHapticFeedbackAttribute(value); + this.markDirty(); return this; } autoCapitalizationMode(value: AutoCapitalizationMode | undefined): this { this.getPeer().autoCapitalizationModeAttribute(value); + this.markDirty(); return this; } halfLeading(value: boolean | undefined): this { this.getPeer().halfLeadingAttribute(value); + this.markDirty(); return this; } ellipsisMode(value: EllipsisMode | undefined): this { this.getPeer().ellipsisModeAttribute(value); + this.markDirty(); return this; } stopBackPress(value: boolean | undefined): this { this.getPeer().stopBackPressAttribute(value); + this.markDirty(); return this; } onWillChange(value: ((parameter: EditableTextChangeValue) => boolean) | undefined): this { this.getPeer().onWillChangeAttribute(value); + this.markDirty(); return this; } keyboardAppearance(value: KeyboardAppearance | undefined): this { this.getPeer().keyboardAppearanceAttribute(value); + this.markDirty(); return this; } inputFilter(value: ResourceStr | undefined, error?: ((breakpoints: string) => void) | undefined): this { this.getPeer().inputFilterAttribute(value, error); + this.markDirty(); return this; } customKeyboard(value: CustomBuilder | undefined, options?: KeyboardOptions | undefined): this { this.getPeer().customKeyboardAttribute(value, options); + this.markDirty(); return this; } showCounter(value: boolean | undefined, options?: InputCounterOptions | undefined): this { this.getPeer().showCounterAttribute(value, options); + this.markDirty(); return this; } _onChangeEvent_text(callback: (text: ResourceStr) => void): void { this.getPeer()._onChangeEvent_textAttribute(callback); + this.markDirty(); return; } } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextNode.ts index 536c9c9dbe8e380ff8ad5445929dfdf8fbf717e6..be7ed849d040d1882cb38c5fed1b8f68c29e6800 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextNode.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkTextNode.ts @@ -53,6 +53,7 @@ export class ArkTextNode extends ArkBaseNode implements TextAttribute { const content_casted = content as (string | Resource | undefined) const value_casted = value as (TextOptions | undefined) this.getPeer()?.setTextOptionsAttribute(content_casted, value_casted) + this.markDirty(); return this; } allowChildTypes(): string[] { @@ -65,6 +66,7 @@ export class ArkTextNode extends ArkBaseNode implements TextAttribute { const fontValue_casted = fontValue as (Font | undefined) const options_casted = options as (FontSettingOptions | undefined) this.getPeer()?.font1Attribute(fontValue_casted, options_casted) + this.markDirty(); return this } return this; @@ -72,36 +74,43 @@ export class ArkTextNode extends ArkBaseNode implements TextAttribute { fontColor(value: ResourceColor | undefined): this { const value_casted = value as (ResourceColor | undefined) this.getPeer()?.fontColorAttribute(value_casted) + this.markDirty(); return this; } fontSize(value: number | string | Resource | undefined): this { const value_casted = value as (number | string | Resource | undefined) this.getPeer()?.fontSizeAttribute(value_casted) + this.markDirty(); return this; } minFontSize(value: number | string | Resource | undefined): this { const value_casted = value as (number | string | Resource | undefined) this.getPeer()?.minFontSizeAttribute(value_casted) + this.markDirty(); return this; } maxFontSize(value: number | string | Resource | undefined): this { const value_casted = value as (number | string | Resource | undefined) this.getPeer()?.maxFontSizeAttribute(value_casted) + this.markDirty(); return this; } minFontScale(value: number | Resource | undefined): this { const value_casted = value as (number | Resource | undefined) this.getPeer()?.minFontScaleAttribute(value_casted) + this.markDirty(); return this; } maxFontScale(value: number | Resource | undefined): this { const value_casted = value as (number | Resource | undefined) this.getPeer()?.maxFontScaleAttribute(value_casted) + this.markDirty(); return this; } fontStyle(value: FontStyle | undefined): this { const value_casted = value as (FontStyle | undefined) this.getPeer()?.fontStyleAttribute(value_casted) + this.markDirty(); return this; } fontWeight(weight: number | FontWeight | string | undefined, options?: FontSettingOptions): this { @@ -111,6 +120,7 @@ export class ArkTextNode extends ArkBaseNode implements TextAttribute { const weight_casted = weight as (number | FontWeight | string | undefined) const options_casted = options as (FontSettingOptions | undefined) this.getPeer()?.fontWeight1Attribute(weight_casted, options_casted) + this.markDirty(); return this } return this; @@ -118,167 +128,200 @@ export class ArkTextNode extends ArkBaseNode implements TextAttribute { lineSpacing(value: LengthMetrics | undefined): this { const value_casted = value as (LengthMetrics | undefined) this.getPeer()?.lineSpacingAttribute(value_casted) + this.markDirty(); return this; } textAlign(value : TextAlign | undefined) : this { const value_casted = value as (TextAlign | undefined) this.getPeer()?.textAlignAttribute(value_casted) + this.markDirty(); return this; } lineHeight(value: number | string | Resource | undefined): this { const value_casted = value as (TextAlign | undefined) this.getPeer()?.textAlignAttribute(value_casted) + this.markDirty(); return this; } textOverflow(value: TextOverflowOptions | undefined): this { const value_casted = value as (TextOverflowOptions | undefined) this.getPeer()?.textOverflowAttribute(value_casted) + this.markDirty(); return this; } fontFamily(value: string | Resource | undefined): this { const value_casted = value as (string | Resource | undefined) this.getPeer()?.fontFamilyAttribute(value_casted) + this.markDirty(); return this; } maxLines(value: number | undefined): this { const value_casted = value as (number | undefined) this.getPeer()?.maxLinesAttribute(value_casted) + this.markDirty(); return this; } decoration(value: DecorationStyleInterface | undefined): this { const value_casted = value as (DecorationStyleInterface | undefined) this.getPeer()?.decorationAttribute(value_casted) + this.markDirty(); return this; } letterSpacing(value: number | string | undefined): this { const value_casted = value as (number | string | undefined) this.getPeer()?.letterSpacingAttribute(value_casted) + this.markDirty(); return this; } textCase(value: TextCase | undefined): this { const value_casted = value as (TextCase | undefined) this.getPeer()?.textCaseAttribute(value_casted) + this.markDirty(); return this; } baselineOffset(value: number | string | undefined): this { const value_casted = value as (number | string | undefined) this.getPeer()?.baselineOffsetAttribute(value_casted) + this.markDirty(); return this; } copyOption(value: CopyOptions | undefined): this { const value_casted = value as (CopyOptions | undefined) this.getPeer()?.copyOptionAttribute(value_casted) + this.markDirty(); return this; } draggable(value: boolean | undefined): this { const value_casted = value as (boolean | undefined) this.getPeer()?.draggableAttribute(value_casted) + this.markDirty(); return this; } textShadow(value: ShadowOptions | Array | undefined): this { const value_casted = value as (ShadowOptions | Array | undefined) this.getPeer()?.textShadowAttribute(value_casted) + this.markDirty(); return this; } heightAdaptivePolicy(value: TextHeightAdaptivePolicy | undefined): this { const value_casted = value as (TextHeightAdaptivePolicy | undefined) this.getPeer()?.heightAdaptivePolicyAttribute(value_casted) + this.markDirty(); return this; } textIndent(value: Length | undefined): this { const value_casted = value as (Length | undefined) this.getPeer()?.textIndentAttribute(value_casted) + this.markDirty(); return this; } wordBreak(value: WordBreak | undefined): this { const value_casted = value as (WordBreak | undefined) this.getPeer()?.wordBreakAttribute(value_casted) + this.markDirty(); return this; } lineBreakStrategy(value: LineBreakStrategy | undefined): this { const value_casted = value as (LineBreakStrategy | undefined) this.getPeer()?.lineBreakStrategyAttribute(value_casted) + this.markDirty(); return this; } onCopy(value: ((breakpoints: string) => void) | undefined): this { const value_casted = value as (((breakpoints: string) => void) | undefined) this.getPeer()?.onCopyAttribute(value_casted) + this.markDirty(); return this; } caretColor(value: ResourceColor | undefined): this { const value_casted = value as (ResourceColor | undefined) this.getPeer()?.caretColorAttribute(value_casted) + this.markDirty(); return this; } selectedBackgroundColor(value: ResourceColor | undefined): this { const value_casted = value as (ResourceColor | undefined) this.getPeer()?.selectedBackgroundColorAttribute(value_casted) + this.markDirty(); return this; } ellipsisMode(value: EllipsisMode | undefined): this { const value_casted = value as (EllipsisMode | undefined) this.getPeer()?.ellipsisModeAttribute(value_casted) + this.markDirty(); return this; } enableDataDetector(value: boolean | undefined): this { const value_casted = value as (boolean | undefined) this.getPeer()?.enableDataDetectorAttribute(value_casted) + this.markDirty(); return this; } dataDetectorConfig(value: TextDataDetectorConfig | undefined): this { const value_casted = value as (TextDataDetectorConfig | undefined) this.getPeer()?.dataDetectorConfigAttribute(value_casted) + this.markDirty(); return this; } onTextSelectionChange(value: ((first: number, last: number) => void) | undefined): this { const value_casted = value as (((first: number,last: number) => void) | undefined) this.getPeer()?.onTextSelectionChangeAttribute(value_casted) + this.markDirty(); return this; } fontFeature(value: string | undefined): this { const value_casted = value as (string | undefined) this.getPeer()?.fontFeatureAttribute(value_casted) + this.markDirty(); return this; } marqueeOptions(value: TextMarqueeOptions | undefined): this { const value_casted = value as (TextMarqueeOptions | undefined) this.getPeer()?.marqueeOptionsAttribute(value_casted) + this.markDirty(); return this; } onMarqueeStateChange(value: ((parameter: MarqueeState) => void) | undefined): this { const value_casted = value as (((parameter: MarqueeState) => void) | undefined) this.getPeer()?.onMarqueeStateChangeAttribute(value_casted) + this.markDirty(); return this; } privacySensitive(value: boolean | undefined): this { const value_casted = value as (boolean | undefined) this.getPeer()?.privacySensitiveAttribute(value_casted) + this.markDirty(); return this; } textSelectable(value: TextSelectableMode | undefined): this { const value_casted = value as (TextSelectableMode | undefined) this.getPeer()?.textSelectableAttribute(value_casted) + this.markDirty(); return this; } editMenuOptions(value: EditMenuOptions | undefined): this { const value_casted = value as (EditMenuOptions | undefined) this.getPeer()?.editMenuOptionsAttribute(value_casted) + this.markDirty(); return this; } halfLeading(value: boolean | undefined): this { const value_casted = value as (boolean | undefined) this.getPeer()?.halfLeadingAttribute(value_casted) + this.markDirty(); return this; } enableHapticFeedback(value: boolean | undefined): this { const value_casted = value as (boolean | undefined) this.getPeer()?.enableHapticFeedbackAttribute(value_casted) + this.markDirty(); return this; } selection(selectionStart: number | undefined, selectionEnd: number | undefined): this { const selectionStart_casted = selectionStart as (number | undefined) const selectionEnd_casted = selectionEnd as (number | undefined) this.getPeer()?.selectionAttribute(selectionStart_casted, selectionEnd_casted) + this.markDirty(); return this; } bindSelectionMenu(spanType: TextSpanType | undefined, content: CustomBuilder | undefined, responseType: TextResponseType | undefined, options?: SelectionMenuOptions): this { @@ -287,6 +330,7 @@ export class ArkTextNode extends ArkBaseNode implements TextAttribute { const responseType_casted = responseType as (TextResponseType | undefined) const options_casted = options as (SelectionMenuOptions) this.getPeer()?.bindSelectionMenuAttribute(spanType_casted, content_casted, responseType_casted, options_casted) + this.markDirty(); return this; } } diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni index 81c6fc60a420e53b9c08519aca9cf7cd21a48da0..355f30722994669a5e1ea667a6f032ec2455a23b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni @@ -375,7 +375,6 @@ arkui_files = [ "arkui-preprocessed/arkui/handwritten/modifiers/ArkBlankNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkColumnModifier.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkColumnNode.ets", - "arkui-preprocessed/arkui/handwritten/modifiers/ArkSymbolGlyphModifier.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkListNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkBadgeNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkQRCodeNode.ets", @@ -405,8 +404,8 @@ arkui_files = [ "arkui-preprocessed/arkui/handwritten/modifiers/ArkSearchNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkStackNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkSwiperNode.ets", - "arkui-preprocessed/arkui/handwritten/modifiers/ArkSymbolGlyphModifier.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkSymbolGlyphNode.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkMarqueeNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkTextAreaNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkTextInputNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkTextNode.ets", diff --git a/frameworks/core/interfaces/native/implementation/frame_node_accessor.cpp b/frameworks/core/interfaces/native/implementation/frame_node_accessor.cpp index 3a065d19bf9fc25743117367a28e4db7c82106f3..0cca65f7006428b742ff537f15841a79ee9c97df 100644 --- a/frameworks/core/interfaces/native/implementation/frame_node_accessor.cpp +++ b/frameworks/core/interfaces/native/implementation/frame_node_accessor.cpp @@ -631,6 +631,8 @@ static GENERATED_Ark_NodeType ParseNodeType(std::string& type) { "TextArea", GENERATED_ARKUI_TEXT_AREA }, { "TextInput", GENERATED_ARKUI_TEXT_INPUT }, { "Text", GENERATED_ARKUI_TEXT }, + { "Marquee", GENERATED_ARKUI_MARQUEE }, + { "SymbolGlyph", GENERATED_ARKUI_SYMBOL_GLYPH }, { "XComponent", GENERATED_ARKUI_XCOMPONENT }, { "QRCode", GENERATED_ARKUI_QRCODE }, { "Badge", GENERATED_ARKUI_BADGE },