1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef SCAN_SERVICE_INTERFACE_H 17 #define SCAN_SERVICE_INTERFACE_H 18 19 #include <string> 20 #include <vector> 21 22 #include "iscan_callback.h" 23 #include "iremote_broker.h" 24 #include "scanner_info.h" 25 #include "scan_option_descriptor.h" 26 #include "scan_option_value.h" 27 #include "scan_parameters.h" 28 #include "scan_progress.h" 29 30 namespace OHOS::Scan { 31 class IScanService : public IRemoteBroker { 32 public: 33 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Scan.IScanService"); 34 virtual int32_t InitScan() = 0; 35 virtual int32_t ExitScan() = 0; 36 virtual int32_t GetScannerList() = 0; 37 virtual int32_t OpenScanner(const std::string scannerId) = 0; 38 virtual int32_t CloseScanner(const std::string scannerId) = 0; 39 virtual int32_t GetScanOptionDesc(const std::string scannerId, 40 const int32_t optionIndex, ScanOptionDescriptor &desc) = 0; 41 virtual int32_t OpScanOptionValue(const std::string scannerId, 42 const int32_t optionIndex, const ScanOptionOpType op, ScanOptionValue &value) =0; 43 virtual int32_t GetScanParameters(const std::string scannerId, ScanParameters ¶) = 0; 44 virtual int32_t StartScan(const std::string scannerffId, const bool &batchMode) = 0; 45 virtual int32_t CancelScan(const std::string scannerId) = 0; 46 virtual int32_t GetScanProgress(const std::string scannerId, ScanProgress &prog) = 0; 47 virtual int32_t AddScanner(const std::string& serialNumber, const std::string& discoverMode) = 0; 48 virtual int32_t DeleteScanner(const std::string& serialNumber, const std::string& discoverMode) = 0; 49 virtual int32_t GetAddedScanner(std::vector<ScanDeviceInfo>& allAddedScanner) = 0; 50 virtual int32_t On(const std::string taskId, const std::string &type, const sptr<IScanCallback> &listener) = 0; 51 virtual int32_t Off(const std::string taskId, const std::string &type) = 0; 52 }; 53 54 enum { 55 CMD_INIT_SCAN, 56 CMD_EXIT_SCAN, 57 CMD_GET_SCANNER_LIST, 58 CMD_OPEN_SCANNER, 59 CMD_CLOSE_SCANNER, 60 CMD_GET_SCAN_OPTION_DESC, 61 CMD_OP_SCAN_OPTION_VALUE, 62 CMD_GET_SCAN_PARAMETERS, 63 CMD_START_SCAN, 64 CMD_CANCEL_SCAN, 65 CMD_GET_SCAN_PROGRESS, 66 CMD_CONNECT_SCANNER, 67 CMD_DISCONNECT_SCANNER, 68 CMD_GET_CONNECTED_SCANNER, 69 CMD_ADD_PRINTER, 70 CMD_ON, 71 CMD_OFF 72 }; 73 } // namespace OHOS::Scan 74 #endif // SCAN_SERVICE_INTERFACE_H 75