1/* 2 * Copyright (c) 2023 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/licenses/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/** 17 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Enumerates the icon styles. 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 10 27 */ 28/** 29 * Enumerates the icon styles. 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @atomicservice 34 * @since 11 35 */ 36declare enum PasteIconStyle { 37 /** 38 * Icon rendered as lines. 39 * 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @since 10 42 */ 43 /** 44 * Icon rendered as lines. 45 * 46 * @syscap SystemCapability.ArkUI.ArkUI.Full 47 * @atomicservice 48 * @since 11 49 */ 50 LINES = 0 51} 52 53/** 54 * Enumerates the text that can be displayed on the paste button. 55 * 56 * @enum { number } 57 * @syscap SystemCapability.ArkUI.ArkUI.Full 58 * @since 10 59 */ 60/** 61 * Enumerates the text that can be displayed on the paste button. 62 * 63 * @enum { number } 64 * @syscap SystemCapability.ArkUI.ArkUI.Full 65 * @atomicservice 66 * @since 11 67 */ 68declare enum PasteDescription { 69 /** 70 * Paste 71 * 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @since 10 74 */ 75 /** 76 * Paste 77 * 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @atomicservice 80 * @since 11 81 */ 82 PASTE = 0 83} 84 85/** 86 * Declares the interface for setting the paste button options. 87 * 88 * @interface PasteButtonOptions 89 * @syscap SystemCapability.ArkUI.ArkUI.Full 90 * @since 10 91 */ 92/** 93 * Declares the interface for setting the paste button options. 94 * 95 * @interface PasteButtonOptions 96 * @syscap SystemCapability.ArkUI.ArkUI.Full 97 * @atomicservice 98 * @since 11 99 */ 100declare interface PasteButtonOptions { 101 /** 102 * Style of the icon to be drawn. 103 * 104 * @type { ?PasteIconStyle } 105 * @syscap SystemCapability.ArkUI.ArkUI.Full 106 * @since 10 107 */ 108 /** 109 * Style of the icon to be drawn. 110 * 111 * @type { ?PasteIconStyle } 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @atomicservice 114 * @since 11 115 */ 116 icon?: PasteIconStyle; 117 118 /** 119 * Text to be displayed on the button. 120 * 121 * @type { ?PasteDescription } 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @since 10 124 */ 125 /** 126 * Text to be displayed on the button. 127 * 128 * @type { ?PasteDescription } 129 * @syscap SystemCapability.ArkUI.ArkUI.Full 130 * @atomicservice 131 * @since 11 132 */ 133 text?: PasteDescription; 134 135 /** 136 * Type of the button. 137 * 138 * @type { ?ButtonType } 139 * @syscap SystemCapability.ArkUI.ArkUI.Full 140 * @since 10 141 */ 142 /** 143 * Type of the button. 144 * 145 * @type { ?ButtonType } 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @atomicservice 148 * @since 11 149 */ 150 buttonType?: ButtonType; 151} 152 153/** 154 * Enumerates the click event results of the paste button. 155 * 156 * @enum { number } 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @since 10 159 */ 160/** 161 * Enumerates the click event results of the paste button. 162 * 163 * @enum { number } 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @atomicservice 166 * @since 11 167 */ 168declare enum PasteButtonOnClickResult { 169 /** 170 * Success. 171 * 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @since 10 174 */ 175 /** 176 * Success. 177 * 178 * @syscap SystemCapability.ArkUI.ArkUI.Full 179 * @atomicservice 180 * @since 11 181 */ 182 SUCCESS = 0, 183 184 /** 185 * Failure because the application is not temporarily authorized for accessing the current pasteboard data. 186 * 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @since 10 189 */ 190 /** 191 * Failure because the application is not temporarily authorized for accessing the current pasteboard data. 192 * 193 * @syscap SystemCapability.ArkUI.ArkUI.Full 194 * @atomicservice 195 * @since 11 196 */ 197 TEMPORARY_AUTHORIZATION_FAILED = 1 198} 199 200/** 201 * Defines the interface for setting a paste button. 202 * 203 * @interface PasteButtonInterface 204 * @syscap SystemCapability.ArkUI.ArkUI.Full 205 * @since 10 206 */ 207/** 208 * Defines the interface for setting a paste button. 209 * 210 * @interface PasteButtonInterface 211 * @syscap SystemCapability.ArkUI.ArkUI.Full 212 * @atomicservice 213 * @since 11 214 */ 215interface PasteButtonInterface { 216 /** 217 * Creates a paste button. 218 * 219 * @returns { PasteButtonAttribute } Returns the attribute of the paste button. 220 * @syscap SystemCapability.ArkUI.ArkUI.Full 221 * @since 10 222 */ 223 /** 224 * Creates a paste button. 225 * 226 * @returns { PasteButtonAttribute } Returns the attribute of the paste button. 227 * @syscap SystemCapability.ArkUI.ArkUI.Full 228 * @atomicservice 229 * @since 11 230 */ 231 (): PasteButtonAttribute; 232 233 /** 234 * Creates a paste button with the specified composition. 235 * If an attribute is not set, the corresponding element will not be drawn. 236 * 237 * @param { PasteButtonOptions } options - Indicates the options of the paste button. 238 * @returns { PasteButtonAttribute } Returns the attribute of the paste button. 239 * @syscap SystemCapability.ArkUI.ArkUI.Full 240 * @since 10 241 */ 242 /** 243 * Creates a paste button with the specified composition. 244 * If an attribute is not set, the corresponding element will not be drawn. 245 * 246 * @param { PasteButtonOptions } options - Indicates the options of the paste button. 247 * @returns { PasteButtonAttribute } Returns the attribute of the paste button. 248 * @syscap SystemCapability.ArkUI.ArkUI.Full 249 * @atomicservice 250 * @since 11 251 */ 252 (options: PasteButtonOptions): PasteButtonAttribute; 253} 254 255/** 256 * Defines the attributes of the paste button. 257 * 258 * @extends SecurityComponentMethod<PasteButtonAttribute> 259 * @syscap SystemCapability.ArkUI.ArkUI.Full 260 * @since 10 261 */ 262/** 263 * Defines the attributes of the paste button. 264 * 265 * @extends SecurityComponentMethod<PasteButtonAttribute> 266 * @syscap SystemCapability.ArkUI.ArkUI.Full 267 * @atomicservice 268 * @since 11 269 */ 270declare class PasteButtonAttribute extends SecurityComponentMethod<PasteButtonAttribute> { 271 /** 272 * Called when the paste button is clicked. 273 * 274 * @param { function } event 275 * @returns { PasteButtonAttribute } Returns the attribute of the paste button. 276 * @syscap SystemCapability.ArkUI.ArkUI.Full 277 * @since 10 278 */ 279 /** 280 * Called when the paste button is clicked. 281 * 282 * @param { function } event 283 * @returns { PasteButtonAttribute } Returns the attribute of the paste button. 284 * @syscap SystemCapability.ArkUI.ArkUI.Full 285 * @atomicservice 286 * @since 11 287 */ 288 onClick(event: (event: ClickEvent, result: PasteButtonOnClickResult) => void): PasteButtonAttribute; 289} 290 291/** 292 * Defines a button that interacts with the security component service to 293 * request the permission for accessing the current pasteboard data. 294 * 295 * @syscap SystemCapability.ArkUI.ArkUI.Full 296 * @since 10 297 */ 298/** 299 * Defines a button that interacts with the security component service to 300 * request the permission for accessing the current pasteboard data. 301 * 302 * @syscap SystemCapability.ArkUI.ArkUI.Full 303 * @atomicservice 304 * @since 11 305 */ 306declare const PasteButton: PasteButtonInterface; 307 308/** 309 * Defines a paste button instance for secure access. 310 * 311 * @syscap SystemCapability.ArkUI.ArkUI.Full 312 * @since 10 313 */ 314/** 315 * Defines a paste button instance for secure access. 316 * 317 * @syscap SystemCapability.ArkUI.ArkUI.Full 318 * @atomicservice 319 * @since 11 320 */ 321declare const PasteButtonInstance: PasteButtonAttribute; 322