• 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 PRINT_SERVICE_INTERFACE_H
17 #define PRINT_SERVICE_INTERFACE_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include "iprint_callback.h"
23 #include "iprint_extension_callback.h"
24 #include "iremote_broker.h"
25 #include "print_extension_info.h"
26 #include "print_job.h"
27 #include "printer_info.h"
28 #include "iprint_ipc_interface_code.h"
29 
30 namespace OHOS::Print {
31 class IPrintService : public IRemoteBroker {
32 public:
33     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Print.IPrintService");
34     virtual int32_t StartPrint(const std::vector<std::string> &fileList,
35         const std::vector<uint32_t> &fdList, std::string &taskId) = 0;
36     virtual int32_t StartPrint(const std::vector<std::string> &fileList, const std::vector<uint32_t> &fdList,
37         std::string &taskId, const sptr<IRemoteObject> &token) = 0;
38     virtual int32_t StopPrint(const std::string &taskId) = 0;
39     virtual int32_t ConnectPrinter(const std::string &printerId) = 0;
40     virtual int32_t DisconnectPrinter(const std::string &printerId) = 0;
41     virtual int32_t StartDiscoverPrinter(const std::vector<std::string> &extensionList) = 0;
42     virtual int32_t StopDiscoverPrinter() = 0;
43     virtual int32_t QueryAllExtension(std::vector<PrintExtensionInfo> &extensionInfos) = 0;
44     virtual int32_t StartPrintJob(const PrintJob &jobInfo) = 0;
45     virtual int32_t CancelPrintJob(const std::string &jobId) = 0;
46     virtual int32_t AddPrinters(const std::vector<PrinterInfo> &printerInfos) = 0;
47     virtual int32_t RemovePrinters(const std::vector<std::string> &printerIds) = 0;
48     virtual int32_t UpdatePrinters(const std::vector<PrinterInfo> &printerInfos) = 0;
49     virtual int32_t UpdatePrinterState(const std::string &printerId, uint32_t state) = 0;
50     virtual int32_t UpdatePrintJobState(const std::string &jobId, uint32_t state, uint32_t subState) = 0;
51     virtual int32_t UpdateExtensionInfo(const std::string &extensionId) = 0;
52     virtual int32_t RequestPreview(const PrintJob &jobinfo, std::string &previewResult) = 0;
53     virtual int32_t QueryPrinterCapability(const std::string &printerId) = 0;
54     virtual int32_t On(const std::string taskId, const std::string &type, const sptr<IPrintCallback> &listener) = 0;
55     virtual int32_t Off(const std::string taskId, const std::string &type) = 0;
56     virtual int32_t RegisterExtCallback(const std::string &extensionCID,
57         const sptr<IPrintExtensionCallback> &listener) = 0;
58     virtual int32_t UnregisterAllExtCallback(const std::string &extensionId) = 0;
59     virtual int32_t LoadExtSuccess(const std::string &extensionId) = 0;
60     virtual int32_t QueryAllPrintJob(std::vector<PrintJob> &printJobs) = 0;
61     virtual int32_t QueryPrintJobById(std::string &printJobId, PrintJob &printjob) = 0;
62     virtual int32_t AddPrinterToCups(const std::string &printerUri, const std::string &printerName,
63         const std::string &printerMake) = 0;
64     virtual int32_t QueryPrinterCapabilityByUri(const std::string &printerUri, const std::string &printerId,
65         PrinterCapability &printerCaps) = 0;
66     virtual int32_t PrintByAdapter(const std::string jobName, const PrintAttributes &printAttributes,
67         std::string &taskId, const sptr<IRemoteObject> &token) = 0;
68     virtual int32_t StartGetPrintFile(const std::string &jobId, const PrintAttributes &printAttributes,
69         const uint32_t fd) = 0;
70     virtual int32_t NotifyPrintService(const std::string &jobId, const std::string &type) = 0;
71 };
72 } // namespace OHOS::Print
73 #endif // PRINT_SERVICE_INTERFACE_H