2023-08-24 13:38:03 +00:00
|
|
|
/*
|
2024-03-02 07:57:49 +00:00
|
|
|
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
2023-08-24 13:38:03 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @kit ArkUI
|
|
|
|
*/
|
|
|
|
|
2024-05-23 02:45:37 +00:00
|
|
|
|
2023-08-24 13:38:03 +00:00
|
|
|
|
2024-05-23 03:41:22 +00:00
|
|
|
|
2023-08-24 13:38:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Declaration of the menu item on the right side.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Declaration of the menu item on the right side.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-30 02:06:37 +00:00
|
|
|
export declare class EditableTitleBarMenuItem {
|
2023-08-24 13:38:03 +00:00
|
|
|
/**
|
|
|
|
* Icon resource for this menu item.
|
|
|
|
* @type { ResourceStr }.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Icon resource for this menu item.
|
|
|
|
* @type { ResourceStr }.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
value: ResourceStr;
|
|
|
|
|
2024-05-28 06:58:09 +00:00
|
|
|
/**
|
|
|
|
* Icon label for this menu item.
|
|
|
|
* @type { ?ResourceStr }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
label?: ResourceStr;
|
|
|
|
|
2023-08-24 13:38:03 +00:00
|
|
|
/**
|
|
|
|
* Whether to enable this menu item.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?boolean }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Whether to enable this menu item.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?boolean }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
isEnabled?: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback function when click on this menu item.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?() => void }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Callback function when click on this menu item.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?() => void }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
action?: () => void;
|
2023-10-24 01:46:28 +00:00
|
|
|
}
|
2023-08-24 13:38:03 +00:00
|
|
|
|
2024-03-02 07:57:49 +00:00
|
|
|
/**
|
|
|
|
* Declaration of the image item .
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-02 07:57:49 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
export type EditableTitleBarItem = EditableTitleBarMenuItem;
|
|
|
|
|
2023-08-24 13:38:03 +00:00
|
|
|
/**
|
|
|
|
* Declaration of the left icon type.
|
|
|
|
* @enum { EditableLeftIconType }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Declaration of the left icon type.
|
|
|
|
* @enum { EditableLeftIconType }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
export declare enum EditableLeftIconType {
|
|
|
|
/**
|
|
|
|
* The back type.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* The back type.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
Back = 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The cancel type.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* The cancel type.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
Cancel = 1
|
2023-10-24 01:46:28 +00:00
|
|
|
}
|
2023-08-24 13:38:03 +00:00
|
|
|
|
2024-03-07 08:33:00 +00:00
|
|
|
/**
|
|
|
|
* Indicates the options of the editable title bar.
|
|
|
|
*
|
|
|
|
* @interface EditableTitleBarOptions
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-07 08:33:00 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
export declare interface EditableTitleBarOptions {
|
|
|
|
/**
|
|
|
|
* Background color.
|
|
|
|
*
|
|
|
|
* @type { ?ResourceColor }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-07 08:33:00 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
backgroundColor?: ResourceColor;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Background blur style.
|
|
|
|
*
|
|
|
|
* @type { ?BlurStyle }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-07 08:33:00 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
backgroundBlurStyle?: BlurStyle;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the types of the safe area.
|
|
|
|
*
|
|
|
|
* @type { ?Array<SafeAreaType> }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-07 08:33:00 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
safeAreaTypes?: Array<SafeAreaType>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the edges of the safe area.
|
|
|
|
*
|
|
|
|
* @type { ?Array<SafeAreaEdge> }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-07 08:33:00 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
safeAreaEdges?: Array<SafeAreaEdge>;
|
|
|
|
}
|
|
|
|
|
2023-08-24 13:38:03 +00:00
|
|
|
/**
|
|
|
|
* Declaration of the editable title bar.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Declaration of the editable title bar.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
@Component
|
|
|
|
export declare struct EditableTitleBar {
|
|
|
|
/**
|
|
|
|
* Style of the left icon.
|
|
|
|
* @type { EditableLeftIconType }.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Style of the left icon.
|
|
|
|
* @type { EditableLeftIconType }.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
leftIconStyle: EditableLeftIconType;
|
|
|
|
|
2024-03-02 07:57:49 +00:00
|
|
|
/**
|
|
|
|
* Image item between the left icon and the title.
|
|
|
|
* @type { ?EditableTitleBarItem }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-02 07:57:49 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
imageItem?: EditableTitleBarItem;
|
|
|
|
|
2023-08-24 13:38:03 +00:00
|
|
|
/**
|
|
|
|
* Title of this title bar.
|
|
|
|
* @type { ResourceStr }.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Title of this title bar.
|
|
|
|
* @type { ResourceStr }.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
title: ResourceStr;
|
|
|
|
|
2024-03-02 07:57:49 +00:00
|
|
|
/**
|
|
|
|
* Sub-Title of this title bar.
|
|
|
|
* @type { ?ResourceStr }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-02 07:57:49 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
subtitle?: ResourceStr;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether to required the save icon.
|
|
|
|
* @type { boolean }
|
|
|
|
* @default true
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-02 07:57:49 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
isSaveIconRequired: boolean;
|
|
|
|
|
2023-08-24 13:38:03 +00:00
|
|
|
/**
|
|
|
|
* Menu items on the right side.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?Array<EditableTitleBarMenuItem> }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Menu items on the right side.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?Array<EditableTitleBarMenuItem> }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
menuItems?: Array<EditableTitleBarMenuItem>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback function when click on the save icon at the right side.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?() => void }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Callback function when click on the save icon at the right side.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?() => void }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
onSave?: () => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback function when click on the cancel icon at the left side.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?() => void }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-08-24 13:38:03 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 12:06:53 +00:00
|
|
|
/**
|
|
|
|
* Callback function when click on the cancel icon at the left side.
|
2024-01-09 09:21:01 +00:00
|
|
|
* @type { ?() => void }.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2023-11-11 12:06:53 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-08-24 13:38:03 +00:00
|
|
|
onCancel?: () => void;
|
2024-03-07 08:33:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the options of titlebar.
|
|
|
|
* @type { EditableTitleBarOptions }
|
|
|
|
* @default {expandSafeAreaTypes: SafeAreaType.SYSTEM, expandSafeAreaEdges: SafeAreaEdge.TOP}
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-03-07 08:33:00 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
options: EditableTitleBarOptions;
|
2024-05-20 02:53:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the content margin.
|
|
|
|
* @type { ?LocalizedMargin }
|
2024-06-17 13:21:50 +00:00
|
|
|
* @default {start: LengthMetrics.resource($r('sys.float.margin_left')),
|
|
|
|
* <br> end: LengthMetrics.resource($r('sys.float.margin_right'))}
|
2024-05-20 02:53:38 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @crossplatform
|
2024-07-16 04:01:05 +00:00
|
|
|
* @atomicservice
|
2024-05-20 02:53:38 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
@Prop contentMargin?: LocalizedMargin;
|
2023-10-24 01:46:28 +00:00
|
|
|
}
|