From f39fd59c9d1d4d4ed94f9f67c0f5f8f3f050dfc5 Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 17 Dec 2024 14:50:09 +0000 Subject: [PATCH 01/10] update arkoala-arkts/arkui/src/generated/index.ts. Signed-off-by: Sokolova Irina --- arkoala-arkts/arkui/src/generated/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkoala-arkts/arkui/src/generated/index.ts b/arkoala-arkts/arkui/src/generated/index.ts index 5d35042a1..5cbc4d349 100644 --- a/arkoala-arkts/arkui/src/generated/index.ts +++ b/arkoala-arkts/arkui/src/generated/index.ts @@ -281,7 +281,7 @@ export * from "./ArkPageTransitionInterfaces" export * from "./ArkPanelInterfaces" export * from "./ArkParticleInterfaces" export * from "./ArkPasteButtonInterfaces" -export * from "./ArkPathInterfaces" +// export * from "./ArkPathInterfaces" export * from "./ArkPatternLockInterfaces" export * from "./ArkPluginComponentInterfaces" export * from "./ArkPolygonInterfaces" -- Gitee From 97c4d07d0f28ff9f2a6cda8e0b74d9f27ea5b7c2 Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 17 Dec 2024 14:51:14 +0000 Subject: [PATCH 02/10] add arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts. Signed-off-by: Sokolova Irina --- .../handwritten/ArkNavDestinationContext.ts | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts diff --git a/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts b/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts new file mode 100644 index 000000000..dbeed9a8b --- /dev/null +++ b/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts @@ -0,0 +1,105 @@ +import { int32, int64, float32 } from "@koalaui/common" +import { KInt, KPointer, KBoolean, KStringPtr, wrapCallback } from "@koalaui/interop" +import { NodeAttach, remember } from "@koalaui/runtime" +import { Resource, PixelMap, SymbolGlyphModifier, ResourceStr, + CustomBuilder, TitleHeight, Length, Scroller, + CommonMethod, LayoutSafeAreaType, LayoutSafeAreaEdge } from "../generated" +import { NavigationMenuItem, SystemBarStyle, NavigationTitleOptions, ToolbarItem, NavigationToolbarOptions } from "./ArkNavigationInterfaces" +import { NavDestinationContext } from "./ArkNavDestinationContext" + +export interface NavDestinationCommonTitle { + main: string | Resource; + sub: string | Resource; +} +export interface NavDestinationCustomTitle { + builder: CustomBuilder; + height: TitleHeight | Length; +} +export class NavigationSystemTransitionType { + static readonly DEFAULT: NavigationSystemTransitionType = new NavigationSystemTransitionType(0,0) + static readonly NONE: NavigationSystemTransitionType = new NavigationSystemTransitionType(1,1) + static readonly TITLE: NavigationSystemTransitionType = new NavigationSystemTransitionType(2,2) + static readonly CONTENT: NavigationSystemTransitionType = new NavigationSystemTransitionType(3,3) + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): NavigationSystemTransitionType { + if ((arg0) == (NavigationSystemTransitionType.DEFAULT.value)) + return NavigationSystemTransitionType.DEFAULT + if ((arg0) == (NavigationSystemTransitionType.NONE.value)) + return NavigationSystemTransitionType.NONE + if ((arg0) == (NavigationSystemTransitionType.TITLE.value)) + return NavigationSystemTransitionType.TITLE + if ((arg0) == (NavigationSystemTransitionType.CONTENT.value)) + return NavigationSystemTransitionType.CONTENT + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): NavigationSystemTransitionType { + if ((arg0) == (NavigationSystemTransitionType.DEFAULT.ordinal)) + return NavigationSystemTransitionType.DEFAULT + if ((arg0) == (NavigationSystemTransitionType.NONE.ordinal)) + return NavigationSystemTransitionType.NONE + if ((arg0) == (NavigationSystemTransitionType.TITLE.ordinal)) + return NavigationSystemTransitionType.TITLE + if ((arg0) == (NavigationSystemTransitionType.CONTENT.ordinal)) + return NavigationSystemTransitionType.CONTENT + throw new Error(`Enum member '${arg0}' not found`) + } +} +export class NavDestinationMode { + static readonly STANDARD: NavDestinationMode = new NavDestinationMode(0,0) + static readonly DIALOG: NavDestinationMode = new NavDestinationMode(1,1) + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): NavDestinationMode { + if ((arg0) == (NavDestinationMode.STANDARD.value)) + return NavDestinationMode.STANDARD + if ((arg0) == (NavDestinationMode.DIALOG.value)) + return NavDestinationMode.DIALOG + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): NavDestinationMode { + if ((arg0) == (NavDestinationMode.STANDARD.ordinal)) + return NavDestinationMode.STANDARD + if ((arg0) == (NavDestinationMode.DIALOG.ordinal)) + return NavDestinationMode.DIALOG + throw new Error(`Enum member '${arg0}' not found`) + } +} +export type NavDestinationInterface = () => NavDestinationAttribute; +export interface RouteMapConfig { + name: string; + pageSourceFile: string; + data: Object; +} +export interface NestedScrollInfo { + parent: Scroller; + child: Scroller; +} +export interface NavDestinationAttribute extends CommonMethod { + hideTitleBar: boolean; + onShown: Function0; + onHidden: Function0; + onBackPressed: Function0; + mode: NavDestinationMode; + backButtonIcon: ResourceStr | PixelMap | SymbolGlyphModifier; + menus: Array | CustomBuilder; + onReady: Function1; + onWillAppear: Function0; + onWillDisappear: Function0; + onWillShow: Function0; + onWillHide: Function0; + systemBarStyle: SystemBarStyle | undefined; + recoverable: boolean | undefined; + systemTransition: NavigationSystemTransitionType; + bindToScrollable: Array; + bindToNestedScrollable: Array; + +} -- Gitee From bc8ac1405b9a27a493c7a61b09e5c5e655699fa8 Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 17 Dec 2024 14:51:34 +0000 Subject: [PATCH 03/10] update arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts. Signed-off-by: Sokolova Irina --- .../handwritten/ArkNavDestinationContext.ts | 106 +----------------- 1 file changed, 2 insertions(+), 104 deletions(-) diff --git a/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts b/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts index dbeed9a8b..e5e3d5881 100644 --- a/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts +++ b/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationContext.ts @@ -1,105 +1,3 @@ -import { int32, int64, float32 } from "@koalaui/common" -import { KInt, KPointer, KBoolean, KStringPtr, wrapCallback } from "@koalaui/interop" -import { NodeAttach, remember } from "@koalaui/runtime" -import { Resource, PixelMap, SymbolGlyphModifier, ResourceStr, - CustomBuilder, TitleHeight, Length, Scroller, - CommonMethod, LayoutSafeAreaType, LayoutSafeAreaEdge } from "../generated" -import { NavigationMenuItem, SystemBarStyle, NavigationTitleOptions, ToolbarItem, NavigationToolbarOptions } from "./ArkNavigationInterfaces" -import { NavDestinationContext } from "./ArkNavDestinationContext" +export class NavDestinationContext{ -export interface NavDestinationCommonTitle { - main: string | Resource; - sub: string | Resource; -} -export interface NavDestinationCustomTitle { - builder: CustomBuilder; - height: TitleHeight | Length; -} -export class NavigationSystemTransitionType { - static readonly DEFAULT: NavigationSystemTransitionType = new NavigationSystemTransitionType(0,0) - static readonly NONE: NavigationSystemTransitionType = new NavigationSystemTransitionType(1,1) - static readonly TITLE: NavigationSystemTransitionType = new NavigationSystemTransitionType(2,2) - static readonly CONTENT: NavigationSystemTransitionType = new NavigationSystemTransitionType(3,3) - constructor(value: int32, ordinal: int32) { - this.value = value - this.ordinal = ordinal - } - public readonly value: int32 - public readonly ordinal: int32 - public static of(arg0: int32): NavigationSystemTransitionType { - if ((arg0) == (NavigationSystemTransitionType.DEFAULT.value)) - return NavigationSystemTransitionType.DEFAULT - if ((arg0) == (NavigationSystemTransitionType.NONE.value)) - return NavigationSystemTransitionType.NONE - if ((arg0) == (NavigationSystemTransitionType.TITLE.value)) - return NavigationSystemTransitionType.TITLE - if ((arg0) == (NavigationSystemTransitionType.CONTENT.value)) - return NavigationSystemTransitionType.CONTENT - throw new Error(`Enum member '${arg0}' not found`) - } - public static ofOrdinal(arg0: int32): NavigationSystemTransitionType { - if ((arg0) == (NavigationSystemTransitionType.DEFAULT.ordinal)) - return NavigationSystemTransitionType.DEFAULT - if ((arg0) == (NavigationSystemTransitionType.NONE.ordinal)) - return NavigationSystemTransitionType.NONE - if ((arg0) == (NavigationSystemTransitionType.TITLE.ordinal)) - return NavigationSystemTransitionType.TITLE - if ((arg0) == (NavigationSystemTransitionType.CONTENT.ordinal)) - return NavigationSystemTransitionType.CONTENT - throw new Error(`Enum member '${arg0}' not found`) - } -} -export class NavDestinationMode { - static readonly STANDARD: NavDestinationMode = new NavDestinationMode(0,0) - static readonly DIALOG: NavDestinationMode = new NavDestinationMode(1,1) - constructor(value: int32, ordinal: int32) { - this.value = value - this.ordinal = ordinal - } - public readonly value: int32 - public readonly ordinal: int32 - public static of(arg0: int32): NavDestinationMode { - if ((arg0) == (NavDestinationMode.STANDARD.value)) - return NavDestinationMode.STANDARD - if ((arg0) == (NavDestinationMode.DIALOG.value)) - return NavDestinationMode.DIALOG - throw new Error(`Enum member '${arg0}' not found`) - } - public static ofOrdinal(arg0: int32): NavDestinationMode { - if ((arg0) == (NavDestinationMode.STANDARD.ordinal)) - return NavDestinationMode.STANDARD - if ((arg0) == (NavDestinationMode.DIALOG.ordinal)) - return NavDestinationMode.DIALOG - throw new Error(`Enum member '${arg0}' not found`) - } -} -export type NavDestinationInterface = () => NavDestinationAttribute; -export interface RouteMapConfig { - name: string; - pageSourceFile: string; - data: Object; -} -export interface NestedScrollInfo { - parent: Scroller; - child: Scroller; -} -export interface NavDestinationAttribute extends CommonMethod { - hideTitleBar: boolean; - onShown: Function0; - onHidden: Function0; - onBackPressed: Function0; - mode: NavDestinationMode; - backButtonIcon: ResourceStr | PixelMap | SymbolGlyphModifier; - menus: Array | CustomBuilder; - onReady: Function1; - onWillAppear: Function0; - onWillDisappear: Function0; - onWillShow: Function0; - onWillHide: Function0; - systemBarStyle: SystemBarStyle | undefined; - recoverable: boolean | undefined; - systemTransition: NavigationSystemTransitionType; - bindToScrollable: Array; - bindToNestedScrollable: Array; - -} +} \ No newline at end of file -- Gitee From b6ee7ada4f8b73e6765187c5052c611f975513ec Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 17 Dec 2024 14:52:03 +0000 Subject: [PATCH 04/10] add arkoala-arkts/arkui/src/handwritten/ArkNavDestinationInterfaces.ts. Signed-off-by: Sokolova Irina --- .../ArkNavDestinationInterfaces.ts | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 arkoala-arkts/arkui/src/handwritten/ArkNavDestinationInterfaces.ts diff --git a/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationInterfaces.ts b/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationInterfaces.ts new file mode 100644 index 000000000..dbeed9a8b --- /dev/null +++ b/arkoala-arkts/arkui/src/handwritten/ArkNavDestinationInterfaces.ts @@ -0,0 +1,105 @@ +import { int32, int64, float32 } from "@koalaui/common" +import { KInt, KPointer, KBoolean, KStringPtr, wrapCallback } from "@koalaui/interop" +import { NodeAttach, remember } from "@koalaui/runtime" +import { Resource, PixelMap, SymbolGlyphModifier, ResourceStr, + CustomBuilder, TitleHeight, Length, Scroller, + CommonMethod, LayoutSafeAreaType, LayoutSafeAreaEdge } from "../generated" +import { NavigationMenuItem, SystemBarStyle, NavigationTitleOptions, ToolbarItem, NavigationToolbarOptions } from "./ArkNavigationInterfaces" +import { NavDestinationContext } from "./ArkNavDestinationContext" + +export interface NavDestinationCommonTitle { + main: string | Resource; + sub: string | Resource; +} +export interface NavDestinationCustomTitle { + builder: CustomBuilder; + height: TitleHeight | Length; +} +export class NavigationSystemTransitionType { + static readonly DEFAULT: NavigationSystemTransitionType = new NavigationSystemTransitionType(0,0) + static readonly NONE: NavigationSystemTransitionType = new NavigationSystemTransitionType(1,1) + static readonly TITLE: NavigationSystemTransitionType = new NavigationSystemTransitionType(2,2) + static readonly CONTENT: NavigationSystemTransitionType = new NavigationSystemTransitionType(3,3) + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): NavigationSystemTransitionType { + if ((arg0) == (NavigationSystemTransitionType.DEFAULT.value)) + return NavigationSystemTransitionType.DEFAULT + if ((arg0) == (NavigationSystemTransitionType.NONE.value)) + return NavigationSystemTransitionType.NONE + if ((arg0) == (NavigationSystemTransitionType.TITLE.value)) + return NavigationSystemTransitionType.TITLE + if ((arg0) == (NavigationSystemTransitionType.CONTENT.value)) + return NavigationSystemTransitionType.CONTENT + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): NavigationSystemTransitionType { + if ((arg0) == (NavigationSystemTransitionType.DEFAULT.ordinal)) + return NavigationSystemTransitionType.DEFAULT + if ((arg0) == (NavigationSystemTransitionType.NONE.ordinal)) + return NavigationSystemTransitionType.NONE + if ((arg0) == (NavigationSystemTransitionType.TITLE.ordinal)) + return NavigationSystemTransitionType.TITLE + if ((arg0) == (NavigationSystemTransitionType.CONTENT.ordinal)) + return NavigationSystemTransitionType.CONTENT + throw new Error(`Enum member '${arg0}' not found`) + } +} +export class NavDestinationMode { + static readonly STANDARD: NavDestinationMode = new NavDestinationMode(0,0) + static readonly DIALOG: NavDestinationMode = new NavDestinationMode(1,1) + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): NavDestinationMode { + if ((arg0) == (NavDestinationMode.STANDARD.value)) + return NavDestinationMode.STANDARD + if ((arg0) == (NavDestinationMode.DIALOG.value)) + return NavDestinationMode.DIALOG + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): NavDestinationMode { + if ((arg0) == (NavDestinationMode.STANDARD.ordinal)) + return NavDestinationMode.STANDARD + if ((arg0) == (NavDestinationMode.DIALOG.ordinal)) + return NavDestinationMode.DIALOG + throw new Error(`Enum member '${arg0}' not found`) + } +} +export type NavDestinationInterface = () => NavDestinationAttribute; +export interface RouteMapConfig { + name: string; + pageSourceFile: string; + data: Object; +} +export interface NestedScrollInfo { + parent: Scroller; + child: Scroller; +} +export interface NavDestinationAttribute extends CommonMethod { + hideTitleBar: boolean; + onShown: Function0; + onHidden: Function0; + onBackPressed: Function0; + mode: NavDestinationMode; + backButtonIcon: ResourceStr | PixelMap | SymbolGlyphModifier; + menus: Array | CustomBuilder; + onReady: Function1; + onWillAppear: Function0; + onWillDisappear: Function0; + onWillShow: Function0; + onWillHide: Function0; + systemBarStyle: SystemBarStyle | undefined; + recoverable: boolean | undefined; + systemTransition: NavigationSystemTransitionType; + bindToScrollable: Array; + bindToNestedScrollable: Array; + +} -- Gitee From 74483414b74e9f0f546da58ee7571db183ec4907 Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 17 Dec 2024 14:52:59 +0000 Subject: [PATCH 05/10] add arkoala-arkts/arkui/src/handwritten/ArkNavigationInterfaces.ts. Signed-off-by: Sokolova Irina --- .../handwritten/ArkNavigationInterfaces.ts | 333 ++++++++++++++++++ 1 file changed, 333 insertions(+) create mode 100644 arkoala-arkts/arkui/src/handwritten/ArkNavigationInterfaces.ts diff --git a/arkoala-arkts/arkui/src/handwritten/ArkNavigationInterfaces.ts b/arkoala-arkts/arkui/src/handwritten/ArkNavigationInterfaces.ts new file mode 100644 index 000000000..9ba79af2e --- /dev/null +++ b/arkoala-arkts/arkui/src/handwritten/ArkNavigationInterfaces.ts @@ -0,0 +1,333 @@ +import { int32, int64, float32 } from "@koalaui/common" +import { KInt, KPointer, KBoolean, KStringPtr, wrapCallback } from "@koalaui/interop" +import { NodeAttach, remember } from "@koalaui/runtime" +import { Resource } from "../generated/ArkResourceInterfaces" +import { CustomBuilder, SymbolGlyphModifier, BlurStyle, CommonMethod, LayoutSafeAreaType, LayoutSafeAreaEdge } from "../generated/ArkCommonInterfaces" +import { TitleHeight } from "../generated/ArkEnumsInterfaces" +import { Length, ResourceStr, ResourceColor, Dimension } from "../generated/ArkUnitsInterfaces" +import { Callback_Void, Callback_PopInfo_Void, Tuple_Dimension_Dimension, Callback_NavigationTitleMode_Void, Callback_Boolean_Void, Callback_NavigationMode_Void, Callback_String_Unknown_Void, Type_NavigationAttribute_customNavContentTransition_delegate, Callback_NavigationTransitionProxy_Void } from "../generated" +// import { NavPathStack } from "./ArkNavPathStackMaterialized" +import { LengthMetrics, TextModifier } from "../generated/ArkArkui-externalInterfaces" +import { PixelMap } from "../generated/ArkPixelMapMaterialized" +import { NavDestinationMode } from "../generated" //./ArkNavDestinationInterfaces" +import { NavDestinationContext } from "./ArkNavDestinationContext" +import { NavigationTransitionProxy } from "../generated" //./ArkNavigationTransitionProxyMaterialized" + +export interface SystemBarStyle { + __SystemBarStyleStub: string; +} +export interface NavigationCommonTitle { + main: string | Resource; + sub: string | Resource; +} +export interface NavigationCustomTitle { + builder: CustomBuilder; + height: TitleHeight | Length; +} +export class NavigationMode { + static readonly STACK: NavigationMode = new NavigationMode(0,0) + static readonly Stack: NavigationMode = NavigationMode.STACK + static readonly SPLIT: NavigationMode = new NavigationMode(1,1) + static readonly Split: NavigationMode = NavigationMode.SPLIT + static readonly AUTO: NavigationMode = new NavigationMode(2,2) + static readonly Auto: NavigationMode = NavigationMode.AUTO + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): NavigationMode { + if ((arg0) == (NavigationMode.STACK.value)) + return NavigationMode.STACK + if ((arg0) == (NavigationMode.SPLIT.value)) + return NavigationMode.SPLIT + if ((arg0) == (NavigationMode.AUTO.value)) + return NavigationMode.AUTO + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): NavigationMode { + if ((arg0) == (NavigationMode.STACK.ordinal)) + return NavigationMode.STACK + if ((arg0) == (NavigationMode.SPLIT.ordinal)) + return NavigationMode.SPLIT + if ((arg0) == (NavigationMode.AUTO.ordinal)) + return NavigationMode.AUTO + throw new Error(`Enum member '${arg0}' not found`) + } +} +export class NavBarPosition { + static readonly START: NavBarPosition = new NavBarPosition(0,0) + static readonly Start: NavBarPosition = NavBarPosition.START + static readonly END: NavBarPosition = new NavBarPosition(1,1) + static readonly End: NavBarPosition = NavBarPosition.END + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): NavBarPosition { + if ((arg0) == (NavBarPosition.START.value)) + return NavBarPosition.START + if ((arg0) == (NavBarPosition.END.value)) + return NavBarPosition.END + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): NavBarPosition { + if ((arg0) == (NavBarPosition.START.ordinal)) + return NavBarPosition.START + if ((arg0) == (NavBarPosition.END.ordinal)) + return NavBarPosition.END + throw new Error(`Enum member '${arg0}' not found`) + } +} +export class NavigationTitleMode { + static readonly FREE: NavigationTitleMode = new NavigationTitleMode(0,0) + static readonly Free: NavigationTitleMode = NavigationTitleMode.FREE + static readonly FULL: NavigationTitleMode = new NavigationTitleMode(1,1) + static readonly Full: NavigationTitleMode = NavigationTitleMode.FULL + static readonly MINI: NavigationTitleMode = new NavigationTitleMode(2,2) + static readonly Mini: NavigationTitleMode = NavigationTitleMode.MINI + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): NavigationTitleMode { + if ((arg0) == (NavigationTitleMode.FREE.value)) + return NavigationTitleMode.FREE + if ((arg0) == (NavigationTitleMode.FULL.value)) + return NavigationTitleMode.FULL + if ((arg0) == (NavigationTitleMode.MINI.value)) + return NavigationTitleMode.MINI + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): NavigationTitleMode { + if ((arg0) == (NavigationTitleMode.FREE.ordinal)) + return NavigationTitleMode.FREE + if ((arg0) == (NavigationTitleMode.FULL.ordinal)) + return NavigationTitleMode.FULL + if ((arg0) == (NavigationTitleMode.MINI.ordinal)) + return NavigationTitleMode.MINI + throw new Error(`Enum member '${arg0}' not found`) + } +} +export interface NavigationMenuItem { + value: string | Resource; + icon?: string | Resource; + symbolIcon?: SymbolGlyphModifier; + isEnabled?: boolean; + action?: Function0; +} +export interface PopInfo { + info: NavPathInfo; + result: Object; +} +export interface NavPathInfo { + name: string; + param?: object; + onPop?: Function1; + isEntry?: boolean; +} +export class LaunchMode { + static readonly STANDARD: LaunchMode = new LaunchMode(0,0) + static readonly MOVE_TO_TOP_SINGLETON: LaunchMode = new LaunchMode(1,1) + static readonly POP_TO_SINGLETON: LaunchMode = new LaunchMode(2,2) + static readonly NEW_INSTANCE: LaunchMode = new LaunchMode(3,3) + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): LaunchMode { + if ((arg0) == (LaunchMode.STANDARD.value)) + return LaunchMode.STANDARD + if ((arg0) == (LaunchMode.MOVE_TO_TOP_SINGLETON.value)) + return LaunchMode.MOVE_TO_TOP_SINGLETON + if ((arg0) == (LaunchMode.POP_TO_SINGLETON.value)) + return LaunchMode.POP_TO_SINGLETON + if ((arg0) == (LaunchMode.NEW_INSTANCE.value)) + return LaunchMode.NEW_INSTANCE + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): LaunchMode { + if ((arg0) == (LaunchMode.STANDARD.ordinal)) + return LaunchMode.STANDARD + if ((arg0) == (LaunchMode.MOVE_TO_TOP_SINGLETON.ordinal)) + return LaunchMode.MOVE_TO_TOP_SINGLETON + if ((arg0) == (LaunchMode.POP_TO_SINGLETON.ordinal)) + return LaunchMode.POP_TO_SINGLETON + if ((arg0) == (LaunchMode.NEW_INSTANCE.ordinal)) + return LaunchMode.NEW_INSTANCE + throw new Error(`Enum member '${arg0}' not found`) + } +} +export interface NavigationOptions { + launchMode?: LaunchMode; + animated?: boolean; +} +export type NavBar = string; +export type InterceptionShowCallback = (from: NavDestinationContext | NavBar, to: NavDestinationContext | NavBar, operation: NavigationOperation, isAnimated: boolean) => void; +export type InterceptionModeCallback = (mode: NavigationMode) => void; +export interface NavigationInterception { + willShow?: InterceptionShowCallback; + didShow?: InterceptionShowCallback; + modeChange?: InterceptionModeCallback; +} +export interface NavigationInterface { + invoke(): NavigationAttribute; + +} +export class ToolbarItemStatus { + static readonly NORMAL: ToolbarItemStatus = new ToolbarItemStatus(0,0) + static readonly DISABLED: ToolbarItemStatus = new ToolbarItemStatus(1,1) + static readonly ACTIVE: ToolbarItemStatus = new ToolbarItemStatus(2,2) + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): ToolbarItemStatus { + if ((arg0) == (ToolbarItemStatus.NORMAL.value)) + return ToolbarItemStatus.NORMAL + if ((arg0) == (ToolbarItemStatus.DISABLED.value)) + return ToolbarItemStatus.DISABLED + if ((arg0) == (ToolbarItemStatus.ACTIVE.value)) + return ToolbarItemStatus.ACTIVE + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): ToolbarItemStatus { + if ((arg0) == (ToolbarItemStatus.NORMAL.ordinal)) + return ToolbarItemStatus.NORMAL + if ((arg0) == (ToolbarItemStatus.DISABLED.ordinal)) + return ToolbarItemStatus.DISABLED + if ((arg0) == (ToolbarItemStatus.ACTIVE.ordinal)) + return ToolbarItemStatus.ACTIVE + throw new Error(`Enum member '${arg0}' not found`) + } +} +export class NavigationOperation { + static readonly PUSH: NavigationOperation = new NavigationOperation(1,0) + static readonly POP: NavigationOperation = new NavigationOperation(2,1) + static readonly REPLACE: NavigationOperation = new NavigationOperation(3,2) + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): NavigationOperation { + if ((arg0) == (NavigationOperation.PUSH.value)) + return NavigationOperation.PUSH + if ((arg0) == (NavigationOperation.POP.value)) + return NavigationOperation.POP + if ((arg0) == (NavigationOperation.REPLACE.value)) + return NavigationOperation.REPLACE + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): NavigationOperation { + if ((arg0) == (NavigationOperation.PUSH.ordinal)) + return NavigationOperation.PUSH + if ((arg0) == (NavigationOperation.POP.ordinal)) + return NavigationOperation.POP + if ((arg0) == (NavigationOperation.REPLACE.ordinal)) + return NavigationOperation.REPLACE + throw new Error(`Enum member '${arg0}' not found`) + } +} +export interface ToolbarItem { + value: ResourceStr; + icon?: ResourceStr; + symbolIcon?: SymbolGlyphModifier; + action?: Function0; + status?: ToolbarItemStatus; + activeIcon?: ResourceStr; + activeSymbolIcon?: SymbolGlyphModifier; +} +export interface NavigationTitleOptions { + backgroundColor?: ResourceColor; + backgroundBlurStyle?: BlurStyle; + barStyle?: BarStyle; + paddingStart?: LengthMetrics; + paddingEnd?: LengthMetrics; + mainTitleModifier?: TextModifier; + subTitleModifier?: TextModifier; + enableHoverMode?: boolean +} +export class BarStyle { + static readonly STANDARD: BarStyle = new BarStyle(0,0) + static readonly STACK: BarStyle = new BarStyle(1,1) + static readonly SAFE_AREA_PADDING: BarStyle = new BarStyle(2,2) + constructor(value: int32, ordinal: int32) { + this.value = value + this.ordinal = ordinal + } + public readonly value: int32 + public readonly ordinal: int32 + public static of(arg0: int32): BarStyle { + if ((arg0) == (BarStyle.STANDARD.value)) + return BarStyle.STANDARD + if ((arg0) == (BarStyle.STACK.value)) + return BarStyle.STACK + if ((arg0) == (BarStyle.SAFE_AREA_PADDING.value)) + return BarStyle.SAFE_AREA_PADDING + throw new Error(`Enum member '${arg0}' not found`) + } + public static ofOrdinal(arg0: int32): BarStyle { + if ((arg0) == (BarStyle.STANDARD.ordinal)) + return BarStyle.STANDARD + if ((arg0) == (BarStyle.STACK.ordinal)) + return BarStyle.STACK + if ((arg0) == (BarStyle.SAFE_AREA_PADDING.ordinal)) + return BarStyle.SAFE_AREA_PADDING + throw new Error(`Enum member '${arg0}' not found`) + } +} +export interface NavigationToolbarOptions { + backgroundColor?: ResourceColor; + backgroundBlurStyle?: BlurStyle; + barStyle?: BarStyle; +} +export interface NavigationAttribute extends CommonMethod { + navBarWidth: Length; + navBarPosition: NavBarPosition; + navBarWidthRange: [ Dimension, Dimension ]; + minContentWidth: Dimension; + mode: NavigationMode; + backButtonIcon: string | PixelMap | Resource | SymbolGlyphModifier; + hideNavBar: boolean; + subTitle: string; + hideTitleBar: boolean; + hideBackButton: boolean; + titleMode: NavigationTitleMode; + menus: Array | CustomBuilder; + toolBar: Object | CustomBuilder; + hideToolBar: boolean; + onTitleModeChange: Function1; + onNavBarStateChange: Function1; + onNavigationModeChange: Function1; + navDestination: Function2; + customNavContentTransition: Function3; + systemBarStyle: SystemBarStyle | undefined; + recoverable: boolean | undefined; + enableDragBar: boolean | undefined; + + +} +export interface NavigationAnimatedTransition { + onTransitionEnd?: Function1; + timeout?: number; + isInteractive?: boolean; + transition: Function1; +} +export interface NavContentInfo { + name?: string; + index: number; + mode?: NavDestinationMode; + param?: Object; + navDestinationId?: string; +} \ No newline at end of file -- Gitee From d955f9b57f113c124bab3f1e04755e559fe56af3 Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 17 Dec 2024 14:53:45 +0000 Subject: [PATCH 06/10] update arkoala-arkts/arkui/src/handwritten/index.ts. Signed-off-by: Sokolova Irina --- arkoala-arkts/arkui/src/handwritten/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arkoala-arkts/arkui/src/handwritten/index.ts b/arkoala-arkts/arkui/src/handwritten/index.ts index 86abb2a63..15fd85f37 100644 --- a/arkoala-arkts/arkui/src/handwritten/index.ts +++ b/arkoala-arkts/arkui/src/handwritten/index.ts @@ -1,3 +1,6 @@ export * from "./ArkPageTransition" export * from "./ArkPageTransitionData" export * from "./Router" +export * from "./ArkNavDestination" +// export * from "./ArkNavPathInfo" +// export * from "./ArkNavPathStack" -- Gitee From dbe6eb6144b3ad569ebb09c7793f3aa9d44dbe9c Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 17 Dec 2024 14:54:21 +0000 Subject: [PATCH 07/10] Create peers --- arkoala-arkts/arkui/src/handwritten/peers/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 arkoala-arkts/arkui/src/handwritten/peers/.keep diff --git a/arkoala-arkts/arkui/src/handwritten/peers/.keep b/arkoala-arkts/arkui/src/handwritten/peers/.keep new file mode 100644 index 000000000..e69de29bb -- Gitee From 4146c3bde3b89925b8b20cfab7d504c1620d94ea Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 17 Dec 2024 14:55:03 +0000 Subject: [PATCH 08/10] update arkoala-arkts/arkui/src/handwritten/peers/ArkNavDestinationPeer.ts. Signed-off-by: Sokolova Irina --- .../arkui/src/handwritten/peers/.keep | 0 .../peers/ArkNavDestinationPeer.ts | 332 ++++++++++++++++++ 2 files changed, 332 insertions(+) delete mode 100644 arkoala-arkts/arkui/src/handwritten/peers/.keep create mode 100644 arkoala-arkts/arkui/src/handwritten/peers/ArkNavDestinationPeer.ts diff --git a/arkoala-arkts/arkui/src/handwritten/peers/.keep b/arkoala-arkts/arkui/src/handwritten/peers/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/arkoala-arkts/arkui/src/handwritten/peers/ArkNavDestinationPeer.ts b/arkoala-arkts/arkui/src/handwritten/peers/ArkNavDestinationPeer.ts new file mode 100644 index 000000000..9e1a84f6b --- /dev/null +++ b/arkoala-arkts/arkui/src/handwritten/peers/ArkNavDestinationPeer.ts @@ -0,0 +1,332 @@ +/* + * Copyright (c) 2024 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 { int32 } from "@koalaui/common"; +import { KPointer } from "@koalaui/interop" +import { ArkCommonMethodAttributes, ArkCommonMethodPeer } from "../../generated/peers/ArkCommonPeer" +import { ComponentBase, } from "../../generated/ComponentBase" +import { PeerNode } from "../../generated/PeerNode" +import { NativeModule, TypeChecker } from "#components" +import { Serializer } from "../../generated/peers/Serializer" +import { CustomBuilder, LayoutSafeAreaEdge, LayoutSafeAreaType } from "../../generated" +import { NavDestinationCommonTitle, NavDestinationCustomTitle, NavDestinationMode, NavigationSystemTransitionType, NestedScrollInfo} from "../ArkNavDestinationInterfaces" +import { Resource, ResourceStr, Scroller, SymbolGlyphModifier } from "../../generated" +import { NavigationMenuItem, NavigationTitleOptions, NavigationToolbarOptions, SystemBarStyle, ToolbarItem } from "../ArkNavigationInterfaces" +import { PixelMap } from "../../generated/ArkPixelMapMaterialized" +import { isResource, runtimeType, RuntimeType } from "../../generated/peers/SerializerBase" +import { CallbackTransformer } from "../../generated/peers/CallbackTransformer" +import { NavDestinationContext } from "../ArkNavDestinationContext" + +export class ArkNavDestinationPeer extends ArkCommonMethodPeer { + protected constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { + super(peerPtr, id, name, flags) + } + public static create(component?: ComponentBase, flags: int32 = 0): ArkNavDestinationPeer { + const peerId = PeerNode.nextId() + const _peerPtr = NativeModule._NavDestination_construct(peerId, flags) + const _peer = new ArkNavDestinationPeer(_peerPtr, peerId, "NavDestination", flags) + component?.setPeer(_peer) + return _peer + } + setNavDestinationOptionsAttribute(): void { + NativeModule._NavDestinationInterface_setNavDestinationOptions(this.peer.ptr) + } + hideTitleBar0Attribute(value: boolean): void { + NativeModule._NavDestinationAttribute_hideTitleBar0(this.peer.ptr, value ? 1 : 0) + } + hideTitleBar1Attribute(hide: boolean, animated: boolean): void { + NativeModule._NavDestinationAttribute_hideTitleBar1(this.peer.ptr, hide ? 1 : 0, animated ? 1 : 0) + } + onShownAttribute(value: Function0): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + NativeModule._NavDestinationAttribute_onShown(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + onHiddenAttribute(value: Function0): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + NativeModule._NavDestinationAttribute_onHidden(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + onBackPressedAttribute(value: Function0): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + NativeModule._NavDestinationAttribute_onBackPressed(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + modeAttribute(value: NavDestinationMode): void { + NativeModule._NavDestinationAttribute_mode(this.peer.ptr, (value.value as int32)) + } + backButtonIconAttribute(value: ResourceStr | PixelMap | SymbolGlyphModifier): void { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + if (((RuntimeType.STRING == value_type)) || ((RuntimeType.OBJECT == value_type))) { + thisSerializer.writeInt8(0 as int32) + const value_0 = value as ResourceStr + let value_0_type : int32 = RuntimeType.UNDEFINED + value_0_type = runtimeType(value_0) + if (((RuntimeType.STRING == value_0_type))) { + thisSerializer.writeInt8(0 as int32) + const value_0_0 = value_0 as string + thisSerializer.writeString(value_0_0) + } + else if (((RuntimeType.OBJECT == value_0_type))) { + thisSerializer.writeInt8(1 as int32) + const value_0_1 = value_0 as Resource + thisSerializer.writeResource(value_0_1) + } + } + else if (((RuntimeType.OBJECT) == (value_type)) && (value instanceof PixelMap)) { + thisSerializer.writeInt8(1 as int32) + const value_1 = value as PixelMap + thisSerializer.writePixelMap(value_1) + } + else if (((RuntimeType.OBJECT) == (value_type)) && (TypeChecker.isSymbolGlyphModifier(value, false))) { + thisSerializer.writeInt8(2 as int32) + const value_2 = value as SymbolGlyphModifier + thisSerializer.writeSymbolGlyphModifier(value_2) + } + NativeModule._NavDestinationAttribute_backButtonIcon(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + menusAttribute(value: Array | CustomBuilder): void { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + if (((RuntimeType.OBJECT == value_type))) { + thisSerializer.writeInt8(0 as int32) + const value_0 = value as Array + thisSerializer.writeInt32(value_0.length as int32) + for (let i = 0; i < value_0.length; i++) { + const value_0_element = value_0[i] + thisSerializer.writeNavigationMenuItem(value_0_element) + } + } + else if (((RuntimeType.FUNCTION == value_type))) { + thisSerializer.writeInt8(1 as int32) + const value_1 = value as CustomBuilder + thisSerializer.holdAndWriteCallback(CallbackTransformer.transformFromCustomBuilder(value_1)) + } + NativeModule._NavDestinationAttribute_menus(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + onReadyAttribute(value: Function1): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + NativeModule._NavDestinationAttribute_onReady(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + onWillAppearAttribute(value: Function0): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + NativeModule._NavDestinationAttribute_onWillAppear(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + onWillDisappearAttribute(value: Function0): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + NativeModule._NavDestinationAttribute_onWillDisappear(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + onWillShowAttribute(value: Function0): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + NativeModule._NavDestinationAttribute_onWillShow(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + onWillHideAttribute(value: Function0): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + NativeModule._NavDestinationAttribute_onWillHide(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + systemBarStyleAttribute(value?: SystemBarStyle): void { + 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.writeSystemBarStyle(value_value) + } + NativeModule._NavDestinationAttribute_systemBarStyle(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + recoverableAttribute(value?: boolean): void { + 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.writeBoolean(value_value) + } + NativeModule._NavDestinationAttribute_recoverable(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + systemTransitionAttribute(value: NavigationSystemTransitionType): void { + NativeModule._NavDestinationAttribute_systemTransition(this.peer.ptr, (value.value as int32)) + } + bindToScrollableAttribute(value: Array): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.writeInt32(value.length as int32) + for (let i = 0; i < value.length; i++) { + const value_element = value[i] + thisSerializer.writeScroller(value_element) + } + NativeModule._NavDestinationAttribute_bindToScrollable(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + bindToNestedScrollableAttribute(value: Array): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.writeInt32(value.length as int32) + for (let i = 0; i < value.length; i++) { + const value_element = value[i] + thisSerializer.writeNestedScrollInfo(value_element) + } + NativeModule._NavDestinationAttribute_bindToNestedScrollable(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + titleAttribute(value: string | CustomBuilder | NavDestinationCommonTitle | NavDestinationCustomTitle | Resource, options?: NavigationTitleOptions): void { + const thisSerializer : Serializer = Serializer.hold() + let value_type : int32 = RuntimeType.UNDEFINED + value_type = runtimeType(value) + if (((RuntimeType.STRING == value_type))) { + thisSerializer.writeInt8(0 as int32) + const value_0 = value as string + thisSerializer.writeString(value_0) + } + else if (((RuntimeType.FUNCTION == value_type))) { + thisSerializer.writeInt8(1 as int32) + const value_1 = value as CustomBuilder + thisSerializer.holdAndWriteCallback(CallbackTransformer.transformFromCustomBuilder(value_1)) + } + else if (((RuntimeType.OBJECT) == (value_type)) && (TypeChecker.isNavDestinationCommonTitle(value, false, false))) { + thisSerializer.writeInt8(2 as int32) + const value_2 = value as NavDestinationCommonTitle + thisSerializer.writeNavDestinationCommonTitle(value_2) + } + else if (((RuntimeType.OBJECT) == (value_type)) && (TypeChecker.isNavDestinationCustomTitle(value, false, false))) { + thisSerializer.writeInt8(3 as int32) + const value_3 = value as NavDestinationCustomTitle + thisSerializer.writeNavDestinationCustomTitle(value_3) + } + else if (((RuntimeType.OBJECT) == (value_type)) && (isResource(value))) { + thisSerializer.writeInt8(4 as int32) + const value_4 = value as Resource + thisSerializer.writeResource(value_4) + } + let options_type : int32 = RuntimeType.UNDEFINED + options_type = runtimeType(options) + thisSerializer.writeInt8(options_type as int32) + if ((RuntimeType.UNDEFINED) != (options_type)) { + const options_value = options! + thisSerializer.writeNavigationTitleOptions(options_value) + } + NativeModule._NavDestinationAttribute_title(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + toolbarConfigurationAttribute(toolbarParam: Array | CustomBuilder, options?: NavigationToolbarOptions): void { + const thisSerializer : Serializer = Serializer.hold() + let toolbarParam_type : int32 = RuntimeType.UNDEFINED + toolbarParam_type = runtimeType(toolbarParam) + if (((RuntimeType.OBJECT == toolbarParam_type))) { + thisSerializer.writeInt8(0 as int32) + const toolbarParam_0 = toolbarParam as Array + thisSerializer.writeInt32(toolbarParam_0.length as int32) + for (let i = 0; i < toolbarParam_0.length; i++) { + const toolbarParam_0_element = toolbarParam_0[i] + thisSerializer.writeToolbarItem(toolbarParam_0_element) + } + } + else if (((RuntimeType.FUNCTION == toolbarParam_type))) { + thisSerializer.writeInt8(1 as int32) + const toolbarParam_1 = toolbarParam as CustomBuilder + thisSerializer.holdAndWriteCallback(CallbackTransformer.transformFromCustomBuilder(toolbarParam_1)) + } + let options_type : int32 = RuntimeType.UNDEFINED + options_type = runtimeType(options) + thisSerializer.writeInt8(options_type as int32) + if ((RuntimeType.UNDEFINED) != (options_type)) { + const options_value = options! + thisSerializer.writeNavigationToolbarOptions(options_value) + } + NativeModule._NavDestinationAttribute_toolbarConfiguration(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + hideToolBarAttribute(hide: boolean, animated?: boolean): void { + const thisSerializer : Serializer = Serializer.hold() + let animated_type : int32 = RuntimeType.UNDEFINED + animated_type = runtimeType(animated) + thisSerializer.writeInt8(animated_type as int32) + if ((RuntimeType.UNDEFINED) != (animated_type)) { + const animated_value = animated! + thisSerializer.writeBoolean(animated_value) + } + NativeModule._NavDestinationAttribute_hideToolBar(this.peer.ptr, hide ? 1 : 0, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + ignoreLayoutSafeAreaAttribute(types?: Array, edges?: Array): void { + const thisSerializer : Serializer = Serializer.hold() + let types_type : int32 = RuntimeType.UNDEFINED + types_type = runtimeType(types) + thisSerializer.writeInt8(types_type as int32) + if ((RuntimeType.UNDEFINED) != (types_type)) { + const types_value = types! + thisSerializer.writeInt32(types_value.length as int32) + for (let i = 0; i < types_value.length; i++) { + const types_value_element = types_value[i] + thisSerializer.writeInt32(types_value_element.ordinal) + } + } + let edges_type : int32 = RuntimeType.UNDEFINED + edges_type = runtimeType(edges) + thisSerializer.writeInt8(edges_type as int32) + if ((RuntimeType.UNDEFINED) != (edges_type)) { + const edges_value = edges! + thisSerializer.writeInt32(edges_value.length as int32) + for (let i = 0; i < edges_value.length; i++) { + const edges_value_element = edges_value[i] + thisSerializer.writeInt32(edges_value_element.ordinal) + } + } + NativeModule._NavDestinationAttribute_ignoreLayoutSafeArea(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length()) + thisSerializer.release() + } + applyAttributes(attributes: T): void { + super.applyAttributes(attributes) + } +} +export interface ArkNavDestinationAttributes extends ArkCommonMethodAttributes { + hideTitleBar?: boolean + onShown?: Function0 + onHidden?: Function0 + onBackPressed?: Function0 + mode?: NavDestinationMode + backButtonIcon?: ResourceStr | PixelMap | SymbolGlyphModifier + menus?: Array | CustomBuilder + onReady?: Function1 + onWillAppear?: Function0 + onWillDisappear?: Function0 + onWillShow?: Function0 + onWillHide?: Function0 + systemBarStyle?: SystemBarStyle | undefined + recoverable?: boolean | undefined + systemTransition?: NavigationSystemTransitionType + bindToScrollable?: Array + bindToNestedScrollable?: Array +} -- Gitee From 69bcb81da128f9e36c67d60b8499300d95acc135 Mon Sep 17 00:00:00 2001 From: Sokolova Irina Date: Tue, 17 Dec 2024 15:01:30 +0000 Subject: [PATCH 09/10] add arkoala-arkts/arkui/src/handwritten/ArkNavPathStack.ts. Signed-off-by: Sokolova Irina --- .../arkui/src/handwritten/ArkNavPathStack.ts | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 arkoala-arkts/arkui/src/handwritten/ArkNavPathStack.ts diff --git a/arkoala-arkts/arkui/src/handwritten/ArkNavPathStack.ts b/arkoala-arkts/arkui/src/handwritten/ArkNavPathStack.ts new file mode 100644 index 000000000..e5a2429d2 --- /dev/null +++ b/arkoala-arkts/arkui/src/handwritten/ArkNavPathStack.ts @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * Interface representing the result of a navigation pop action. + */ +interface PopResult {} + +/** + * Interface representing the information of a navigation path. + */ +interface NavPathInfo { + name: string // The name of the navigation path + onPop: (info: PopInfo) => void // Callback function triggered when the path is popped +} + +/** + * Interface representing the information passed when a navigation path is popped. + */ +interface PopInfo { + info: NavPathInfo // The navigation path information + result: PopResult // The result of the pop action +} + +/** + * Interface for navigation interception handling. + */ +interface NavigationInterception {} + +/** + * Class representing a stack for managing navigation paths. + */ +export class NavPathStack { + private singleElement?: NavPathInfo // Single navigation path in the stack + private parentStack?: NavPathStack // Reference to the parent stack + private interception?: NavigationInterception // Navigation interception handler + private animationsDisabled: boolean = false // Flag to disable animations + + /** + * Constructor to initialize the NavPathStack. + * @param parentStack Optional parent stack. + */ + constructor(parentStack?: NavPathStack) { + this.parentStack = parentStack + } + + /** + * Adds a new navigation path to the stack. + * @param info The navigation path information to add. + */ + pushPath(info: NavPathInfo): void { + this.singleElement = info + } + + /** + * Adds a new navigation destination asynchronously. + * @param info The navigation path information to add. + * @returns A promise that resolves when the operation is complete. + */ + pushDestination(info: NavPathInfo): Promise { + this.pushPath(info) + return Promise.resolve() + } + + /** + * Replaces the current navigation path with a new one. + * @param info The navigation path information to replace with. + */ + replacePath(info: NavPathInfo): void { + this.singleElement = info + } + + /** + * Pops the top navigation path from the stack and triggers its onPop callback. + */ + popToIndex(): void { + const popped = this.singleElement + if (popped) { + const popInfo: PopInfo = { info: popped, result: {} } + popped.onPop?.(popInfo) + this.singleElement = undefined + } + } + + /** + * Clears the stack by removing the current navigation path and triggering its onPop callback. + */ + clear(): void { + const popped = this.singleElement + if (popped) { + const popInfo: PopInfo = { info: popped, result: {} } + popped.onPop?.(popInfo) + this.singleElement = undefined + } + } + + /** + * Retrieves all path names in the stack. + * @returns An array of path names. + */ + getAllPathName(): string[] { + const element = this.singleElement + if (element != undefined && element.name != undefined) { + return [element.name] + } + return [] + } + + /** + * Retrieves the size of the stack. + * @returns The number of elements in the stack. + */ + size(): number { + return this.singleElement ? 1 : 0 + } + + /** + * Enables or disables animations for navigation actions. + * @param value A boolean indicating whether to disable animations. + */ + disableAnimation(value: boolean): void { + this.animationsDisabled = value + } + + /** + * Sets a navigation interception handler. + * @param interception The interception handler to set. + */ + setInterception(interception: NavigationInterception): void { + this.interception = interception + } + + /** + * Retrieves the parent stack of the current stack. + * @returns The parent stack, or undefined if there is none. + */ + getParent(): NavPathStack | undefined { + return this.parentStack + } +} -- Gitee From 61d575af6a0e26c0d4eb61b72af500ac2b2155d5 Mon Sep 17 00:00:00 2001 From: sokolovairina Date: Tue, 17 Dec 2024 18:07:47 +0300 Subject: [PATCH 10/10] edit index.ts --- arkoala-arkts/arkui/src/handwritten/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkoala-arkts/arkui/src/handwritten/index.ts b/arkoala-arkts/arkui/src/handwritten/index.ts index 15fd85f37..293e81a38 100644 --- a/arkoala-arkts/arkui/src/handwritten/index.ts +++ b/arkoala-arkts/arkui/src/handwritten/index.ts @@ -1,6 +1,6 @@ export * from "./ArkPageTransition" export * from "./ArkPageTransitionData" export * from "./Router" -export * from "./ArkNavDestination" +// export * from "./ArkNavDestination" // export * from "./ArkNavPathInfo" // export * from "./ArkNavPathStack" -- Gitee