1/* 2* Copyright (c) 2022 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 16import { AsyncCallback } from "./basic"; 17 18/** 19 * Declares interfaces related to mouse pointer attributes. 20 * 21 * @since 9 22 * @syscap SystemCapability.MultimodalInput.Input.Pointer 23 */ 24declare namespace pointer { 25 /** 26 * Pointer style. 27 * @since 9 28 * @syscap SystemCapability.MultimodalInput.Input.Pointer 29 */ 30 enum PointerStyle { 31 /** 32 * Default 33 */ 34 DEFAULT, 35 36 /** 37 * East arrow 38 */ 39 EAST, 40 41 /** 42 * West arrow 43 */ 44 WEST, 45 46 /** 47 * South arrow 48 */ 49 SOUTH, 50 51 /** 52 * North arrow 53 */ 54 NORTH, 55 56 /** 57 * East-west arrow 58 */ 59 WEST_EAST, 60 61 /** 62 * North-south arrow 63 */ 64 NORTH_SOUTH, 65 66 /** 67 * North-east arrow 68 */ 69 NORTH_EAST, 70 71 /** 72 * North-west arrow 73 */ 74 NORTH_WEST, 75 76 /** 77 * South-east arrow 78 */ 79 SOUTH_EAST, 80 81 /** 82 * South-west arrow 83 */ 84 SOUTH_WEST, 85 86 /** 87 * Northeast and southwest adjustment 88 */ 89 NORTH_EAST_SOUTH_WEST, 90 91 /** 92 * Northwest and southeast adjustment 93 */ 94 NORTH_WEST_SOUTH_EAST, 95 96 /** 97 * Cross (accurate selection) 98 */ 99 CROSS, 100 101 /** 102 * Copy 103 */ 104 CURSOR_COPY, 105 106 /** 107 * Forbid 108 */ 109 CURSOR_FORBID, 110 111 /** 112 * Sucker 113 */ 114 COLOR_SUCKER, 115 116 /** 117 * Grabbing hand 118 */ 119 HAND_GRABBING, 120 121 /** 122 * Opening hand 123 */ 124 HAND_OPEN, 125 126 /** 127 * Hand-shaped pointer 128 */ 129 HAND_POINTING, 130 131 /** 132 * Help 133 */ 134 HELP, 135 136 /** 137 * Move 138 */ 139 MOVE, 140 141 /** 142 * Left and right resizing 143 */ 144 RESIZE_LEFT_RIGHT, 145 146 /** 147 * Up and down resizing 148 */ 149 RESIZE_UP_DOWN, 150 151 /** 152 * Screenshot crosshair 153 */ 154 SCREENSHOT_CHOOSE, 155 156 /** 157 * Screenshot 158 */ 159 SCREENSHOT_CURSOR, 160 161 /** 162 * Text selection 163 */ 164 TEXT_CURSOR, 165 166 /** 167 * Zoom in 168 */ 169 ZOOM_IN, 170 171 /** 172 * Zoom out 173 */ 174 ZOOM_OUT, 175 176 /** 177 * Scrolling east 178 */ 179 MIDDLE_BTN_EAST, 180 181 /** 182 * Scrolling west 183 */ 184 MIDDLE_BTN_WEST, 185 186 /** 187 * Scrolling south 188 */ 189 MIDDLE_BTN_SOUTH, 190 191 /** 192 * Scrolling north 193 */ 194 MIDDLE_BTN_NORTH, 195 196 /** 197 * Scrolling north and south 198 */ 199 MIDDLE_BTN_NORTH_SOUTH, 200 201 /** 202 * Scrolling northeast 203 */ 204 MIDDLE_BTN_NORTH_EAST, 205 206 /** 207 * Scrolling northwest 208 */ 209 MIDDLE_BTN_NORTH_WEST, 210 211 /** 212 * Scrolling southeast 213 */ 214 MIDDLE_BTN_SOUTH_EAST, 215 216 /** 217 * Scrolling southwest 218 */ 219 MIDDLE_BTN_SOUTH_WEST, 220 221 /** 222 * Moving as a cone in four directions 223 */ 224 MIDDLE_BTN_NORTH_SOUTH_WEST_EAST, 225 } 226 227 /** 228 * Sets the pointer moving speed. 229 * @since 9 230 * @syscap SystemCapability.MultimodalInput.Input.Pointer 231 * @systemapi hide for inner use 232 * @param speed Pointer moving speed. 233 * @param callback Callback used to return the result. 234 * @throws {BusinessError} 401 - Parameter error. 235 */ 236 function setPointerSpeed(speed: number, callback: AsyncCallback<void>): void; 237 238 /** 239 * Sets the pointer moving speed. 240 * @since 9 241 * @syscap SystemCapability.MultimodalInput.Input.Pointer 242 * @systemapi hide for inner use 243 * @param speed Pointer moving speed. 244 * @returns Returns the result through a promise. 245 * @throws {BusinessError} 401 - Parameter error. 246 */ 247 function setPointerSpeed(speed: number): Promise<void>; 248 249 /** 250 * Queries the pointer moving speed. 251 * @since 9 252 * @syscap SystemCapability.MultimodalInput.Input.Pointer 253 * @systemapi hide for inner use 254 * @param callback Callback used to return the result. 255 * @throws {BusinessError} 401 - Parameter error. 256 */ 257 function getPointerSpeed(callback: AsyncCallback<number>): void; 258 259 /** 260 * Queries the pointer moving speed. 261 * @since 9 262 * @syscap SystemCapability.MultimodalInput.Input.Pointer 263 * @systemapi hide for inner use 264 * @returns Returns the result through a promise. 265 */ 266 function getPointerSpeed(): Promise<number>; 267 268 /** 269 * Sets the pointer style. 270 * @since 9 271 * @syscap SystemCapability.MultimodalInput.Input.Pointer 272 * @param windowId Window ID. 273 * @param pointerStyle Pointer style. 274 * @param callback Callback used to return the result. 275 * @throws {BusinessError} 401 - Parameter error. 276 */ 277 function setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback<void>): void; 278 279 /** 280 * Sets the pointer style. 281 * @since 9 282 * @syscap SystemCapability.MultimodalInput.Input.Pointer 283 * @param windowId Window ID. 284 * @param pointerStyle Pointer style. 285 * @returns Returns the result through a promise. 286 * @throws {BusinessError} 401 - Parameter error. 287 */ 288 function setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise<void>; 289 290 /** 291 * Queries the pointer style. 292 * @since 9 293 * @syscap SystemCapability.MultimodalInput.Input.Pointer 294 * @param windowId Window ID. 295 * @param callback Callback used to return the result. 296 * @throws {BusinessError} 401 - Parameter error. 297 */ 298 function getPointerStyle(windowId: number, callback: AsyncCallback<PointerStyle>): void; 299 300 /** 301 * Queries the pointer style. 302 * @since 9 303 * @syscap SystemCapability.MultimodalInput.Input.Pointer 304 * @param windowId Window ID. 305 * @returns Returns the result through a promise. 306 * @throws {BusinessError} 401 - Parameter error. 307 */ 308 function getPointerStyle(windowId: number): Promise<PointerStyle>; 309 310 /** 311 * Sets whether the pointer icon is visible. 312 * 313 * @since 9 314 * @syscap SystemCapability.MultimodalInput.Input.Pointer 315 * @param visible Whether the pointer icon is visible. The value true indicates that the pointer icon is visible, 316 * and the value false indicates the opposite. 317 * @throws {BusinessError} 401 - Parameter error. 318 */ 319 function setPointerVisible(visible: boolean, callback: AsyncCallback<void>): void; 320 321 /** 322 * Sets whether the pointer icon is visible. 323 * 324 * @since 9 325 * @syscap SystemCapability.MultimodalInput.Input.Pointer 326 * @param visible Whether the pointer icon is visible. The value true indicates that the pointer icon is visible, 327 * and the value false indicates the opposite. 328 * @throws {BusinessError} 401 - Parameter error. 329 */ 330 function setPointerVisible(visible: boolean): Promise<void>; 331 332 /** 333 * Checks whether the pointer icon is visible. 334 * 335 * @since 9 336 * @syscap SystemCapability.MultimodalInput.Input.Pointer 337 * @returns Returns <b>true</b> if the pointer icon is visible; returns <b>false</b> otherwise. 338 * @throws {BusinessError} 401 - Parameter error. 339 */ 340 function isPointerVisible(callback: AsyncCallback<boolean>): void; 341 342 /** 343 * Checks whether the pointer icon is visible. 344 * 345 * @since 9 346 * @syscap SystemCapability.MultimodalInput.Input.Pointer 347 * @returns Returns <b>true</b> if the pointer icon is visible; returns <b>false</b> otherwise. 348 */ 349 function isPointerVisible(): Promise<boolean>; 350} 351 352export default pointer;