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 IPRINT_CALLBACK_H
17 #define IPRINT_CALLBACK_H
18 
19 #include "iremote_broker.h"
20 #include "iremote_object.h"
21 #include "print_job.h"
22 #include "printer_info.h"
23 
24 namespace OHOS::Print {
25 class IPrintCallback : public IRemoteBroker {
26 public:
27     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Print.IPrintCallback");
28     virtual bool OnCallback() = 0;
29     virtual bool OnCallback(uint32_t state, const PrinterInfo &info) = 0;
30     virtual bool OnCallback(uint32_t state, const PrintJob &info) = 0;
31     virtual bool OnCallback(const std::string &extensionId, const std::string &info) = 0;
32     virtual bool OnCallbackAdapterLayout(const std::string &jobId, const PrintAttributes &oldAttrs,
33         const PrintAttributes &newAttrs, uint32_t fd) = 0;
34     virtual bool onCallbackAdapterJobStateChanged(const std::string jobId, const uint32_t state,
35         const uint32_t subState) = 0;
36     virtual bool OnCallbackAdapterGetFile(uint32_t state) = 0;
37 };
38 
39 enum {
40     PRINT_CALLBACK_TASK,
41     PRINT_CALLBACK_PRINTER,
42     PRINT_CALLBACK_PRINT_JOB,
43     PRINT_CALLBACK_EXTINFO,
44     PRINT_CALLBACK_PRINT_JOB_ADAPTER,
45     PRINT_CALLBACK_PRINT_JOB_ADAPTER_TEST,
46     PRINT_CALLBACK_PRINT_JOB_CHANGED_ADAPTER,
47     PRINT_CALLBACK_PRINT_GET_FILE_ADAPTER,
48 };
49 } // namespace OHOS::Print
50 #endif // IPRINT_CALLBACK_H