161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci* Copyright (c) 2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci* Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci* you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci* You may obtain a copy of the License at 661847f8eSopenharmony_ci* 761847f8eSopenharmony_ci* http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci* 961847f8eSopenharmony_ci* Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci* distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci* See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci* limitations under the License. 1461847f8eSopenharmony_ci*/ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit InputKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport type { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ci/** 2361847f8eSopenharmony_ci * Declares interfaces related to short key attributes. 2461847f8eSopenharmony_ci * 2561847f8eSopenharmony_ci * @namespace shortKey 2661847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.ShortKey 2761847f8eSopenharmony_ci * @systemapi hide for inner use 2861847f8eSopenharmony_ci * @since 10 2961847f8eSopenharmony_ci */ 3061847f8eSopenharmony_ci 3161847f8eSopenharmony_cideclare namespace shortKey { 3261847f8eSopenharmony_ci /** 3361847f8eSopenharmony_ci * Sets short key down duration. 3461847f8eSopenharmony_ci * @param { string } businessKey - The key for business which should be applied to MMI. 3561847f8eSopenharmony_ci * @param { number } delay - Duration of short key press which should be limited to 0-4000ms. 3661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Callback used to return the result. 3761847f8eSopenharmony_ci * @throws { BusinessError } 202 - SystemAPI permission error. 3861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 3961847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 4061847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.ShortKey 4161847f8eSopenharmony_ci * @systemapi hide for inner use 4261847f8eSopenharmony_ci * @since 10 4361847f8eSopenharmony_ci */ 4461847f8eSopenharmony_ci function setKeyDownDuration(businessKey: string, delay: number, callback: AsyncCallback<void>): void; 4561847f8eSopenharmony_ci 4661847f8eSopenharmony_ci /** 4761847f8eSopenharmony_ci * Sets short key down duration. 4861847f8eSopenharmony_ci * @param { string } businessKey - The key for business which should be applied to MMI. 4961847f8eSopenharmony_ci * @param { number } delay - Duration of short key press which should be limited to 0-4000ms. 5061847f8eSopenharmony_ci * @returns { Promise<void> } Returns the result through a promise. 5161847f8eSopenharmony_ci * @throws { BusinessError } 202 - SystemAPI permission error. 5261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 5361847f8eSopenharmony_ci * <br>2. Incorrect parameter types; 3. Parameter verification failed. 5461847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.ShortKey 5561847f8eSopenharmony_ci * @systemapi hide for inner use 5661847f8eSopenharmony_ci * @since 10 5761847f8eSopenharmony_ci */ 5861847f8eSopenharmony_ci function setKeyDownDuration(businessKey: string, delay: number): Promise<void>; 5961847f8eSopenharmony_ci 6061847f8eSopenharmony_ci} 6161847f8eSopenharmony_ciexport default shortKey; 6261847f8eSopenharmony_ci 6361847f8eSopenharmony_ci/** 6461847f8eSopenharmony_ci * Enumerates fingerprint key event types. 6561847f8eSopenharmony_ci * 6661847f8eSopenharmony_ci * @enum { number } 6761847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 6861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 6961847f8eSopenharmony_ci * @since 12 7061847f8eSopenharmony_ci */ 7161847f8eSopenharmony_ciexport declare enum FingerprintAction { 7261847f8eSopenharmony_ci /** 7361847f8eSopenharmony_ci * Key touching. 7461847f8eSopenharmony_ci * 7561847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 7661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 7761847f8eSopenharmony_ci * @since 12 7861847f8eSopenharmony_ci */ 7961847f8eSopenharmony_ci DOWN = 0, 8061847f8eSopenharmony_ci 8161847f8eSopenharmony_ci /** 8261847f8eSopenharmony_ci * Finger lifting. 8361847f8eSopenharmony_ci * 8461847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 8561847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 8661847f8eSopenharmony_ci * @since 12 8761847f8eSopenharmony_ci */ 8861847f8eSopenharmony_ci UP = 1, 8961847f8eSopenharmony_ci 9061847f8eSopenharmony_ci /** 9161847f8eSopenharmony_ci * Sliding on the fingerprint key. 9261847f8eSopenharmony_ci * 9361847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 9461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 9561847f8eSopenharmony_ci * @since 12 9661847f8eSopenharmony_ci */ 9761847f8eSopenharmony_ci SLIDE = 2, 9861847f8eSopenharmony_ci 9961847f8eSopenharmony_ci /** 10061847f8eSopenharmony_ci * Second touch during the double-click process. 10161847f8eSopenharmony_ci * 10261847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 10361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 10461847f8eSopenharmony_ci * @since 12 10561847f8eSopenharmony_ci */ 10661847f8eSopenharmony_ci RETOUCH = 3, 10761847f8eSopenharmony_ci 10861847f8eSopenharmony_ci /** 10961847f8eSopenharmony_ci * Double-click event. 11061847f8eSopenharmony_ci * 11161847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 11261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 11361847f8eSopenharmony_ci * @since 12 11461847f8eSopenharmony_ci */ 11561847f8eSopenharmony_ci CLICK = 4, 11661847f8eSopenharmony_ci} 11761847f8eSopenharmony_ci 11861847f8eSopenharmony_ci/** 11961847f8eSopenharmony_ci * Fingerprint key event. 12061847f8eSopenharmony_ci * 12161847f8eSopenharmony_ci * @interface FingerprintEvent 12261847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 12361847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 12461847f8eSopenharmony_ci * @since 12 12561847f8eSopenharmony_ci */ 12661847f8eSopenharmony_ciexport declare interface FingerprintEvent { 12761847f8eSopenharmony_ci /** 12861847f8eSopenharmony_ci * Fingerprint key event type. 12961847f8eSopenharmony_ci * 13061847f8eSopenharmony_ci * @type { FingerprintAction } 13161847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 13261847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 13361847f8eSopenharmony_ci * @since 12 13461847f8eSopenharmony_ci */ 13561847f8eSopenharmony_ci action: FingerprintAction; 13661847f8eSopenharmony_ci 13761847f8eSopenharmony_ci /** 13861847f8eSopenharmony_ci * This value indicates the sliding percentage of the fingerprint key on the X axis, 13961847f8eSopenharmony_ci * that is, the ratio of the relative sliding distance to the device length 14061847f8eSopenharmony_ci * compared with the previous report of the sliding event. 14161847f8eSopenharmony_ci * A positive value indicates moving in the positive direction of the X axis, 14261847f8eSopenharmony_ci * and a negative value indicates the opposite. 14361847f8eSopenharmony_ci * The vertical upward direction of the device stands for the positive direction of the Y axis, 14461847f8eSopenharmony_ci * and the horizontal rightward direction stands for the positive direction of the X axis. 14561847f8eSopenharmony_ci * This way, a rectangular coordinate system is constructed. 14661847f8eSopenharmony_ci * 14761847f8eSopenharmony_ci * @type { number } 14861847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 14961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 15061847f8eSopenharmony_ci * @since 12 15161847f8eSopenharmony_ci */ 15261847f8eSopenharmony_ci distanceX: number; 15361847f8eSopenharmony_ci 15461847f8eSopenharmony_ci /** 15561847f8eSopenharmony_ci * This value indicates the sliding percentage of the fingerprint key on the Y axis, 15661847f8eSopenharmony_ci * that is, the ratio of the relative sliding distance to the component length 15761847f8eSopenharmony_ci * compared with the previous report of the sliding event. 15861847f8eSopenharmony_ci * A positive value indicates moving in the positive direction of the Y axis, 15961847f8eSopenharmony_ci * and a negative value indicates the opposite. 16061847f8eSopenharmony_ci * The vertical upward direction of the device stands for the positive direction of the Y axis, 16161847f8eSopenharmony_ci * and the horizontal rightward direction stands for the positive direction of the X axis. 16261847f8eSopenharmony_ci * This way, a rectangular coordinate system is constructed. 16361847f8eSopenharmony_ci * 16461847f8eSopenharmony_ci * @type { number } 16561847f8eSopenharmony_ci * @syscap SystemCapability.MultimodalInput.Input.Core 16661847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 16761847f8eSopenharmony_ci * @since 12 16861847f8eSopenharmony_ci */ 16961847f8eSopenharmony_ci distanceY: number; 17061847f8eSopenharmony_ci}