2023-07-27 08:54:56 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
|
|
|
* @file
|
2024-01-08 07:25:39 +00:00
|
|
|
* @kit BasicServicesKit
|
2023-12-11 09:08:03 +00:00
|
|
|
*/
|
|
|
|
|
2023-12-13 02:24:48 +00:00
|
|
|
import type { AsyncCallback, Callback } from './@ohos.base';
|
2023-10-31 01:49:45 +00:00
|
|
|
import type Context from './application/Context';
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* System print
|
2024-07-29 11:32:57 +00:00
|
|
|
*
|
2023-08-31 02:38:53 +00:00
|
|
|
* @namespace print
|
2023-07-27 08:54:56 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
declare namespace print {
|
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
|
|
|
* PrintTask provide event callback.
|
|
|
|
* @interface PrintTask
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface PrintTask {
|
2023-07-27 08:54:56 +00:00
|
|
|
/**
|
2023-09-15 12:11:35 +00:00
|
|
|
* Register event callback when the current print task is in process.
|
2023-07-27 08:54:56 +00:00
|
|
|
* @permission ohos.permission.PRINT
|
2023-09-15 12:11:35 +00:00
|
|
|
* @param { 'block' } type - Indicates the print task has been blocked.
|
|
|
|
* @param { Callback<void> } callback - The callback function for print task change event
|
2023-07-27 08:54:56 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-07-27 08:54:56 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
on(type: 'block', callback: Callback<void>): void;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-15 12:11:35 +00:00
|
|
|
* Register event callback when the current print task is in process.
|
2023-07-27 08:54:56 +00:00
|
|
|
* @permission ohos.permission.PRINT
|
2023-09-15 12:11:35 +00:00
|
|
|
* @param { 'succeed' } type - Indicates the print task succeed.
|
|
|
|
* @param { Callback<void> } callback - The callback function for print task change event
|
2023-07-27 08:54:56 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-08-31 02:38:53 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2023-07-27 08:54:56 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
on(type: 'succeed', callback: Callback<void>): void;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-15 12:11:35 +00:00
|
|
|
* Register event callback when the current print task is in process.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { 'fail' } type - Indicates the print task has completed with failure.
|
|
|
|
* @param { Callback<void> } callback - The callback function for print task change event
|
2023-07-27 08:54:56 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-07-27 08:54:56 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
on(type: 'fail', callback: Callback<void>): void;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-15 12:11:35 +00:00
|
|
|
* Register event callback when the current print task is in process.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { 'cancel' } type - Indicates the print task has been cancelled.
|
|
|
|
* @param { Callback<void> } callback - The callback function for print task change event
|
2023-07-27 08:54:56 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-07-27 08:54:56 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
on(type: 'cancel', callback: Callback<void>): void;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-15 12:11:35 +00:00
|
|
|
* Unregister event callback when the current print task is in process.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { 'block' } type - Indicates the print task has been blocked.
|
|
|
|
* @param { Callback<void> } callback - The callback function for print task change event
|
2023-07-27 08:54:56 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-07-27 08:54:56 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
off(type: 'block', callback?: Callback<void>): void;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-15 12:11:35 +00:00
|
|
|
* Unregister event callback when the current print task is in process.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { 'succeed' } type - Indicates the print task succeed.
|
|
|
|
* @param { Callback<void> } callback - The callback function for print task change event
|
2023-07-27 08:54:56 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-07-27 08:54:56 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
off(type: 'succeed', callback?: Callback<void>): void;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-15 12:11:35 +00:00
|
|
|
* Unregister event callback when the current print task is in process.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { 'fail' } type - Indicates the print task has completed with failure.
|
|
|
|
* @param { Callback<void> } callback - The callback function for print task change event
|
2023-07-27 08:54:56 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-07-27 08:54:56 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
off(type: 'fail', callback?: Callback<void>): void;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-15 12:11:35 +00:00
|
|
|
* Unregister event callback when the current print task is in process.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { 'cancel' } type - Indicates the print task has been cancelled.
|
|
|
|
* @param { Callback<void> } callback - The callback function for print task change event
|
2023-07-27 08:54:56 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-07-27 08:54:56 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
off(type: 'cancel', callback?: Callback<void>): void;
|
|
|
|
}
|
|
|
|
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
|
|
|
* Third-party application implement this interface to render files to be printed.
|
|
|
|
* @interface PrintDocumentAdapter
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
interface PrintDocumentAdapter {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implement this function to update the print file.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { string } jobId - Indicates print job id.
|
|
|
|
* @param { PrintAttributes } oldAttrs - Indicates old print attributes.
|
|
|
|
* @param { PrintAttributes } newAttrs - Indicates new print attributes.
|
|
|
|
* @param { number } fd - Indicates print file fd.
|
2023-11-21 01:16:38 +00:00
|
|
|
* @param { function } writeResultCallback - Indicates this function should execute after the file is updated.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
onStartLayoutWrite(jobId: string, oldAttrs: PrintAttributes, newAttrs: PrintAttributes, fd: number,
|
2023-11-21 13:23:26 +00:00
|
|
|
writeResultCallback: (jobId: string, writeResult: PrintFileCreationState) => void): void;
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implement this function to listen job status change.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { string } jobId - Indicates print job id.
|
2023-11-21 13:23:26 +00:00
|
|
|
* @param { PrintDocumentAdapterState } state - Indicates job changes to this state.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
onJobStateChanged(jobId: string, state: PrintDocumentAdapterState): void;
|
2023-11-20 12:15:14 +00:00
|
|
|
}
|
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
|
|
|
* Start new print task for App.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { Array<string> } files - Indicates the filepath list to be printed. Only pdf and picture filetype are supported.
|
|
|
|
* @param { AsyncCallback<PrintTask> } callback - The callback function for print task.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function print(files: Array<string>, callback: AsyncCallback<PrintTask>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start new print task for App.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { Array<string> } files - Indicates the filepath list to be printed. Only pdf and picture filetype are supported.
|
|
|
|
* @returns { Promise<PrintTask> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function print(files: Array<string>): Promise<PrintTask>;
|
|
|
|
|
2023-10-31 01:49:45 +00:00
|
|
|
/**
|
|
|
|
* Start new print task for App.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { Array<string> } files - Indicates the filepath list to be printed. Only pdf and picture filetype are supported.
|
|
|
|
* @param { Context } context - The ability context that initiates the call print request.
|
|
|
|
* @param { AsyncCallback<PrintTask> } callback - The callback function for print task.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-10-31 01:49:45 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2023-11-03 08:38:12 +00:00
|
|
|
* @since 11
|
2023-10-31 01:49:45 +00:00
|
|
|
*/
|
|
|
|
function print(files: Array<string>, context: Context, callback: AsyncCallback<PrintTask>): void;
|
2024-07-29 11:32:57 +00:00
|
|
|
|
2023-10-31 01:49:45 +00:00
|
|
|
/**
|
|
|
|
* Start new print task for App.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { Array<string> } files - Indicates the filepath list to be printed. Only pdf and picture filetype are supported.
|
|
|
|
* @param { Context } context - The ability context that initiates the call print request.
|
|
|
|
* @returns { Promise<PrintTask> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-10-31 01:49:45 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2023-11-03 08:38:12 +00:00
|
|
|
* @since 11
|
2023-10-31 01:49:45 +00:00
|
|
|
*/
|
|
|
|
function print(files: Array<string>, context: Context): Promise<PrintTask>;
|
|
|
|
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
2023-11-20 13:00:57 +00:00
|
|
|
* Start new print task for App And the App need update print file.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { string } jobName - Indicates print file Name.
|
|
|
|
* @param { PrintDocumentAdapter } printAdapter - Indicates functions implemented by the cpp.
|
|
|
|
* @param { PrintAttributes } printAttributes - Indicates print attributes.
|
|
|
|
* @param { Context } context - The ability context that initiates the call print request.
|
|
|
|
* @returns { Promise<PrintTask> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
function print(jobName: string, printAdapter: PrintDocumentAdapter, printAttributes: PrintAttributes,
|
|
|
|
context: Context): Promise<PrintTask>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines print attributes.
|
|
|
|
* @typedef PrintAttributes
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
interface PrintAttributes {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Copies of document list.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
copyNumber?: number;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Range size to be printed.
|
|
|
|
* @type { ?PrintPageRange }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-12-27 07:42:19 +00:00
|
|
|
pageRange?: PrintPageRange;
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Page size.
|
|
|
|
* @type { ?(PrintPageSize | PrintPageType) }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
pageSize?: PrintPageSize | PrintPageType;
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print direction.
|
|
|
|
* @type { ?PrintDirectionMode }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
directionMode?: PrintDirectionMode;
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Color mode.
|
|
|
|
* @type { ?PrintColorMode }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
colorMode?: PrintColorMode;
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Duplex mode.
|
|
|
|
* @type { ?PrintDuplexMode }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
duplexMode?: PrintDuplexMode;
|
2023-11-20 12:15:14 +00:00
|
|
|
}
|
|
|
|
|
2023-12-27 07:42:19 +00:00
|
|
|
/**
|
|
|
|
* defines print page range.
|
|
|
|
* @typedef PrintPageRange
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
interface PrintPageRange {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Start page of sequence.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-12-27 07:42:19 +00:00
|
|
|
startPage?: number;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* End page of sequence.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-12-27 07:42:19 +00:00
|
|
|
endPage?: number;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Discrete page of sequence.
|
|
|
|
* @type { ?Array<number> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-12-27 07:42:19 +00:00
|
|
|
pages?: Array<number>;
|
|
|
|
}
|
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
|
|
|
* defines print margin.
|
|
|
|
* @typedef PrintMargin
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface PrintMargin {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Top margin.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
top?: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Bottom margin.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
bottom?: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Left margin.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
left?: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Right margin.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
right?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines print range.
|
|
|
|
* @typedef PrinterRange
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2023-12-27 07:42:19 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-09-15 12:11:35 +00:00
|
|
|
*/
|
|
|
|
interface PrinterRange {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Start page of sequence.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
startPage?: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* End page of sequence.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
endPage?: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Discrete page of sequence.
|
|
|
|
* @type { ?Array<number> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
pages?: Array<number>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines print preview attribute.
|
|
|
|
* @typedef PreviewAttribute
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface PreviewAttribute {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Preview page range.
|
|
|
|
* @type { PrinterRange }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
previewRange: PrinterRange;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Preview file result.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
result?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines print resolution.
|
|
|
|
* @typedef PrintResolution
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface PrintResolution {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Resolution id.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
id: string;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Horizontal DPI.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
horizontalDpi: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Vertical DPI.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
verticalDpi: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines print page size.
|
|
|
|
* @typedef PrintPageSize
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2023-11-24 06:09:39 +00:00
|
|
|
* @since 11
|
2023-09-15 12:11:35 +00:00
|
|
|
*/
|
|
|
|
interface PrintPageSize {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Page size id.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
id: string;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Page size name.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
name: string;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Unit: millimeter width.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
width: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Unit: millimeter height.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
height: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines print capability.
|
|
|
|
* @typedef PrinterCapability
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface PrinterCapability {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Color mode.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
colorMode: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Duplex mode.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
duplexMode: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* The page size list supported by the printer.
|
|
|
|
* @type { Array<PrintPageSize> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
pageSize: Array<PrintPageSize>;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* The resolution list supported by the printer.
|
|
|
|
* @type { ?Array<PrintResolution> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
resolution?: Array<PrintResolution>;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Min margin of printer.
|
|
|
|
* @type { ?PrintMargin }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
minMargin?: PrintMargin;
|
2023-10-31 01:49:45 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* JSON object string.
|
|
|
|
* @type { ?Object }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-03 08:54:46 +00:00
|
|
|
options?: Object;
|
2023-09-15 12:11:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines print info.
|
|
|
|
* @typedef PrinterInfo
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface PrinterInfo {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer id.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
printerId: string;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer name.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
printerName: string;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Current printer state.
|
|
|
|
* @type { PrinterState }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
printerState: PrinterState;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Resource id of printer icon.
|
|
|
|
* @type { ?number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
printerIcon?: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer description.
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
description?: string;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer capability.
|
|
|
|
* @type { ?PrinterCapability }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
capability?: PrinterCapability;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* JSON object string.
|
|
|
|
* @type { ?Object }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
options?: Object;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines print job.
|
|
|
|
* @typedef PrintJob
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface PrintJob {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Document fd list to be printed.
|
|
|
|
* @type { Array<number> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
fdList: Array<number>;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Job id.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
jobId: string;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer id to take charge of printing.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
printerId: string;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Current print job state.
|
|
|
|
* @type { PrintJobState }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
jobState: PrintJobState;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
2023-11-10 09:25:47 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Current print job sub state.
|
|
|
|
* @type { PrintJobSubState }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-13 02:33:59 +00:00
|
|
|
jobSubstate: PrintJobSubState;
|
2023-11-10 09:25:47 +00:00
|
|
|
|
2023-07-27 08:54:56 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Copies of document list.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
copyNumber: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Range size to be printed.
|
|
|
|
* @type { PrinterRange }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
pageRange: PrinterRange;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Sequential print.
|
|
|
|
* @type { boolean }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
isSequential: boolean;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* The selected page size.
|
|
|
|
* @type { PrintPageSize }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
pageSize: PrintPageSize;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Vertical printing.
|
|
|
|
* @type { boolean }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
isLandscape: boolean;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Color mode.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
colorMode: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Duplex mode.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
duplexMode: number;
|
2023-07-27 08:54:56 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Current margin setting.
|
|
|
|
* @type { ?PrintMargin }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
margin?: PrintMargin;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Preview setting.
|
|
|
|
* @type { ?PreviewAttribute }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
preview?: PreviewAttribute;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* JSON object string.
|
|
|
|
* @type { ?Object }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
options?: Object;
|
|
|
|
}
|
|
|
|
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
2023-11-21 13:23:26 +00:00
|
|
|
* Enumeration of Print Direction Mode.
|
|
|
|
* @enum { number } PrintDirectionMode
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
enum PrintDirectionMode {
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Automatically select direction.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
DIRECTION_MODE_AUTO = 0,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print portrait.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
DIRECTION_MODE_PORTRAIT = 1,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print landscape.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
DIRECTION_MODE_LANDSCAPE = 2,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-11-21 13:23:26 +00:00
|
|
|
* Enumeration of Print Color Mode.
|
|
|
|
* @enum { number } PrintColorMode
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
enum PrintColorMode {
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print monochrome.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
COLOR_MODE_MONOCHROME = 0,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Color printing.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
COLOR_MODE_COLOR = 1,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-11-21 13:23:26 +00:00
|
|
|
* Enumeration of Print Duplex Mode.
|
|
|
|
* @enum { number } PrintDuplexMode
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
enum PrintDuplexMode {
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Single side printing.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
DUPLEX_MODE_NONE = 0,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Long-edge flip-up duplex printing.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
DUPLEX_MODE_LONG_EDGE = 1,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Short-edge flip-up duplex printing.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
DUPLEX_MODE_SHORT_EDGE = 2,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-11-21 13:23:26 +00:00
|
|
|
* Enumeration of Print Page Type.
|
|
|
|
* @enum { number } PrintPageType
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
enum PrintPageType {
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* A3 page.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PAGE_ISO_A3 = 0,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* A4 page.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PAGE_ISO_A4 = 1,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* A5 page.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PAGE_ISO_A5 = 2,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* B5 page.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-12-12 14:31:13 +00:00
|
|
|
PAGE_JIS_B5 = 3,
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* C5 page.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PAGE_ISO_C5 = 4,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* DL Envelope.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PAGE_ISO_DL = 5,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Letter.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PAGE_LETTER = 6,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Legal.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PAGE_LEGAL = 7,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Photo 4x6.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 01:16:38 +00:00
|
|
|
PAGE_PHOTO_4X6 = 8,
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Photo 5x7.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 01:16:38 +00:00
|
|
|
PAGE_PHOTO_5X7 = 9,
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Envelope INT DL.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PAGE_INT_DL_ENVELOPE = 10,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Tabloid B.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PAGE_B_TABLOID = 11,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-11-21 13:23:26 +00:00
|
|
|
* Enumeration of Print Document Adapter State.
|
|
|
|
* @enum { number } PrintDocumentAdapterState
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
enum PrintDocumentAdapterState {
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Preview failed.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
PREVIEW_DESTROY = 0,
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print state is succeed.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PRINT_TASK_SUCCEED = 1,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print state is fail.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PRINT_TASK_FAIL = 2,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print state is cancel.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PRINT_TASK_CANCEL = 3,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print state is block.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-20 12:15:14 +00:00
|
|
|
PRINT_TASK_BLOCK = 4,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-11-21 13:23:26 +00:00
|
|
|
* Enumeration of Print File Creation State.
|
|
|
|
* @enum { number } PrintFileCreationState
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
enum PrintFileCreationState {
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print file created success.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
PRINT_FILE_CREATED = 0,
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print file created fail.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
PRINT_FILE_CREATION_FAILED = 1,
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print file created success but unrendered.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
PRINT_FILE_CREATED_UNRENDERED = 2,
|
2023-11-20 12:15:14 +00:00
|
|
|
}
|
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
|
|
|
* Enumeration of Printer State.
|
|
|
|
* @enum { number } PrinterState
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum PrinterState {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* New printers arrival.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINTER_ADDED = 0,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer lost.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINTER_REMOVED = 1,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer update.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-01 03:29:46 +00:00
|
|
|
PRINTER_CAPABILITY_UPDATED = 2,
|
2023-09-15 12:11:35 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer has been connected.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINTER_CONNECTED = 3,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer has been disconnected.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINTER_DISCONNECTED = 4,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Printer is working.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINTER_RUNNING = 5,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumeration of Print Job State.
|
|
|
|
* @enum { number } PrintJobState
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum PrintJobState {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Initial state of print job.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_PREPARE = 0,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Deliver print job to the printer.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_QUEUED = 1,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Executing print job.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_RUNNING = 2,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print job has been blocked.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCKED = 3,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print job completed.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_COMPLETED = 4,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumeration of Print Job Sub State.
|
|
|
|
* @enum { number } PrintJobSubState
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum PrintJobSubState {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print job succeed.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_COMPLETED_SUCCESS = 0,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print job fail.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_COMPLETED_FAILED = 1,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print job has been cancelled.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_COMPLETED_CANCELLED = 2,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print job has been corrupted.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-01 03:29:46 +00:00
|
|
|
PRINT_JOB_COMPLETED_FILE_CORRUPTED = 3,
|
2023-09-15 12:11:35 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print is offline.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_OFFLINE = 4,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print is occupied by other process.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_BUSY = 5,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print job has been cancelled.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_CANCELLED = 6,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print out of paper.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_OUT_OF_PAPER = 7,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print out of ink.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_OUT_OF_INK = 8,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print out of toner.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_OUT_OF_TONER = 9,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print paper jam.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_JAMMED = 10,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print cover open.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_DOOR_OPEN = 11,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print service request.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_SERVICE_REQUEST = 12,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print low on ink.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_LOW_ON_INK = 13,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print low on toner.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_LOW_ON_TONER = 14,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print really low on ink.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_REALLY_LOW_ON_INK = 15,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print bad certification.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_BAD_CERTIFICATE = 16,
|
|
|
|
|
2023-10-31 01:49:45 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print an error occurred when printing the account.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-10-31 01:49:45 +00:00
|
|
|
PRINT_JOB_BLOCK_ACCOUNT_ERROR = 18,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print the printing permission is abnormal.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-10-31 01:49:45 +00:00
|
|
|
PRINT_JOB_BLOCK_PRINT_PERMISSION_ERROR = 19,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print color printing permission exception.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-10-31 01:49:45 +00:00
|
|
|
PRINT_JOB_BLOCK_PRINT_COLOR_PERMISSION_ERROR = 20,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print the device is not connected to the network.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-10-31 01:49:45 +00:00
|
|
|
PRINT_JOB_BLOCK_NETWORK_ERROR = 21,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print unable to connect to the server.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-13 02:33:59 +00:00
|
|
|
PRINT_JOB_BLOCK_SERVER_CONNECTION_ERROR = 22,
|
2023-10-31 01:49:45 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print large file exception.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-10-31 01:49:45 +00:00
|
|
|
PRINT_JOB_BLOCK_LARGE_FILE_ERROR = 23,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print file parsing exception.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-13 02:33:59 +00:00
|
|
|
PRINT_JOB_BLOCK_FILE_PARSING_ERROR = 24,
|
2023-10-31 01:49:45 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print the file conversion is too slow.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-13 02:33:59 +00:00
|
|
|
PRINT_JOB_BLOCK_SLOW_FILE_CONVERSION = 25,
|
2023-10-31 01:49:45 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print uploading file.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-10-31 01:49:45 +00:00
|
|
|
PRINT_JOB_RUNNING_UPLOADING_FILES = 26,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print converting files.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-10-31 01:49:45 +00:00
|
|
|
PRINT_JOB_RUNNING_CONVERTING_FILES = 27,
|
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Print unknown issue.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
PRINT_JOB_BLOCK_UNKNOWN = 99,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumeration of Print error Code.
|
|
|
|
* @enum { number } PrintErrorCode
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum PrintErrorCode {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* No error.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
E_PRINT_NONE = 0,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* No permission.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
E_PRINT_NO_PERMISSION = 201,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Invalid parameter.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
E_PRINT_INVALID_PARAMETER = 401,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Generic failure of print.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
E_PRINT_GENERIC_FAILURE = 13100001,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* RPC failure.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
E_PRINT_RPC_FAILURE = 13100002,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Failure of print service.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
E_PRINT_SERVER_FAILURE = 13100003,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Invalid print extension.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
E_PRINT_INVALID_EXTENSION = 13100004,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Invalid printer.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
E_PRINT_INVALID_PRINTER = 13100005,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Invalid print job.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-01 03:29:46 +00:00
|
|
|
E_PRINT_INVALID_PRINT_JOB = 13100006,
|
2023-09-15 12:11:35 +00:00
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* File i/o error.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
E_PRINT_FILE_IO = 13100007,
|
|
|
|
}
|
|
|
|
|
2024-04-17 14:31:46 +00:00
|
|
|
/**
|
|
|
|
* Enumeration of application event.
|
|
|
|
* @enum { number } ApplicationEvent
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
enum ApplicationEvent {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Application created.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
2024-04-17 14:31:46 +00:00
|
|
|
APPLICATION_CREATED = 0,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Application closed for printing started.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
2024-04-17 14:31:46 +00:00
|
|
|
APPLICATION_CLOSED_FOR_STARTED = 1,
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Application closed for printing canceled.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
2024-04-17 14:31:46 +00:00
|
|
|
APPLICATION_CLOSED_FOR_CANCELED = 2,
|
|
|
|
}
|
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
|
|
|
* defines print ExtensionInfo.
|
|
|
|
* @typedef PrinterExtensionInfo
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface PrinterExtensionInfo {
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Extension id of printer extension.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
extensionId: string;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Vendor id of extension.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
vendorId: string;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Vendor name.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
vendorName: string;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Vendor icon.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
vendorIcon: number;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Version of current printer extension.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
version: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all printer extension installed.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { AsyncCallback<Array<PrinterExtensionInfo>> } callback - The callback function for handling the extension list found.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function queryAllPrinterExtensionInfos(callback: AsyncCallback<Array<PrinterExtensionInfo>>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all printer extension installed.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @returns { Promise<Array<PrinterExtensionInfo>> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function queryAllPrinterExtensionInfos(): Promise<Array<PrinterExtensionInfo>>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load the specific printer extension and start to discover printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { Array<string> } extensionList - Indicates the list of printer extension.
|
|
|
|
* empty list of extensionList Indicates to find printer with all installed extension.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function startDiscoverPrinter(extensionList: Array<string>, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load the specific printer extension and start to discover printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { Array<string> } extensionList - Indicates the list of printer extension.
|
|
|
|
* empty list of extensionList Indicates to find printer with all installed extension.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function startDiscoverPrinter(extensionList: Array<string>): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stop discovering the printer with specific printer extension.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function stopDiscoverPrinter(callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stop discovering the printer with specific printer extension.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function stopDiscoverPrinter(): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Connect the specific printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
function connectPrinter(printerId: string, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Connect the specific printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
function connectPrinter(printerId: string): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Disconnect the specific printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
function disconnectPrinter(printerId: string, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
2024-07-29 11:32:57 +00:00
|
|
|
* Disconnect the specific printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-15 12:11:35 +00:00
|
|
|
function disconnectPrinter(printerId: string): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Query capability for the specific printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for capability from printer.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function queryPrinterCapability(printerId: string, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Query capability for the specific printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function queryPrinterCapability(printerId: string): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start print job.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { PrintJob } jobInfo - Indicates the information of print job.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function startPrintJob(jobInfo: PrintJob, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start print job.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { PrintJob } jobInfo - Indicates the information of print job.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function startPrintJob(jobInfo: PrintJob): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancel the print job has been sent to printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } jobId - Indicates the specific print job.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function cancelPrintJob(jobId: string, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancel the print job has been sent to printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } jobId - Indicates the specific print job.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function cancelPrintJob(jobId: string): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request preview of the print job.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { PrintJob } jobInfo - Indicates the information of print job.
|
|
|
|
* @param { Callback<number> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function requestPrintPreview(jobInfo: PrintJob, callback: Callback<number>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request preview of the print job.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { PrintJob } jobInfo - Indicates the information of print job.
|
|
|
|
* @returns { Promise<number> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function requestPrintPreview(jobInfo: PrintJob): Promise<number>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register event callback for the state change of printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { 'printerStateChange' } type - Indicates state change of printer.
|
|
|
|
* @param { function } callback - The callback function for state change of printer.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function on(type: 'printerStateChange', callback: (state: PrinterState, info: PrinterInfo) => void): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unregister event callback for the state change of printer.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { 'printerStateChange' } type - Indicates state change of printer.
|
|
|
|
* @param { Callback<boolean> } callback - The callback function for state change of printer.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function off(type: 'printerStateChange', callback?: Callback<boolean>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register event callback for the state change of print job.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { 'jobStateChange' } type - Indicates state change of printer.
|
|
|
|
* @param { function } callback - The callback function for state change of printer.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function on(type: 'jobStateChange', callback: (state: PrintJobState, job: PrintJob) => void): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unregister event callback for the state change of print job.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { 'jobStateChange' } type - Indicates state change of printer.
|
|
|
|
* @param { Callback<boolean> } callback - The callback function for state change of printer.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function off(type: 'jobStateChange', callback?: Callback<boolean>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register event callback for the information change of print extension.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { 'extInfoChange' } type - Indicates information change of print extension.
|
|
|
|
* @param { function } callback - The callback function for information change of print extension.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function on(type: 'extInfoChange', callback: (extensionId: string, info: string) => void): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unregister event callback for the information change of print extension.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { 'extInfoChange' } type - Indicates state change of printer.
|
|
|
|
* @param { Callback<boolean> } callback - The callback function for state change of printer.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function off(type: 'extInfoChange', callback?: Callback<boolean>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* New printers have been found and notify Print SA.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { Array<PrinterInfo> } printers - Indicates new arrived printer lists.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function addPrinters(printers: Array<PrinterInfo>, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* New printers have been found and notify Print SA.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { Array<PrinterInfo> } printers - Indicates new arrived printer lists.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function addPrinters(printers: Array<PrinterInfo>): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Printers have been lost and notify Print SA.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { Array<string> } printerIds - Indicates the lost printer lists.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function removePrinters(printerIds: Array<string>, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Printers have been lost and notify Print SA.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { Array<string> } printerIds - Indicates the lost printer lists.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function removePrinters(printerIds: Array<string>): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the information of the specific printers.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { Array<PrinterInfo> } printers - Indicates to be updated printer lists.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function updatePrinters(printers: Array<PrinterInfo>, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the information of the specific printers.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { Array<PrinterInfo> } printers - Indicates to be updated printer lists.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function updatePrinters(printers: Array<PrinterInfo>): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify Print SA the state of printer has been changed.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @param { PrinterState } state - Indicates state of the printer.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function updatePrinterState(printerId: string, state: PrinterState, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify Print SA the state of printer has been changed.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @param { PrinterState } state - Indicates state of the printer.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function updatePrinterState(printerId: string, state: PrinterState): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify Print SA the state of print job has been changed.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string} jobId - Indicates id of the print job.
|
|
|
|
* @param { PrintJobState } state - Indicates new state of print job.
|
|
|
|
* @param { PrintJobSubState } subState - Indicates sub state of print job.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function updatePrintJobState(jobId: string, state: PrintJobState, subState: PrintJobSubState, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify Print SA the state of print job has been changed.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string} jobId - Indicates id of the print job.
|
|
|
|
* @param { PrintJobState } state - Indicates new state of print job.
|
|
|
|
* @param { PrintJobSubState } subState - Indicates sub state of print job.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function updatePrintJobState(jobId: string, state: PrintJobState, subState: PrintJobSubState): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify Print SA the state of print extension has been changed.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } info - Indicates changed information of print extension.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function updateExtensionInfo(info: string, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify Print SA the state of print extension has been changed.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } info - Indicates changed information of print extension.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function updateExtensionInfo(info: string): Promise<void>;
|
|
|
|
|
2023-11-02 06:28:52 +00:00
|
|
|
/**
|
|
|
|
* Get all the printJobs in the queue.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for handling the printJob list found.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-11-02 07:04:48 +00:00
|
|
|
* @deprecated since 11
|
2023-11-03 08:38:12 +00:00
|
|
|
* @useinstead print#queryPrintJobList
|
2023-11-02 06:28:52 +00:00
|
|
|
*/
|
|
|
|
function queryAllPrintJobs(callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all the printJobs in the queue.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 10
|
2023-11-02 07:04:48 +00:00
|
|
|
* @deprecated since 11
|
2023-11-03 08:38:12 +00:00
|
|
|
* @useinstead print#queryPrintJobList
|
2023-11-02 06:28:52 +00:00
|
|
|
*/
|
|
|
|
function queryAllPrintJobs(): Promise<void>;
|
|
|
|
|
2023-09-15 12:11:35 +00:00
|
|
|
/**
|
|
|
|
* Get all the printJobs in the queue.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
2023-11-02 03:18:17 +00:00
|
|
|
* @param { AsyncCallback<Array<PrintJob>> } callback - The callback function for handling the printJob list found.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
2023-11-02 08:55:26 +00:00
|
|
|
* @since 11
|
2023-09-15 12:11:35 +00:00
|
|
|
*/
|
2023-11-03 08:38:12 +00:00
|
|
|
function queryPrintJobList(callback: AsyncCallback<Array<PrintJob>>): void;
|
2023-09-15 12:11:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all the printJobs in the queue.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
2023-11-02 03:18:17 +00:00
|
|
|
* @returns { Promise<Array<PrintJob>> } the promise returned by the function.
|
2023-09-15 12:11:35 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
2023-11-02 08:55:26 +00:00
|
|
|
* @since 11
|
2023-09-15 12:11:35 +00:00
|
|
|
*/
|
2023-11-03 08:38:12 +00:00
|
|
|
function queryPrintJobList(): Promise<Array<PrintJob>>;
|
2023-10-31 01:49:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get printJob by jobId.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } jobId - Indicates id of the print job.
|
|
|
|
* @param { AsyncCallback<PrintJob> } callback - The callback function for get printJob by jobId.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-10-31 01:49:45 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
2023-11-03 08:38:12 +00:00
|
|
|
* @since 11
|
2023-10-31 01:49:45 +00:00
|
|
|
*/
|
|
|
|
function queryPrintJobById(jobId: string, callback: AsyncCallback<PrintJob>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get printJob by jobId.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } jobId - Indicates id of the print job.
|
|
|
|
* @returns { Promise<PrintJob> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-10-31 01:49:45 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
2023-11-03 08:38:12 +00:00
|
|
|
* @since 11
|
2023-10-31 01:49:45 +00:00
|
|
|
*/
|
|
|
|
function queryPrintJobById(jobId: string): Promise<PrintJob>;
|
2023-11-20 12:15:14 +00:00
|
|
|
|
|
|
|
/**
|
2023-11-21 13:23:26 +00:00
|
|
|
* Start getting print file.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } jobId - Indicates id of the print job.
|
|
|
|
* @param { PrintAttributes } printAttributes - Indicates print attributes.
|
|
|
|
* @param { number } fd - Indicates print file fd.
|
2023-11-21 13:23:26 +00:00
|
|
|
* @param { Callback<PrintFileCreationState> } onFileStateChanged - The callback function for update the file state.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-21 13:23:26 +00:00
|
|
|
function startGettingPrintFile(jobId: string, printAttributes: PrintAttributes, fd: number,
|
|
|
|
onFileStateChanged: Callback<PrintFileCreationState>): void;
|
2023-11-20 12:15:14 +00:00
|
|
|
|
2024-02-01 11:36:28 +00:00
|
|
|
/**
|
|
|
|
* Notify print service the information.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } jobId - Indicates id of the print job.
|
|
|
|
* @param { 'spooler_closed_for_cancelled' | 'spooler_closed_for_started' } type - Indicates notify information.
|
|
|
|
* @param { AsyncCallback<void> } callback - The callback function for indcating the result of API execution.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2024-02-01 11:36:28 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
function notifyPrintService(jobId: string, type: 'spooler_closed_for_cancelled' | 'spooler_closed_for_started', callback: AsyncCallback<void>): void;
|
2024-07-29 11:32:57 +00:00
|
|
|
|
2023-11-20 12:15:14 +00:00
|
|
|
/**
|
|
|
|
* Notify print service the information.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } jobId - Indicates id of the print job.
|
|
|
|
* @param { 'spooler_closed_for_cancelled' | 'spooler_closed_for_started' } type - Indicates notify information.
|
2023-11-21 01:16:38 +00:00
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2023-11-20 12:15:14 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
function notifyPrintService(jobId: string, type: 'spooler_closed_for_cancelled' | 'spooler_closed_for_started'): Promise<void>;
|
2024-03-05 11:15:28 +00:00
|
|
|
|
|
|
|
/**
|
2024-03-06 03:26:44 +00:00
|
|
|
* Get all added printers.
|
2024-09-02 12:09:04 +00:00
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
2024-03-05 11:15:28 +00:00
|
|
|
* @returns { Promise<Array<string>> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @systemapi Hide this for inner system use.
|
2024-03-05 11:15:28 +00:00
|
|
|
* @since 12
|
|
|
|
*/
|
2024-03-06 03:26:44 +00:00
|
|
|
function getAddedPrinters(): Promise<Array<string>>;
|
2024-03-05 11:15:28 +00:00
|
|
|
|
|
|
|
/**
|
2024-03-06 03:26:44 +00:00
|
|
|
* Get printer info by printer id.
|
2024-03-05 11:15:28 +00:00
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @returns { Promise<PrinterInfo> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2024-03-05 11:15:28 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 12
|
|
|
|
*/
|
2024-03-06 03:26:44 +00:00
|
|
|
function getPrinterInfoById(printerId: string): Promise<PrinterInfo>;
|
2024-04-17 14:31:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify print service of application event.
|
|
|
|
* @permission ohos.permission.MANAGE_PRINT_JOB
|
|
|
|
* @param { ApplicationEvent } event - Indicates the event to be notified.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 202 - not system application
|
2024-05-23 11:24:51 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
2024-04-17 14:31:46 +00:00
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
|
|
|
* @systemapi Hide this for inner system use.
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
function notifyPrintServiceEvent(event: ApplicationEvent): Promise<void>;
|
2024-07-29 11:32:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* New printers have been found and notify Print SA.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { PrinterInformation } printerInformation - Indicates new arrived printer lists.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
function addPrinterToDiscovery(printerInformation: PrinterInformation): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the information of the specific printer.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { PrinterInformation } printerInformation - Indicates to be updated printer lists.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
function updatePrinterInDiscovery(printerInformation: PrinterInformation): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify Print SA to remove printer.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { string } printerId - Indicates the lost printer lists.
|
|
|
|
* @returns { Promise<void> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
function removePrinterFromDiscovery(printerId: string): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get printerInformation by printer id.
|
|
|
|
* @permission ohos.permission.PRINT
|
|
|
|
* @param { string } printerId - Indicates id of the printer.
|
|
|
|
* @returns { Promise<PrinterInformation> } the promise returned by the function.
|
|
|
|
* @throws { BusinessError } 201 - the application does not have permission to call this function.
|
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
function getPrinterInformationById(printerId: string): Promise<PrinterInformation>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines printer information.
|
|
|
|
* @typedef PrinterInformation
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
interface PrinterInformation {
|
|
|
|
/**
|
|
|
|
* Printer id.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
printerId: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Printer name.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
printerName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Current printer status.
|
|
|
|
* @type { PrinterStatus }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
printerStatus: PrinterStatus;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Printer description.
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
description?: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Printer capabilities.
|
|
|
|
* @type { ?PrinterCapabilities }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
capability?: PrinterCapabilities;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Printer uri.
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
uri?: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Printer make.
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
printerMake?: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Detail information in json format.
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
options?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* defines printer capabilities.
|
|
|
|
* @typedef PrinterCapabilities
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
interface PrinterCapabilities {
|
|
|
|
/**
|
|
|
|
* The page size list supported by the printer.
|
|
|
|
* @type { Array<PrintPageSize> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
supportedPageSizes: Array<PrintPageSize>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Array of supported color mode.
|
|
|
|
* @type { Array<PrintColorMode> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
supportedColorModes: Array<PrintColorMode>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Array of supported duplex mode.
|
|
|
|
* @type { Array<PrintDuplexMode> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
supportedDuplexModes: Array<PrintDuplexMode>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Array of supported print media types.
|
|
|
|
* @type { ?Array<string> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
supportedMediaTypes?: Array<string>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Array of supported print quality.
|
|
|
|
* @type { ?Array<PrintQuality> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
supportedQualities?: Array<PrintQuality>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Array of supported print orientation.
|
|
|
|
* @type { ?Array<PrintOrientationMode> }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
supportedOrientations?: Array<PrintOrientationMode>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Advanced capability in json format.
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
options?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumeration of Print Quality.
|
|
|
|
* @enum { number } PrintQuality
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
enum PrintQuality {
|
|
|
|
/**
|
|
|
|
* Draft quality mode.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
QUALITY_DRAFT = 3,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Normal quality mode.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
QUALITY_NORMAL = 4,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* High quality mode.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
QUALITY_HIGH = 5,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumeration of Print OrientationMode.
|
|
|
|
* @enum { number } PrintOrientationMode
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
enum PrintOrientationMode {
|
|
|
|
/**
|
|
|
|
* Portrait mode.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
ORIENTATION_MODE_PORTRAIT = 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Landscape mode.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
ORIENTATION_MODE_LANDSCAPE= 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse landscape mode.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
ORIENTATION_MODE_REVERSE_LANDSCAPE = 2,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse portrait mode.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
ORIENTATION_MODE_REVERSE_PORTRAIT = 3,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Not specified.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
ORIENTATION_MODE_NONE = 4,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumeration of Printer Status.
|
|
|
|
* @enum { number } PrinterStatus
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
enum PrinterStatus {
|
|
|
|
/**
|
|
|
|
* Printer idle.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
PRINTER_IDLE = 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Printer busy.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
PRINTER_BUSY = 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Printer not available.
|
|
|
|
* @syscap SystemCapability.Print.PrintFramework
|
2024-09-02 12:09:04 +00:00
|
|
|
* @since 13
|
2024-07-29 11:32:57 +00:00
|
|
|
*/
|
|
|
|
PRINTER_UNAVAILABLE = 2,
|
|
|
|
}
|
|
|
|
|
2023-07-27 08:54:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default print;
|