161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021-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 The subscriber of common event 1861847f8eSopenharmony_ci * @kit BasicServicesKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback } from './../@ohos.base'; 2261847f8eSopenharmony_ciimport { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; 2361847f8eSopenharmony_ci 2461847f8eSopenharmony_ci/** 2561847f8eSopenharmony_ci * the subscriber of common event 2661847f8eSopenharmony_ci * 2761847f8eSopenharmony_ci * @interface CommonEventSubscriber 2861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 2961847f8eSopenharmony_ci * @since 7 3061847f8eSopenharmony_ci */ 3161847f8eSopenharmony_ci/** 3261847f8eSopenharmony_ci * the subscriber of common event 3361847f8eSopenharmony_ci * 3461847f8eSopenharmony_ci * @interface CommonEventSubscriber 3561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 3661847f8eSopenharmony_ci * @atomicservice 3761847f8eSopenharmony_ci * @since 11 3861847f8eSopenharmony_ci */ 3961847f8eSopenharmony_ciexport interface CommonEventSubscriber { 4061847f8eSopenharmony_ci /** 4161847f8eSopenharmony_ci * Obtains the result code of the current ordered common event. 4261847f8eSopenharmony_ci * 4361847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - Indicate the callback function to receive the common event. 4461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 4561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 4661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 4761847f8eSopenharmony_ci * @since 7 4861847f8eSopenharmony_ci */ 4961847f8eSopenharmony_ci /** 5061847f8eSopenharmony_ci * Obtains the result code of the current ordered common event. 5161847f8eSopenharmony_ci * 5261847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - Indicate the callback function to receive the common event. 5361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 5461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 5561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 5661847f8eSopenharmony_ci * @atomicservice 5761847f8eSopenharmony_ci * @since 11 5861847f8eSopenharmony_ci */ 5961847f8eSopenharmony_ci getCode(callback: AsyncCallback<number>): void; 6061847f8eSopenharmony_ci 6161847f8eSopenharmony_ci /** 6261847f8eSopenharmony_ci * Obtains the result code of the current ordered common event. 6361847f8eSopenharmony_ci * 6461847f8eSopenharmony_ci * @returns { Promise<number> } Returns code of this common event 6561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 6661847f8eSopenharmony_ci * @since 7 6761847f8eSopenharmony_ci */ 6861847f8eSopenharmony_ci /** 6961847f8eSopenharmony_ci * Obtains the result code of the current ordered common event. 7061847f8eSopenharmony_ci * 7161847f8eSopenharmony_ci * @returns { Promise<number> } Returns code of this common event 7261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 7361847f8eSopenharmony_ci * @atomicservice 7461847f8eSopenharmony_ci * @since 11 7561847f8eSopenharmony_ci */ 7661847f8eSopenharmony_ci getCode(): Promise<number>; 7761847f8eSopenharmony_ci 7861847f8eSopenharmony_ci /** 7961847f8eSopenharmony_ci * Obtains the result code of the current ordered common event. 8061847f8eSopenharmony_ci * 8161847f8eSopenharmony_ci * @returns { number } Returns code of this common event 8261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 8361847f8eSopenharmony_ci * @since 10 8461847f8eSopenharmony_ci */ 8561847f8eSopenharmony_ci /** 8661847f8eSopenharmony_ci * Obtains the result code of the current ordered common event. 8761847f8eSopenharmony_ci * 8861847f8eSopenharmony_ci * @returns { number } Returns code of this common event 8961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 9061847f8eSopenharmony_ci * @atomicservice 9161847f8eSopenharmony_ci * @since 11 9261847f8eSopenharmony_ci */ 9361847f8eSopenharmony_ci getCodeSync(): number; 9461847f8eSopenharmony_ci 9561847f8eSopenharmony_ci /** 9661847f8eSopenharmony_ci * Sets the result code of the current ordered common event. 9761847f8eSopenharmony_ci * 9861847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 9961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Indicate the callback function to receive the common event. 10061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 10161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 10261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 10361847f8eSopenharmony_ci * @since 7 10461847f8eSopenharmony_ci */ 10561847f8eSopenharmony_ci /** 10661847f8eSopenharmony_ci * Sets the result code of the current ordered common event. 10761847f8eSopenharmony_ci * 10861847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 10961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Indicate the callback function to receive the common event. 11061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 11161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 11261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 11361847f8eSopenharmony_ci * @atomicservice 11461847f8eSopenharmony_ci * @since 11 11561847f8eSopenharmony_ci */ 11661847f8eSopenharmony_ci setCode(code: number, callback: AsyncCallback<void>): void; 11761847f8eSopenharmony_ci 11861847f8eSopenharmony_ci /** 11961847f8eSopenharmony_ci * Sets the result code of the current ordered common event. 12061847f8eSopenharmony_ci * 12161847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 12261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 12361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 12461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 12561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 12661847f8eSopenharmony_ci * @since 7 12761847f8eSopenharmony_ci */ 12861847f8eSopenharmony_ci /** 12961847f8eSopenharmony_ci * Sets the result code of the current ordered common event. 13061847f8eSopenharmony_ci * 13161847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 13261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 13361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 13461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 13561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 13661847f8eSopenharmony_ci * @atomicservice 13761847f8eSopenharmony_ci * @since 11 13861847f8eSopenharmony_ci */ 13961847f8eSopenharmony_ci setCode(code: number): Promise<void>; 14061847f8eSopenharmony_ci 14161847f8eSopenharmony_ci /** 14261847f8eSopenharmony_ci * Sets the result code of the current ordered common event. 14361847f8eSopenharmony_ci * 14461847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 14561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 14661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 14761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 14861847f8eSopenharmony_ci * @since 10 14961847f8eSopenharmony_ci */ 15061847f8eSopenharmony_ci /** 15161847f8eSopenharmony_ci * Sets the result code of the current ordered common event. 15261847f8eSopenharmony_ci * 15361847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 15461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 15561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 15661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 15761847f8eSopenharmony_ci * @atomicservice 15861847f8eSopenharmony_ci * @since 11 15961847f8eSopenharmony_ci */ 16061847f8eSopenharmony_ci setCodeSync(code: number): void; 16161847f8eSopenharmony_ci 16261847f8eSopenharmony_ci /** 16361847f8eSopenharmony_ci * Obtains the result data of the current ordered common event. 16461847f8eSopenharmony_ci * 16561847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Indicate the callback function to receive the common event. 16661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 16761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 16861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 16961847f8eSopenharmony_ci * @since 7 17061847f8eSopenharmony_ci */ 17161847f8eSopenharmony_ci /** 17261847f8eSopenharmony_ci * Obtains the result data of the current ordered common event. 17361847f8eSopenharmony_ci * 17461847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Indicate the callback function to receive the common event. 17561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 17661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 17761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 17861847f8eSopenharmony_ci * @atomicservice 17961847f8eSopenharmony_ci * @since 11 18061847f8eSopenharmony_ci */ 18161847f8eSopenharmony_ci getData(callback: AsyncCallback<string>): void; 18261847f8eSopenharmony_ci 18361847f8eSopenharmony_ci /** 18461847f8eSopenharmony_ci * Obtains the result data of the current ordered common event. 18561847f8eSopenharmony_ci * 18661847f8eSopenharmony_ci * @returns { Promise<string> } Returns data of this common event 18761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 18861847f8eSopenharmony_ci * @since 7 18961847f8eSopenharmony_ci */ 19061847f8eSopenharmony_ci /** 19161847f8eSopenharmony_ci * Obtains the result data of the current ordered common event. 19261847f8eSopenharmony_ci * 19361847f8eSopenharmony_ci * @returns { Promise<string> } Returns data of this common event 19461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 19561847f8eSopenharmony_ci * @atomicservice 19661847f8eSopenharmony_ci * @since 11 19761847f8eSopenharmony_ci */ 19861847f8eSopenharmony_ci getData(): Promise<string>; 19961847f8eSopenharmony_ci 20061847f8eSopenharmony_ci /** 20161847f8eSopenharmony_ci * Obtains the result data of the current ordered common event. 20261847f8eSopenharmony_ci * 20361847f8eSopenharmony_ci * @returns { string } Returns data of this common event 20461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 20561847f8eSopenharmony_ci * @since 10 20661847f8eSopenharmony_ci */ 20761847f8eSopenharmony_ci /** 20861847f8eSopenharmony_ci * Obtains the result data of the current ordered common event. 20961847f8eSopenharmony_ci * 21061847f8eSopenharmony_ci * @returns { string } Returns data of this common event 21161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 21261847f8eSopenharmony_ci * @atomicservice 21361847f8eSopenharmony_ci * @since 11 21461847f8eSopenharmony_ci */ 21561847f8eSopenharmony_ci getDataSync(): string; 21661847f8eSopenharmony_ci 21761847f8eSopenharmony_ci /** 21861847f8eSopenharmony_ci * Sets the result data of the current ordered common event. 21961847f8eSopenharmony_ci * 22061847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 22161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Indicate the callback function to receive the common event. 22261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 22361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 22461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 22561847f8eSopenharmony_ci * @since 7 22661847f8eSopenharmony_ci */ 22761847f8eSopenharmony_ci /** 22861847f8eSopenharmony_ci * Sets the result data of the current ordered common event. 22961847f8eSopenharmony_ci * 23061847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 23161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Indicate the callback function to receive the common event. 23261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 23361847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 23461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 23561847f8eSopenharmony_ci * @atomicservice 23661847f8eSopenharmony_ci * @since 11 23761847f8eSopenharmony_ci */ 23861847f8eSopenharmony_ci setData(data: string, callback: AsyncCallback<void>): void; 23961847f8eSopenharmony_ci 24061847f8eSopenharmony_ci /** 24161847f8eSopenharmony_ci * Sets the result data of the current ordered common event. 24261847f8eSopenharmony_ci * 24361847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 24461847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 24561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 24661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 24761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 24861847f8eSopenharmony_ci * @since 7 24961847f8eSopenharmony_ci */ 25061847f8eSopenharmony_ci /** 25161847f8eSopenharmony_ci * Sets the result data of the current ordered common event. 25261847f8eSopenharmony_ci * 25361847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 25461847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 25561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 25661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 25761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 25861847f8eSopenharmony_ci * @atomicservice 25961847f8eSopenharmony_ci * @since 11 26061847f8eSopenharmony_ci */ 26161847f8eSopenharmony_ci setData(data: string): Promise<void>; 26261847f8eSopenharmony_ci 26361847f8eSopenharmony_ci /** 26461847f8eSopenharmony_ci * Sets the result data of the current ordered common event. 26561847f8eSopenharmony_ci * 26661847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 26761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 26861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 26961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 27061847f8eSopenharmony_ci * @since 10 27161847f8eSopenharmony_ci */ 27261847f8eSopenharmony_ci /** 27361847f8eSopenharmony_ci * Sets the result data of the current ordered common event. 27461847f8eSopenharmony_ci * 27561847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 27661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 27761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 27861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 27961847f8eSopenharmony_ci * @atomicservice 28061847f8eSopenharmony_ci * @since 11 28161847f8eSopenharmony_ci */ 28261847f8eSopenharmony_ci setDataSync(data: string): void; 28361847f8eSopenharmony_ci 28461847f8eSopenharmony_ci /** 28561847f8eSopenharmony_ci * Sets the result of the current ordered common event. 28661847f8eSopenharmony_ci * 28761847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 28861847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 28961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Indicate the callback function to receive the common event. 29061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 29161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 29261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 29361847f8eSopenharmony_ci * @since 7 29461847f8eSopenharmony_ci */ 29561847f8eSopenharmony_ci /** 29661847f8eSopenharmony_ci * Sets the result of the current ordered common event. 29761847f8eSopenharmony_ci * 29861847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 29961847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 30061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Indicate the callback function to receive the common event. 30161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 30261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 30361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 30461847f8eSopenharmony_ci * @atomicservice 30561847f8eSopenharmony_ci * @since 11 30661847f8eSopenharmony_ci */ 30761847f8eSopenharmony_ci setCodeAndData(code: number, data: string, callback: AsyncCallback<void>): void; 30861847f8eSopenharmony_ci 30961847f8eSopenharmony_ci /** 31061847f8eSopenharmony_ci * Sets the result of the current ordered common event. 31161847f8eSopenharmony_ci * 31261847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 31361847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 31461847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 31561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 31661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 31761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 31861847f8eSopenharmony_ci * @since 7 31961847f8eSopenharmony_ci */ 32061847f8eSopenharmony_ci /** 32161847f8eSopenharmony_ci * Sets the result of the current ordered common event. 32261847f8eSopenharmony_ci * 32361847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 32461847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 32561847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 32661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 32761847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 32861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 32961847f8eSopenharmony_ci * @atomicservice 33061847f8eSopenharmony_ci * @since 11 33161847f8eSopenharmony_ci */ 33261847f8eSopenharmony_ci setCodeAndData(code: number, data: string): Promise<void>; 33361847f8eSopenharmony_ci 33461847f8eSopenharmony_ci /** 33561847f8eSopenharmony_ci * Sets the result of the current ordered common event. 33661847f8eSopenharmony_ci * 33761847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 33861847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 33961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 34061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 34161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 34261847f8eSopenharmony_ci * @since 10 34361847f8eSopenharmony_ci */ 34461847f8eSopenharmony_ci /** 34561847f8eSopenharmony_ci * Sets the result of the current ordered common event. 34661847f8eSopenharmony_ci * 34761847f8eSopenharmony_ci * @param { number } code - Indicates the custom result code to set. You can set it to any value. 34861847f8eSopenharmony_ci * @param { string } data - Indicates the custom result data to set. You can set it to any character string. 34961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 35061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 35161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 35261847f8eSopenharmony_ci * @atomicservice 35361847f8eSopenharmony_ci * @since 11 35461847f8eSopenharmony_ci */ 35561847f8eSopenharmony_ci setCodeAndDataSync(code: number, data: string): void; 35661847f8eSopenharmony_ci 35761847f8eSopenharmony_ci /** 35861847f8eSopenharmony_ci * Checks whether the current common event is an ordered common event. 35961847f8eSopenharmony_ci * 36061847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Indicate the callback function to receive the common event. 36161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 36261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 36361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 36461847f8eSopenharmony_ci * @since 7 36561847f8eSopenharmony_ci */ 36661847f8eSopenharmony_ci isOrderedCommonEvent(callback: AsyncCallback<boolean>): void; 36761847f8eSopenharmony_ci 36861847f8eSopenharmony_ci /** 36961847f8eSopenharmony_ci * Checks whether the current common event is an ordered common event. 37061847f8eSopenharmony_ci * 37161847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns true if this common event is ordered, false otherwise 37261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 37361847f8eSopenharmony_ci * @since 7 37461847f8eSopenharmony_ci */ 37561847f8eSopenharmony_ci isOrderedCommonEvent(): Promise<boolean>; 37661847f8eSopenharmony_ci 37761847f8eSopenharmony_ci /** 37861847f8eSopenharmony_ci * Checks whether the current common event is an ordered common event. 37961847f8eSopenharmony_ci * 38061847f8eSopenharmony_ci * @returns { boolean } Returns true if this common event is ordered, false otherwise 38161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 38261847f8eSopenharmony_ci * @since 10 38361847f8eSopenharmony_ci */ 38461847f8eSopenharmony_ci isOrderedCommonEventSync(): boolean; 38561847f8eSopenharmony_ci 38661847f8eSopenharmony_ci /** 38761847f8eSopenharmony_ci * Checks whether the current common event is a sticky common event. 38861847f8eSopenharmony_ci * 38961847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Indicate the callback function to receive the common event. 39061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 39161847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 39261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 39361847f8eSopenharmony_ci * @since 7 39461847f8eSopenharmony_ci */ 39561847f8eSopenharmony_ci isStickyCommonEvent(callback: AsyncCallback<boolean>): void; 39661847f8eSopenharmony_ci 39761847f8eSopenharmony_ci /** 39861847f8eSopenharmony_ci * Checks whether the current common event is a sticky common event. 39961847f8eSopenharmony_ci * 40061847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns true if this common event is sticky, false otherwise 40161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 40261847f8eSopenharmony_ci * @since 7 40361847f8eSopenharmony_ci */ 40461847f8eSopenharmony_ci isStickyCommonEvent(): Promise<boolean>; 40561847f8eSopenharmony_ci 40661847f8eSopenharmony_ci /** 40761847f8eSopenharmony_ci * Checks whether the current common event is a sticky common event. 40861847f8eSopenharmony_ci * 40961847f8eSopenharmony_ci * @returns { boolean } Returns true if this common event is sticky, false otherwise 41061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 41161847f8eSopenharmony_ci * @since 10 41261847f8eSopenharmony_ci */ 41361847f8eSopenharmony_ci isStickyCommonEventSync(): boolean; 41461847f8eSopenharmony_ci 41561847f8eSopenharmony_ci /** 41661847f8eSopenharmony_ci * Abort the current ordered common event. 41761847f8eSopenharmony_ci * 41861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Indicate the callback function to receive the common event. 41961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 42061847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 42161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 42261847f8eSopenharmony_ci * @since 7 42361847f8eSopenharmony_ci */ 42461847f8eSopenharmony_ci abortCommonEvent(callback: AsyncCallback<void>): void; 42561847f8eSopenharmony_ci 42661847f8eSopenharmony_ci /** 42761847f8eSopenharmony_ci * Abort the current ordered common event. 42861847f8eSopenharmony_ci * 42961847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 43061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 43161847f8eSopenharmony_ci * @since 7 43261847f8eSopenharmony_ci */ 43361847f8eSopenharmony_ci abortCommonEvent(): Promise<void>; 43461847f8eSopenharmony_ci 43561847f8eSopenharmony_ci /** 43661847f8eSopenharmony_ci * Abort the current ordered common event. 43761847f8eSopenharmony_ci * 43861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 43961847f8eSopenharmony_ci * @since 10 44061847f8eSopenharmony_ci */ 44161847f8eSopenharmony_ci abortCommonEventSync(): void; 44261847f8eSopenharmony_ci 44361847f8eSopenharmony_ci /** 44461847f8eSopenharmony_ci * Clears the abort state of the current ordered common event 44561847f8eSopenharmony_ci * 44661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Indicate the callback function to receive the common event. 44761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 44861847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 44961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 45061847f8eSopenharmony_ci * @since 7 45161847f8eSopenharmony_ci */ 45261847f8eSopenharmony_ci clearAbortCommonEvent(callback: AsyncCallback<void>): void; 45361847f8eSopenharmony_ci 45461847f8eSopenharmony_ci /** 45561847f8eSopenharmony_ci * Clears the abort state of the current ordered common event 45661847f8eSopenharmony_ci * 45761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 45861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 45961847f8eSopenharmony_ci * @since 7 46061847f8eSopenharmony_ci */ 46161847f8eSopenharmony_ci clearAbortCommonEvent(): Promise<void>; 46261847f8eSopenharmony_ci 46361847f8eSopenharmony_ci /** 46461847f8eSopenharmony_ci * Clears the abort state of the current ordered common event 46561847f8eSopenharmony_ci * 46661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 46761847f8eSopenharmony_ci * @since 10 46861847f8eSopenharmony_ci */ 46961847f8eSopenharmony_ci clearAbortCommonEventSync(): void; 47061847f8eSopenharmony_ci 47161847f8eSopenharmony_ci /** 47261847f8eSopenharmony_ci * Checks whether the current ordered common event should be aborted. 47361847f8eSopenharmony_ci * 47461847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Indicate the callback function to receive the common event. 47561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 47661847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 47761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 47861847f8eSopenharmony_ci * @since 7 47961847f8eSopenharmony_ci */ 48061847f8eSopenharmony_ci getAbortCommonEvent(callback: AsyncCallback<boolean>): void; 48161847f8eSopenharmony_ci 48261847f8eSopenharmony_ci /** 48361847f8eSopenharmony_ci * Checks whether the current ordered common event should be aborted. 48461847f8eSopenharmony_ci * 48561847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns true if this common event is aborted, false otherwise 48661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 48761847f8eSopenharmony_ci * @since 7 48861847f8eSopenharmony_ci */ 48961847f8eSopenharmony_ci getAbortCommonEvent(): Promise<boolean>; 49061847f8eSopenharmony_ci 49161847f8eSopenharmony_ci /** 49261847f8eSopenharmony_ci * Checks whether the current ordered common event should be aborted. 49361847f8eSopenharmony_ci * 49461847f8eSopenharmony_ci * @returns { boolean } Returns true if this common event is aborted, false otherwise 49561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 49661847f8eSopenharmony_ci * @since 10 49761847f8eSopenharmony_ci */ 49861847f8eSopenharmony_ci getAbortCommonEventSync(): boolean; 49961847f8eSopenharmony_ci 50061847f8eSopenharmony_ci /** 50161847f8eSopenharmony_ci * get the CommonEventSubscribeInfo of this CommonEventSubscriber. 50261847f8eSopenharmony_ci * 50361847f8eSopenharmony_ci * @param { AsyncCallback<CommonEventSubscribeInfo> } callback - Indicate callback function to receive common event. 50461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 50561847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 50661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 50761847f8eSopenharmony_ci * @since 7 50861847f8eSopenharmony_ci */ 50961847f8eSopenharmony_ci /** 51061847f8eSopenharmony_ci * get the CommonEventSubscribeInfo of this CommonEventSubscriber. 51161847f8eSopenharmony_ci * 51261847f8eSopenharmony_ci * @param { AsyncCallback<CommonEventSubscribeInfo> } callback - Indicate callback function to receive common event. 51361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 51461847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 51561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 51661847f8eSopenharmony_ci * @crossplatform 51761847f8eSopenharmony_ci * @atomicservice 51861847f8eSopenharmony_ci * @since 11 51961847f8eSopenharmony_ci */ 52061847f8eSopenharmony_ci getSubscribeInfo(callback: AsyncCallback<CommonEventSubscribeInfo>): void; 52161847f8eSopenharmony_ci 52261847f8eSopenharmony_ci /** 52361847f8eSopenharmony_ci * get the CommonEventSubscribeInfo of this CommonEventSubscriber. 52461847f8eSopenharmony_ci * 52561847f8eSopenharmony_ci * @returns { Promise<CommonEventSubscribeInfo> } Returns the commonEvent subscribe information 52661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 52761847f8eSopenharmony_ci * @since 7 52861847f8eSopenharmony_ci */ 52961847f8eSopenharmony_ci /** 53061847f8eSopenharmony_ci * get the CommonEventSubscribeInfo of this CommonEventSubscriber. 53161847f8eSopenharmony_ci * 53261847f8eSopenharmony_ci * @returns { Promise<CommonEventSubscribeInfo> } Returns the commonEvent subscribe information 53361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 53461847f8eSopenharmony_ci * @crossplatform 53561847f8eSopenharmony_ci * @atomicservice 53661847f8eSopenharmony_ci * @since 11 53761847f8eSopenharmony_ci */ 53861847f8eSopenharmony_ci getSubscribeInfo(): Promise<CommonEventSubscribeInfo>; 53961847f8eSopenharmony_ci 54061847f8eSopenharmony_ci /** 54161847f8eSopenharmony_ci * Get the CommonEventSubscribeInfo of this CommonEventSubscriber. 54261847f8eSopenharmony_ci * 54361847f8eSopenharmony_ci * @returns { CommonEventSubscribeInfo } Returns the commonEvent subscribe information 54461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 54561847f8eSopenharmony_ci * @since 10 54661847f8eSopenharmony_ci */ 54761847f8eSopenharmony_ci /** 54861847f8eSopenharmony_ci * Get the CommonEventSubscribeInfo of this CommonEventSubscriber. 54961847f8eSopenharmony_ci * 55061847f8eSopenharmony_ci * @returns { CommonEventSubscribeInfo } Returns the commonEvent subscribe information 55161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 55261847f8eSopenharmony_ci * @atomicservice 55361847f8eSopenharmony_ci * @since 11 55461847f8eSopenharmony_ci */ 55561847f8eSopenharmony_ci getSubscribeInfoSync(): CommonEventSubscribeInfo; 55661847f8eSopenharmony_ci 55761847f8eSopenharmony_ci /** 55861847f8eSopenharmony_ci * finish the current ordered common event. 55961847f8eSopenharmony_ci * 56061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Indicate the callback function after ordered common event is finished. 56161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 56261847f8eSopenharmony_ci * <br>2. Incorrect parameter types. 3. Parameter verification failed. 56361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 56461847f8eSopenharmony_ci * @since 9 56561847f8eSopenharmony_ci */ 56661847f8eSopenharmony_ci finishCommonEvent(callback: AsyncCallback<void>): void; 56761847f8eSopenharmony_ci 56861847f8eSopenharmony_ci /** 56961847f8eSopenharmony_ci * finish the current ordered common event. 57061847f8eSopenharmony_ci * 57161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 57261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.CommonEvent 57361847f8eSopenharmony_ci * @since 9 57461847f8eSopenharmony_ci */ 57561847f8eSopenharmony_ci finishCommonEvent(): Promise<void>; 57661847f8eSopenharmony_ci} 577