• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_PROXY_H
17 #define SCAN_SERVICE_PROXY_H
18 
19 #include "iscan_service.h"
20 #include "iremote_proxy.h"
21 #include "scanner_info.h"
22 #define TDD_ENABLE 1
23 
24 namespace OHOS::Scan {
25 class ScanServiceProxy : public IRemoteProxy<IScanService> {
26 public:
27     explicit ScanServiceProxy(const sptr<IRemoteObject> &object);
28     ~ScanServiceProxy() = default;
29     DISALLOW_COPY_AND_MOVE(ScanServiceProxy);
30 
31     int32_t InitScan() override;
32     int32_t ExitScan() override;
33     int32_t GetScannerList() override;
34     int32_t OpenScanner(const std::string scannerId) override;
35     int32_t CloseScanner(const std::string scannerId) override;
36     int32_t GetScanOptionDesc(const std::string scannerId,
37         const int32_t optionIndex, ScanOptionDescriptor &desc) override;
38     int32_t OpScanOptionValue(const std::string scannerId, const int32_t optionIndex,
39     const ScanOptionOpType op, ScanOptionValue &value) override;
40     int32_t GetScanParameters(const std::string scannerId, ScanParameters &para) override;
41     int32_t StartScan(const std::string scannerId, const bool &batchMode) override;
42     int32_t CancelScan(const std::string scannerId) override;
43     int32_t GetScanProgress(const std::string scannerId, ScanProgress &prog) override;
44     int32_t AddScanner(const std::string& serialNumber, const std::string& discoverMode) override;
45     int32_t DeleteScanner(const std::string& serialNumber, const std::string& discoverMode) override;
46     int32_t GetAddedScanner(std::vector<ScanDeviceInfo>& allAddedScanner) override;
47     int32_t On(const std::string taskId, const std::string &type, const sptr<IScanCallback> &listener) override;
48     int32_t Off(const std::string taskId, const std::string &type) override;
49 
50 #ifndef TDD_ENABLE
51 private:
52 #endif
53     int32_t GetResult(int32_t retCode, MessageParcel &reply);
54     static inline BrokerDelegator<ScanServiceProxy> delegator_;
55 };
56 } // namespace OHOS::Scan
57 #endif // SCAN_SERVICE_PROXY_H
58