17777dab0Sopenharmony_ci/* 27777dab0Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License. 57777dab0Sopenharmony_ci * You may obtain a copy of the License at 67777dab0Sopenharmony_ci * 77777dab0Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 87777dab0Sopenharmony_ci * 97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and 137777dab0Sopenharmony_ci * limitations under the License. 147777dab0Sopenharmony_ci */ 157777dab0Sopenharmony_ci 167777dab0Sopenharmony_ci/** 177777dab0Sopenharmony_ci * @addtogroup OH_Scan 187777dab0Sopenharmony_ci * @{ 197777dab0Sopenharmony_ci * 207777dab0Sopenharmony_ci * @brief Provides the definition of the C interface for the scan module. 217777dab0Sopenharmony_ci * 227777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 237777dab0Sopenharmony_ci * 247777dab0Sopenharmony_ci * @since 12 257777dab0Sopenharmony_ci * @version 1.0 267777dab0Sopenharmony_ci */ 277777dab0Sopenharmony_ci 287777dab0Sopenharmony_ci/** 297777dab0Sopenharmony_ci * @file ohscan.h 307777dab0Sopenharmony_ci * 317777dab0Sopenharmony_ci * @brief Declares the APIs to discover and connect scanners, scan images from the scanner, 327777dab0Sopenharmony_ci * obtain the page scanning progress and set scanned image parameters, and so on. 337777dab0Sopenharmony_ci * 347777dab0Sopenharmony_ci * @library libohscan.so 357777dab0Sopenharmony_ci * @kit BasicServicesKit 367777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 377777dab0Sopenharmony_ci * @since 12 387777dab0Sopenharmony_ci * @version 1.0 397777dab0Sopenharmony_ci */ 407777dab0Sopenharmony_ci 417777dab0Sopenharmony_ci#ifndef OH_SCAN_H 427777dab0Sopenharmony_ci#define OH_SCAN_H 437777dab0Sopenharmony_ci 447777dab0Sopenharmony_ci#include <stdint.h> 457777dab0Sopenharmony_ci#include <stdbool.h> 467777dab0Sopenharmony_ci 477777dab0Sopenharmony_ci#ifdef __cplusplus 487777dab0Sopenharmony_ciextern "C" { 497777dab0Sopenharmony_ci#endif 507777dab0Sopenharmony_ci 517777dab0Sopenharmony_ci/** 527777dab0Sopenharmony_ci * @brief Defines error codes. 537777dab0Sopenharmony_ci * 547777dab0Sopenharmony_ci * @since 12 557777dab0Sopenharmony_ci * @version 1.0 567777dab0Sopenharmony_ci */ 577777dab0Sopenharmony_citypedef enum { 587777dab0Sopenharmony_ci /** @error The operation is successful. */ 597777dab0Sopenharmony_ci SCAN_ERROR_NONE = 0, 607777dab0Sopenharmony_ci /** @error Permission verification failed. */ 617777dab0Sopenharmony_ci SCAN_ERROR_NO_PERMISSION = 201, 627777dab0Sopenharmony_ci /** @error The parameter is invalid. For example, the pointer is null or the character string is null. */ 637777dab0Sopenharmony_ci SCAN_ERROR_INVALID_PARAMETER = 401, 647777dab0Sopenharmony_ci /** @error General internal error. */ 657777dab0Sopenharmony_ci SCAN_ERROR_GENERIC_FAILURE = 24300101, 667777dab0Sopenharmony_ci /** @error RPC communication error. */ 677777dab0Sopenharmony_ci SCAN_ERROR_RPC_FAILURE = 24300102, 687777dab0Sopenharmony_ci /** @error Server error. */ 697777dab0Sopenharmony_ci SCAN_ERROR_SERVER_FAILURE = 24300103, 707777dab0Sopenharmony_ci /** @error Operation is not supported. **/ 717777dab0Sopenharmony_ci SCAN_ERROR_UNSUPPORTED = 24300104, 727777dab0Sopenharmony_ci /** @error Operation was cancelled. **/ 737777dab0Sopenharmony_ci SCAN_ERROR_CANCELED = 24300105, 747777dab0Sopenharmony_ci /** @error Device is busy, try again later. **/ 757777dab0Sopenharmony_ci SCAN_ERROR_DEVICE_BUSY = 24300106, 767777dab0Sopenharmony_ci /** @error Data is invalid (includes no dev at open). **/ 777777dab0Sopenharmony_ci SCAN_ERROR_INVALID = 24300107, 787777dab0Sopenharmony_ci /** @error Document feeder jammed. **/ 797777dab0Sopenharmony_ci SCAN_ERROR_JAMMED = 24300108, 807777dab0Sopenharmony_ci /** @error Document feeder out of documents. **/ 817777dab0Sopenharmony_ci SCAN_ERROR_NO_DOCS = 24300109, 827777dab0Sopenharmony_ci /** @error Scanner cover is open. **/ 837777dab0Sopenharmony_ci SCAN_ERROR_COVER_OPEN = 24300110, 847777dab0Sopenharmony_ci /** @error Error during device I/O. **/ 857777dab0Sopenharmony_ci SCAN_ERROR_IO_ERROR = 24300111, 867777dab0Sopenharmony_ci /** @error Out of memory. **/ 877777dab0Sopenharmony_ci SCAN_ERROR_NO_MEMORY = 24300112, 887777dab0Sopenharmony_ci} Scan_ErrorCode; 897777dab0Sopenharmony_ci 907777dab0Sopenharmony_ci/** 917777dab0Sopenharmony_ci * @brief Indicates scanner device information. 927777dab0Sopenharmony_ci * 937777dab0Sopenharmony_ci * @since 12 947777dab0Sopenharmony_ci */ 957777dab0Sopenharmony_citypedef struct { 967777dab0Sopenharmony_ci /** Scanner id. */ 977777dab0Sopenharmony_ci const char* scannerId; 987777dab0Sopenharmony_ci /** Scanner manufacturer. */ 997777dab0Sopenharmony_ci const char* manufacturer; 1007777dab0Sopenharmony_ci /** Scanner model. */ 1017777dab0Sopenharmony_ci const char* model; 1027777dab0Sopenharmony_ci /** Scanner discoverMode. */ 1037777dab0Sopenharmony_ci const char* discoverMode; 1047777dab0Sopenharmony_ci /** Scanner serialNumber. */ 1057777dab0Sopenharmony_ci const char* serialNumber; 1067777dab0Sopenharmony_ci} Scan_ScannerDevice; 1077777dab0Sopenharmony_ci 1087777dab0Sopenharmony_ci/** 1097777dab0Sopenharmony_ci * @brief Indicates the progress of scanning a picture by the scanner. 1107777dab0Sopenharmony_ci * 1117777dab0Sopenharmony_ci * @since 12 1127777dab0Sopenharmony_ci */ 1137777dab0Sopenharmony_citypedef struct { 1147777dab0Sopenharmony_ci /** Picture progress from 0 to 100. */ 1157777dab0Sopenharmony_ci int32_t progress; 1167777dab0Sopenharmony_ci /** scanner file handle. */ 1177777dab0Sopenharmony_ci int32_t fd; 1187777dab0Sopenharmony_ci /** Indicates whether the image is the last scanned image. */ 1197777dab0Sopenharmony_ci bool isFinal; 1207777dab0Sopenharmony_ci} Scan_PictureScanProgress; 1217777dab0Sopenharmony_ci 1227777dab0Sopenharmony_ci/** 1237777dab0Sopenharmony_ci * @brief Indicates all parameter options for one scanner. 1247777dab0Sopenharmony_ci * 1257777dab0Sopenharmony_ci * @since 12 1267777dab0Sopenharmony_ci */ 1277777dab0Sopenharmony_citypedef struct { 1287777dab0Sopenharmony_ci /** Title of an option. */ 1297777dab0Sopenharmony_ci char** titles; 1307777dab0Sopenharmony_ci /** Description of an option. */ 1317777dab0Sopenharmony_ci char** descriptions; 1327777dab0Sopenharmony_ci /** The range that an option can be set to. */ 1337777dab0Sopenharmony_ci char** ranges; 1347777dab0Sopenharmony_ci /** Number of parameter options that can be set. */ 1357777dab0Sopenharmony_ci int32_t optionCount; 1367777dab0Sopenharmony_ci} Scan_ScannerOptions; 1377777dab0Sopenharmony_ci 1387777dab0Sopenharmony_ci/** 1397777dab0Sopenharmony_ci * @brief Scanner devices discovery callback, register by {@link OH_Scan_StartScannerDiscovery}. 1407777dab0Sopenharmony_ci * The memory to which the pointer points will be released when the callback function ends. 1417777dab0Sopenharmony_ci * 1427777dab0Sopenharmony_ci * @param devices List of all discovered scanner devices. 1437777dab0Sopenharmony_ci * @param deviceCount Number of Scanners Found. 1447777dab0Sopenharmony_ci * @since 12 1457777dab0Sopenharmony_ci */ 1467777dab0Sopenharmony_citypedef void (*Scan_ScannerDiscoveryCallback)(Scan_ScannerDevice** devices, int32_t deviceCount); 1477777dab0Sopenharmony_ci 1487777dab0Sopenharmony_ci/** 1497777dab0Sopenharmony_ci * @brief This API checks and pulls up the scan service, initializes the scan client, 1507777dab0Sopenharmony_ci * and establishes a connection to the scan service. 1517777dab0Sopenharmony_ci * 1527777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 1537777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates the scanning service is successfully started. 1547777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 1557777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 1567777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates An error occurs in the scan process. 1577777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 1587777dab0Sopenharmony_ci * @since 12 1597777dab0Sopenharmony_ci */ 1607777dab0Sopenharmony_ciint32_t OH_Scan_Init(); 1617777dab0Sopenharmony_ci 1627777dab0Sopenharmony_ci/** 1637777dab0Sopenharmony_ci * @brief This API starts discovering scanners, Register a callback to handle discovered scanner devices. 1647777dab0Sopenharmony_ci * 1657777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 1667777dab0Sopenharmony_ci * @param callback The {@link Scan_ScannerDiscoveryCallback} of scanner discovery event. 1677777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates successful start of scanner search. 1687777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 1697777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 1707777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates An error occurs in the scan process. 1717777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 1727777dab0Sopenharmony_ci * @since 12 1737777dab0Sopenharmony_ci */ 1747777dab0Sopenharmony_ciint32_t OH_Scan_StartScannerDiscovery(Scan_ScannerDiscoveryCallback callback); 1757777dab0Sopenharmony_ci 1767777dab0Sopenharmony_ci/** 1777777dab0Sopenharmony_ci * @brief This API connects to scanner devices. 1787777dab0Sopenharmony_ci * 1797777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 1807777dab0Sopenharmony_ci * @param scannerId The id used to connect to the scanner. 1817777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates that the scanner was successfully connected. 1827777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 1837777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 1847777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates An error occurs in the scan process. 1857777dab0Sopenharmony_ci * {@link SCAN_ERROR_DEVICE_BUSY} Indicates that the scanner is busy. 1867777dab0Sopenharmony_ci * {@link SCAN_ERROR_INVALID_PARAMETER} Indicates that the input parameter is invalid. 1877777dab0Sopenharmony_ci * {@link SCAN_ERROR_IO_ERROR} Indicates an error occured while communicating with the device. 1887777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_MEM} Indicates an insufficent amount of memory is available. 1897777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 1907777dab0Sopenharmony_ci * @since 12 1917777dab0Sopenharmony_ci */ 1927777dab0Sopenharmony_ciint32_t OH_Scan_OpenScanner(const char* scannerId); 1937777dab0Sopenharmony_ci 1947777dab0Sopenharmony_ci/** 1957777dab0Sopenharmony_ci * @brief This API is used to close the connected scanner device. 1967777dab0Sopenharmony_ci * 1977777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 1987777dab0Sopenharmony_ci * @param scannerId The id to disconnect the scanner. 1997777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates that the scanner connection was successfully closed. 2007777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 2017777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 2027777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates An error occurs in the scan process. 2037777dab0Sopenharmony_ci * {@link SCAN_ERROR_INVALID_PARAMETER} Indicates that the input parameter is invalid. 2047777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 2057777dab0Sopenharmony_ci * @since 12 2067777dab0Sopenharmony_ci */ 2077777dab0Sopenharmony_ciint32_t OH_Scan_CloseScanner(const char* scannerId); 2087777dab0Sopenharmony_ci 2097777dab0Sopenharmony_ci/** 2107777dab0Sopenharmony_ci * @brief This API can be used to get a list of options that can be set by the scanner. 2117777dab0Sopenharmony_ci * The returned struct pointer points to memory that is automatically freed when {@link OH_Scan_Exit}, 2127777dab0Sopenharmony_ci * and only one copy will be stored in memory for each model. 2137777dab0Sopenharmony_ci * 2147777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 2157777dab0Sopenharmony_ci * @param scannerId The id used to obtain the scanner parameters. 2167777dab0Sopenharmony_ci * @param errorCode The errorCode returns {@link Scan_ErrorCode#Scan_ERROR_NONE} if the execution is successful, 2177777dab0Sopenharmony_ci * otherwise returns a specific error code, refer to {@link Print_ErrorCode}. 2187777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates that the scanner parameter options are successfully obtained. 2197777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 2207777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 2217777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates An error occurs in the scan process. 2227777dab0Sopenharmony_ci * {@link SCAN_ERROR_INVALID_PARAMETER} Indicates invalid parameter. 2237777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 2247777dab0Sopenharmony_ci * @since 12 2257777dab0Sopenharmony_ci */ 2267777dab0Sopenharmony_ciScan_ScannerOptions* OH_Scan_GetScannerParameter(const char* scannerId, int32_t* errorCode); 2277777dab0Sopenharmony_ci 2287777dab0Sopenharmony_ci/** 2297777dab0Sopenharmony_ci * @brief This API can be used to set one of the scanner's option parameters. 2307777dab0Sopenharmony_ci * The option and value passed in are obtained from {@link OH_Scan_GetScannerParameter}. 2317777dab0Sopenharmony_ci * 2327777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 2337777dab0Sopenharmony_ci * @param scannerId This id is used to set the options for a specific scanner. 2347777dab0Sopenharmony_ci * @param option Options number to be set.The value ranges from 0 to {@link optionCount} - 1, 2357777dab0Sopenharmony_ci * be obtained from the {@link Scan_ScannerOptions}. 2367777dab0Sopenharmony_ci * @param value Option value to be set, valid value is obtained from the {@link ranges}, 2377777dab0Sopenharmony_ci * be obtained from the {@link Scan_ScannerOptions}. 2387777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates that the scanner parameters were successfully set. 2397777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 2407777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 2417777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates an error occurs in the scan process. 2427777dab0Sopenharmony_ci * {@link SCAN_ERROR_INVALID_PARAMETER} Indicates invalid parameter. 2437777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 2447777dab0Sopenharmony_ci * @since 12 2457777dab0Sopenharmony_ci */ 2467777dab0Sopenharmony_ciint32_t OH_Scan_SetScannerParameter(const char* scannerId, const int32_t option, const char* value); 2477777dab0Sopenharmony_ci 2487777dab0Sopenharmony_ci/** 2497777dab0Sopenharmony_ci * @brief This API allows the scanner to start scanning. 2507777dab0Sopenharmony_ci * 2517777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 2527777dab0Sopenharmony_ci * @param scannerId This id is used to start the scan job for the specified scanner. 2537777dab0Sopenharmony_ci * @param batchMode Whether to start the scanner in batch mode. 2547777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates that the scanner has successfully canceled the scan job. 2557777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 2567777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 2577777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates An error occurs in the scan process. 2587777dab0Sopenharmony_ci * {@link SCAN_ERROR_JAMMED} Indicates the document feeder is jammed. 2597777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_DOCS} Indicates the document feeder is out of documents. 2607777dab0Sopenharmony_ci * {@link SCAN_ERROR_COVER_OPEN} Indicates the scanner cover is open. 2617777dab0Sopenharmony_ci * {@link SCAN_ERROR_IO_ERROR} Indicates an error occurred while communicating with the device. 2627777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_MEM} Indicates an insufficent amount of memory is available. 2637777dab0Sopenharmony_ci * {@link SCAN_ERROR_INVALID_PARAMETER} Indicates that the input parameter is invalid. 2647777dab0Sopenharmony_ci * {@link SCAN_ERROR_DEVICE_BUSY} Indicates the device is busy, the operation should be retried later. 2657777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 2667777dab0Sopenharmony_ci * @since 12 2677777dab0Sopenharmony_ci */ 2687777dab0Sopenharmony_ciint32_t OH_Scan_StartScan(const char* scannerId, bool batchMode); 2697777dab0Sopenharmony_ci 2707777dab0Sopenharmony_ci/** 2717777dab0Sopenharmony_ci * @brief This API allows the scanner to cancel the scan. 2727777dab0Sopenharmony_ci * 2737777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 2747777dab0Sopenharmony_ci * @param scannerId This id is used to cancel the scan job for the specified scanner. 2757777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates that the scanner has successfully canceled the scan job. 2767777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 2777777dab0Sopenharmony_ci * {@link SCAN_ERROR_INVALID_PARAMETER} Indicates if the pointer is null or the character string is null. 2787777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 2797777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates An error occurs in the scan process. 2807777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 2817777dab0Sopenharmony_ci * @since 12 2827777dab0Sopenharmony_ci */ 2837777dab0Sopenharmony_ciint32_t OH_Scan_CancelScan(const char* scannerId); 2847777dab0Sopenharmony_ci 2857777dab0Sopenharmony_ci/** 2867777dab0Sopenharmony_ci * @brief This API can get the progress of the scanner scanning the picture.A non-null value must be passed in, 2877777dab0Sopenharmony_ci * and the scan progress will be written to the structure to which the pointer points. 2887777dab0Sopenharmony_ci * 2897777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 2907777dab0Sopenharmony_ci * @param scannerId The id for querying the image scanning progress of the scanner. 2917777dab0Sopenharmony_ci * @param prog The {@link Scan_PictureScanProgress} of scanning pictures, must be a non-null value. 2927777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates the scanner has successfully queried the progress of the scanned image. 2937777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 2947777dab0Sopenharmony_ci * {@link SCAN_ERROR_INVALID_PARAMETER} Indicates if the pointer is null or the character string is null. 2957777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 2967777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates An error occurs in the scan process. 2977777dab0Sopenharmony_ci * {@link SCAN_ERROR_JAMMED} Indicates the document feeder is jammed. 2987777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_DOCS} Indicates the document feeder is out of documents. 2997777dab0Sopenharmony_ci * {@link SCAN_ERROR_COVER_OPEN} Indicates the scanner cover is open. 3007777dab0Sopenharmony_ci * {@link SCAN_ERROR_IO_ERROR} Indicates an error occurred while communicating with the scanner. 3017777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_MEM} Indicates an insufficent amount of memory is available. 3027777dab0Sopenharmony_ci * {@link SCAN_ERROR_DEVICE_BUSY} Indicates the device is busy, the operation should be retried later. 3037777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 3047777dab0Sopenharmony_ci * @since 12 3057777dab0Sopenharmony_ci */ 3067777dab0Sopenharmony_ciint32_t OH_Scan_GetPictureScanProgress(const char* scannerId, Scan_PictureScanProgress* prog); 3077777dab0Sopenharmony_ci 3087777dab0Sopenharmony_ci/** 3097777dab0Sopenharmony_ci * @brief This API can be used to exit the scanning service, free the Scan Framework Memory, 3107777dab0Sopenharmony_ci * and unregister the callback for scanner discover. 3117777dab0Sopenharmony_ci * 3127777dab0Sopenharmony_ci * @permission {@code ohos.permission.PRINT} 3137777dab0Sopenharmony_ci * @return {@link Scan_ERROR_NONE} Indicates the scan service exit successfully. 3147777dab0Sopenharmony_ci * {@link SCAN_ERROR_NO_PERMISSION} Indicates have no permission to use this interface. 3157777dab0Sopenharmony_ci * {@link SCAN_ERROR_RPC_FAILURE} Indicates an RPC communication error. 3167777dab0Sopenharmony_ci * {@link SCAN_ERROR_SERVER_FAILURE} Indicates An error occurs in the scan process. 3177777dab0Sopenharmony_ci * @syscap SystemCapability.Print.PrintFramework 3187777dab0Sopenharmony_ci * @since 12 3197777dab0Sopenharmony_ci */ 3207777dab0Sopenharmony_ciint32_t OH_Scan_Exit(); 3217777dab0Sopenharmony_ci 3227777dab0Sopenharmony_ci#ifdef __cplusplus 3237777dab0Sopenharmony_ci} 3247777dab0Sopenharmony_ci#endif 3257777dab0Sopenharmony_ci 3267777dab0Sopenharmony_ci#endif // OH_SCAN_H 3277777dab0Sopenharmony_ci/** @} */ 328