1/* 2 * Copyright (C) 2024 Huawei Device Co., Ltd 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * you may obtain a copy of the License at 6 * 7 * http://www/apache.org/license/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15/** 16 * @file This section describes the interfaces used by InterstitialDialogAction 17 * @kit ArkUI 18 */ 19 20import { UIContext } from '@ohos.arkui.UIContext'; 21import { ComponentContent } from '@ohos.arkui.node'; 22/** 23 * IconStyle enumeration description. 24 * 25 * @enum { number } 26 * @syscap SystemCapability.ArkUI.ArkUI.Full 27 * @atomicservice 28 * @since 12 29 */ 30export declare enum IconStyle { 31 /** 32 * Sets the button icon to dark. 33 * 34 * @syscap SystemCapability.ArkUI.ArkUI.Full 35 * @atomicservice 36 * @since 12 37 */ 38 DARK = 0, 39 /** 40 * Sets the button icon to light. 41 * 42 * @syscap SystemCapability.ArkUI.ArkUI.Full 43 * @atomicservice 44 * @since 12 45 */ 46 LIGHT = 1 47} 48/** 49 * TitlePosition enumeration description. 50 * 51 * @enum { number } 52 * @syscap SystemCapability.ArkUI.ArkUI.Full 53 * @atomicservice 54 * @since 12 55 */ 56export declare enum TitlePosition { 57 /** 58 * The main title is above the text content. 59 * 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @atomicservice 62 * @since 12 63 */ 64 TOP = 0, 65 /** 66 * The main title is below the text content. 67 * 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @atomicservice 70 * @since 12 71 */ 72 BOTTOM = 1 73} 74/** 75 * dialog relative to bottom distance if tabs are present. 76 * 77 * @enum { number } 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @atomicservice 80 * @since 12 81 */ 82export declare enum BottomOffset { 83 /** 84 * dialog distance relative to the bottom in the presence of tabs. 85 * 86 * @syscap SystemCapability.ArkUI.ArkUI.Full 87 * @atomicservice 88 * @since 12 89 */ 90 OFFSET_FOR_BAR = 0, 91 /** 92 * dialog is the distance relative to the bottom without tabs. 93 * 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @atomicservice 96 * @since 12 97 */ 98 OFFSET_FOR_NONE = 1 99} 100/** 101 * Defines the properties required by the dialog. 102 * 103 * @interface DialogOptions 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @atomicservice 106 * @since 12 107 */ 108export declare interface DialogOptions { 109 /** 110 * The UIContext required by the dialog. 111 * 112 * @type { UIContext } 113 * @syscap SystemCapability.ArkUI.ArkUI.Full 114 * @atomicservice 115 * @since 12 116 */ 117 uiContext: UIContext; 118 /** 119 * The type of the bottom offset. 120 * 121 * @type { ?BottomOffset } 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @atomicservice 124 * @since 12 125 */ 126 bottomOffsetType?: BottomOffset 127 /** 128 * The title of the dialog. 129 * 130 * @type { ?ResourceStr } 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @atomicservice 133 * @since 12 134 */ 135 title?: ResourceStr; 136 /** 137 * The subtitle of the dialog. 138 * 139 * @type { ?ResourceStr } 140 * @syscap SystemCapability.ArkUI.ArkUI.Full 141 * @atomicservice 142 * @since 12 143 */ 144 subtitle?: ResourceStr; 145 /** 146 * The color of the title. 147 * 148 * @type { ?(ResourceStr | Color) } 149 * @syscap SystemCapability.ArkUI.ArkUI.Full 150 * @atomicservice 151 * @since 12 152 */ 153 titleColor?: ResourceStr | Color; 154 /** 155 * The color of the subtitle. 156 * 157 * @type { ?(ResourceStr | Color) } 158 * @syscap SystemCapability.ArkUI.ArkUI.Full 159 * @atomicservice 160 * @since 12 161 */ 162 subtitleColor?: ResourceStr | Color; 163 /** 164 * The background of the dialog. 165 * 166 * @type { ?Resource } 167 * @syscap SystemCapability.ArkUI.ArkUI.Full 168 * @atomicservice 169 * @since 12 170 */ 171 backgroundImage?: Resource; 172 /** 173 * The foreground of the dialog. 174 * 175 * @type { ?Resource } 176 * @syscap SystemCapability.ArkUI.ArkUI.Full 177 * @atomicservice 178 * @since 12 179 */ 180 foregroundImage?: Resource; 181 /** 182 * The style of the close button. 183 * 184 * @type { ?IconStyle } 185 * @syscap SystemCapability.ArkUI.ArkUI.Full 186 * @atomicservice 187 * @since 12 188 */ 189 iconStyle?: IconStyle; 190 /** 191 * The relative position of the title and subtitle. 192 * 193 * @type { ?TitlePosition } 194 * @syscap SystemCapability.ArkUI.ArkUI.Full 195 * @atomicservice 196 * @since 12 197 */ 198 titlePosition?: TitlePosition; 199 /** 200 * The action after clicking dialog. 201 * 202 * @type { ?Callback<void> } 203 * @syscap SystemCapability.ArkUI.ArkUI.Full 204 * @atomicservice 205 * @since 12 206 */ 207 onDialogClick?: Callback<void>; 208 /** 209 * The action after clicking close button. 210 * 211 * @type { ?Callback<void> } 212 * @syscap SystemCapability.ArkUI.ArkUI.Full 213 * @atomicservice 214 * @since 12 215 */ 216 onDialogClose?: Callback<void>; 217} 218/** 219 * Declare dialog action. 220 * 221 * @syscap SystemCapability.ArkUI.ArkUI.Full 222 * @atomicservice 223 * @since 12 224 */ 225export declare class InterstitialDialogAction { 226 /** 227 * The constructor transfers parameter settings. 228 * 229 * @param { DialogOptions } dialogOptions - Creates a new dialog action object. 230 * @syscap SystemCapability.ArkUI.ArkUI.Full 231 * @atomicservice 232 * @since 12 233 */ 234 constructor(dialogOptions: DialogOptions); 235 /** 236 * Execute a dialog open event. 237 * 238 * @syscap SystemCapability.ArkUI.ArkUI.Full 239 * @atomicservice 240 * @since 12 241 */ 242 openDialog(): void; 243 /** 244 * Execute a dialog close event. 245 * 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @atomicservice 248 * @since 12 249 */ 250 closeDialog(): void; 251}