Svetoslav Ganov | 4b9a4d1 | 2013-06-11 15:20:06 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.print; |
| 18 | |
Philip P. Moltmann | 66c9659 | 2016-02-24 11:32:43 -0800 | [diff] [blame] | 19 | import android.content.ComponentName; |
Philip P. Moltmann | bb9f686 | 2015-12-01 14:44:24 -0800 | [diff] [blame] | 20 | import android.graphics.drawable.Icon; |
Svetoslav | 7bfbbcb | 2013-10-10 13:36:23 -0700 | [diff] [blame] | 21 | import android.os.Bundle; |
Svetoslav Ganov | 44720af | 2013-08-20 16:32:53 -0700 | [diff] [blame] | 22 | import android.print.IPrinterDiscoveryObserver; |
Svetoslav Ganov | a002715 | 2013-06-25 14:59:53 -0700 | [diff] [blame] | 23 | import android.print.IPrintDocumentAdapter; |
Svetoslav | 2fbd2a7 | 2013-09-16 17:53:51 -0700 | [diff] [blame] | 24 | import android.print.PrintJobId; |
Svetoslav Ganov | 704697b | 2013-09-21 20:30:24 -0700 | [diff] [blame] | 25 | import android.print.IPrintJobStateChangeListener; |
Philip P. Moltmann | 66c9659 | 2016-02-24 11:32:43 -0800 | [diff] [blame] | 26 | import android.print.IPrintServicesChangeListener; |
Philip P. Moltmann | 9dcb86a | 2016-03-14 14:31:12 -0700 | [diff] [blame] | 27 | import android.printservice.recommendation.IRecommendationsChangeListener; |
Svetoslav Ganov | 44720af | 2013-08-20 16:32:53 -0700 | [diff] [blame] | 28 | import android.print.PrinterId; |
Svetoslav Ganov | 4b9a4d1 | 2013-06-11 15:20:06 -0700 | [diff] [blame] | 29 | import android.print.PrintJobInfo; |
| 30 | import android.print.PrintAttributes; |
Philip P. Moltmann | 9dcb86a | 2016-03-14 14:31:12 -0700 | [diff] [blame] | 31 | import android.printservice.recommendation.RecommendationInfo; |
Svetoslav Ganov | 860f8a6 | 2013-09-14 00:59:03 -0700 | [diff] [blame] | 32 | import android.printservice.PrintServiceInfo; |
Svetoslav Ganov | 4b9a4d1 | 2013-06-11 15:20:06 -0700 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Interface for communication with the core print manager service. |
| 36 | * |
| 37 | * @hide |
| 38 | */ |
| 39 | interface IPrintManager { |
Svetoslav Ganov | a002715 | 2013-06-25 14:59:53 -0700 | [diff] [blame] | 40 | List<PrintJobInfo> getPrintJobInfos(int appId, int userId); |
Svetoslav | 2fbd2a7 | 2013-09-16 17:53:51 -0700 | [diff] [blame] | 41 | PrintJobInfo getPrintJobInfo(in PrintJobId printJobId, int appId, int userId); |
Svetoslav | 7bfbbcb | 2013-10-10 13:36:23 -0700 | [diff] [blame] | 42 | Bundle print(String printJobName, in IPrintDocumentAdapter printAdapter, |
| 43 | in PrintAttributes attributes, String packageName, int appId, int userId); |
Svetoslav | 2fbd2a7 | 2013-09-16 17:53:51 -0700 | [diff] [blame] | 44 | void cancelPrintJob(in PrintJobId printJobId, int appId, int userId); |
| 45 | void restartPrintJob(in PrintJobId printJobId, int appId, int userId); |
Svetoslav Ganov | 44720af | 2013-08-20 16:32:53 -0700 | [diff] [blame] | 46 | |
Svetoslav Ganov | 704697b | 2013-09-21 20:30:24 -0700 | [diff] [blame] | 47 | void addPrintJobStateChangeListener(in IPrintJobStateChangeListener listener, |
| 48 | int appId, int userId); |
| 49 | void removePrintJobStateChangeListener(in IPrintJobStateChangeListener listener, |
| 50 | int userId); |
| 51 | |
Philip P. Moltmann | 66c9659 | 2016-02-24 11:32:43 -0800 | [diff] [blame] | 52 | /** |
| 53 | * Listen for changes to the installed and enabled print services. |
| 54 | * |
| 55 | * @param listener the listener to add |
| 56 | * @param userId the id of the user listening |
| 57 | * |
| 58 | * @see android.print.PrintManager#getPrintServices(int, String) |
| 59 | */ |
| 60 | void addPrintServicesChangeListener(in IPrintServicesChangeListener listener, |
| 61 | int userId); |
| 62 | |
| 63 | /** |
| 64 | * Stop listening for changes to the installed and enabled print services. |
| 65 | * |
| 66 | * @param listener the listener to remove |
| 67 | * @param userId the id of the user requesting the removal |
| 68 | * |
| 69 | * @see android.print.PrintManager#getPrintServices(int, String) |
| 70 | */ |
| 71 | void removePrintServicesChangeListener(in IPrintServicesChangeListener listener, |
| 72 | int userId); |
| 73 | |
| 74 | /** |
| 75 | * Get the print services. |
| 76 | * |
| 77 | * @param selectionFlags flags selecting which services to get |
Philip P. Moltmann | 66c9659 | 2016-02-24 11:32:43 -0800 | [diff] [blame] | 78 | * @param userId the id of the user requesting the services |
| 79 | * |
| 80 | * @return the list of selected print services. |
| 81 | */ |
| 82 | List<PrintServiceInfo> getPrintServices(int selectionFlags, int userId); |
| 83 | |
| 84 | /** |
| 85 | * Enable or disable a print service. |
| 86 | * |
| 87 | * @param service The service to enabled or disable |
| 88 | * @param isEnabled whether the service should be enabled or disabled |
| 89 | * @param userId the id of the user requesting the services |
| 90 | */ |
| 91 | void setPrintServiceEnabled(in ComponentName service, boolean isEnabled, int userId); |
Svetoslav Ganov | 860f8a6 | 2013-09-14 00:59:03 -0700 | [diff] [blame] | 92 | |
Philip P. Moltmann | 9dcb86a | 2016-03-14 14:31:12 -0700 | [diff] [blame] | 93 | /** |
| 94 | * Listen for changes to the print service recommendations. |
| 95 | * |
| 96 | * @param listener the listener to add |
| 97 | * @param userId the id of the user listening |
| 98 | * |
| 99 | * @see android.print.PrintManager#getPrintServiceRecommendations |
| 100 | */ |
| 101 | void addPrintServiceRecommendationsChangeListener(in IRecommendationsChangeListener listener, |
| 102 | int userId); |
| 103 | |
| 104 | /** |
| 105 | * Stop listening for changes to the print service recommendations. |
| 106 | * |
| 107 | * @param listener the listener to remove |
| 108 | * @param userId the id of the user requesting the removal |
| 109 | * |
| 110 | * @see android.print.PrintManager#getPrintServiceRecommendations |
| 111 | */ |
| 112 | void removePrintServiceRecommendationsChangeListener(in IRecommendationsChangeListener listener, |
| 113 | int userId); |
| 114 | |
| 115 | /** |
| 116 | * Get the print service recommendations. |
| 117 | * |
| 118 | * @param userId the id of the user requesting the recommendations |
| 119 | * |
| 120 | * @return the list of selected print services. |
| 121 | */ |
| 122 | List<RecommendationInfo> getPrintServiceRecommendations(int userId); |
| 123 | |
Svetoslav Ganov | 44720af | 2013-08-20 16:32:53 -0700 | [diff] [blame] | 124 | void createPrinterDiscoverySession(in IPrinterDiscoveryObserver observer, int userId); |
| 125 | void startPrinterDiscovery(in IPrinterDiscoveryObserver observer, |
| 126 | in List<PrinterId> priorityList, int userId); |
| 127 | void stopPrinterDiscovery(in IPrinterDiscoveryObserver observer, int userId); |
Svetoslav Ganov | d26d489 | 2013-08-28 14:37:54 -0700 | [diff] [blame] | 128 | void validatePrinters(in List<PrinterId> printerIds, int userId); |
| 129 | void startPrinterStateTracking(in PrinterId printerId, int userId); |
Philip P. Moltmann | bb9f686 | 2015-12-01 14:44:24 -0800 | [diff] [blame] | 130 | |
| 131 | /** |
| 132 | * Get the custom icon for a printer. If the icon is not cached, the icon is |
| 133 | * requested asynchronously. Once it is available the printer is updated. |
| 134 | * |
| 135 | * @param printerId the id of the printer the icon should be loaded for |
| 136 | * @param userId the id of the user requesting the printer |
| 137 | * @return the custom icon to be used for the printer or null if the icon is |
| 138 | * not yet available |
| 139 | * @see android.print.PrinterInfo.Builder#setHasCustomPrinterIcon() |
| 140 | */ |
| 141 | Icon getCustomPrinterIcon(in PrinterId printerId, int userId); |
| 142 | |
Svetoslav Ganov | d26d489 | 2013-08-28 14:37:54 -0700 | [diff] [blame] | 143 | void stopPrinterStateTracking(in PrinterId printerId, int userId); |
Svetoslav Ganov | 44720af | 2013-08-20 16:32:53 -0700 | [diff] [blame] | 144 | void destroyPrinterDiscoverySession(in IPrinterDiscoveryObserver observer, |
| 145 | int userId); |
Svetoslav Ganov | 4b9a4d1 | 2013-06-11 15:20:06 -0700 | [diff] [blame] | 146 | } |