blob: 5eb8cc2f37a401e746c7d7772005d1f9e84967ab [file] [log] [blame]
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.print;
18
Philip P. Moltmann66c96592016-02-24 11:32:43 -080019import android.content.ComponentName;
Philip P. Moltmannbb9f6862015-12-01 14:44:24 -080020import android.graphics.drawable.Icon;
Svetoslav7bfbbcb2013-10-10 13:36:23 -070021import android.os.Bundle;
Svetoslav Ganov44720af2013-08-20 16:32:53 -070022import android.print.IPrinterDiscoveryObserver;
Svetoslav Ganova0027152013-06-25 14:59:53 -070023import android.print.IPrintDocumentAdapter;
Svetoslav2fbd2a72013-09-16 17:53:51 -070024import android.print.PrintJobId;
Svetoslav Ganov704697b2013-09-21 20:30:24 -070025import android.print.IPrintJobStateChangeListener;
Philip P. Moltmann66c96592016-02-24 11:32:43 -080026import android.print.IPrintServicesChangeListener;
Svetoslav Ganov44720af2013-08-20 16:32:53 -070027import android.print.PrinterId;
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -070028import android.print.PrintJobInfo;
29import android.print.PrintAttributes;
Svetoslav Ganov860f8a62013-09-14 00:59:03 -070030import android.printservice.PrintServiceInfo;
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -070031
32/**
33 * Interface for communication with the core print manager service.
34 *
35 * @hide
36 */
37interface IPrintManager {
Svetoslav Ganova0027152013-06-25 14:59:53 -070038 List<PrintJobInfo> getPrintJobInfos(int appId, int userId);
Svetoslav2fbd2a72013-09-16 17:53:51 -070039 PrintJobInfo getPrintJobInfo(in PrintJobId printJobId, int appId, int userId);
Svetoslav7bfbbcb2013-10-10 13:36:23 -070040 Bundle print(String printJobName, in IPrintDocumentAdapter printAdapter,
41 in PrintAttributes attributes, String packageName, int appId, int userId);
Svetoslav2fbd2a72013-09-16 17:53:51 -070042 void cancelPrintJob(in PrintJobId printJobId, int appId, int userId);
43 void restartPrintJob(in PrintJobId printJobId, int appId, int userId);
Svetoslav Ganov44720af2013-08-20 16:32:53 -070044
Svetoslav Ganov704697b2013-09-21 20:30:24 -070045 void addPrintJobStateChangeListener(in IPrintJobStateChangeListener listener,
46 int appId, int userId);
47 void removePrintJobStateChangeListener(in IPrintJobStateChangeListener listener,
48 int userId);
49
Philip P. Moltmann66c96592016-02-24 11:32:43 -080050 /**
51 * Listen for changes to the installed and enabled print services.
52 *
53 * @param listener the listener to add
54 * @param userId the id of the user listening
55 *
56 * @see android.print.PrintManager#getPrintServices(int, String)
57 */
58 void addPrintServicesChangeListener(in IPrintServicesChangeListener listener,
59 int userId);
60
61 /**
62 * Stop listening for changes to the installed and enabled print services.
63 *
64 * @param listener the listener to remove
65 * @param userId the id of the user requesting the removal
66 *
67 * @see android.print.PrintManager#getPrintServices(int, String)
68 */
69 void removePrintServicesChangeListener(in IPrintServicesChangeListener listener,
70 int userId);
71
72 /**
73 * Get the print services.
74 *
75 * @param selectionFlags flags selecting which services to get
76 * @param selectedService if not null, the id of the print service to get
77 * @param userId the id of the user requesting the services
78 *
79 * @return the list of selected print services.
80 */
81 List<PrintServiceInfo> getPrintServices(int selectionFlags, int userId);
82
83 /**
84 * Enable or disable a print service.
85 *
86 * @param service The service to enabled or disable
87 * @param isEnabled whether the service should be enabled or disabled
88 * @param userId the id of the user requesting the services
89 */
90 void setPrintServiceEnabled(in ComponentName service, boolean isEnabled, int userId);
Svetoslav Ganov860f8a62013-09-14 00:59:03 -070091
Svetoslav Ganov44720af2013-08-20 16:32:53 -070092 void createPrinterDiscoverySession(in IPrinterDiscoveryObserver observer, int userId);
93 void startPrinterDiscovery(in IPrinterDiscoveryObserver observer,
94 in List<PrinterId> priorityList, int userId);
95 void stopPrinterDiscovery(in IPrinterDiscoveryObserver observer, int userId);
Svetoslav Ganovd26d4892013-08-28 14:37:54 -070096 void validatePrinters(in List<PrinterId> printerIds, int userId);
97 void startPrinterStateTracking(in PrinterId printerId, int userId);
Philip P. Moltmannbb9f6862015-12-01 14:44:24 -080098
99 /**
100 * Get the custom icon for a printer. If the icon is not cached, the icon is
101 * requested asynchronously. Once it is available the printer is updated.
102 *
103 * @param printerId the id of the printer the icon should be loaded for
104 * @param userId the id of the user requesting the printer
105 * @return the custom icon to be used for the printer or null if the icon is
106 * not yet available
107 * @see android.print.PrinterInfo.Builder#setHasCustomPrinterIcon()
108 */
109 Icon getCustomPrinterIcon(in PrinterId printerId, int userId);
110
Svetoslav Ganovd26d4892013-08-28 14:37:54 -0700111 void stopPrinterStateTracking(in PrinterId printerId, int userId);
Svetoslav Ganov44720af2013-08-20 16:32:53 -0700112 void destroyPrinterDiscoverySession(in IPrinterDiscoveryObserver observer,
113 int userId);
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -0700114}