| 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.printservice; |
| 18 |
|
| 19 |
import android.graphics.drawable.Icon; |
| 20 |
import android.os.ParcelFileDescriptor; |
| 21 |
import android.print.PrintJobInfo; |
| 22 |
import android.print.PrinterId; |
| 23 |
import android.print.PrinterInfo; |
| 24 |
import android.print.PrintJobId; |
| 25 |
import android.content.pm.ParceledListSlice; |
| 26 |
|
| 27 |
/** |
| 28 |
* The top-level interface from a print service to the system. |
| 29 |
* |
| 30 |
* @hide |
| 31 |
*/ |
| 32 |
interface IPrintServiceClient { |
| 33 |
List<PrintJobInfo> getPrintJobInfos(); |
| 34 |
PrintJobInfo getPrintJobInfo(in PrintJobId printJobId); |
| 35 |
boolean setPrintJobState(in PrintJobId printJobId, int state, String error); |
| 36 |
boolean setPrintJobTag(in PrintJobId printJobId, String tag); |
| 37 |
oneway void writePrintJobData(in ParcelFileDescriptor fd, in PrintJobId printJobId); |
| 38 |
|
| 39 |
/** |
| 40 |
* Set the progress of this print job |
| 41 |
* |
| 42 |
* @param printJobId The print job to update |
| 43 |
* @param progress The new progress |
| 44 |
*/ |
| 45 |
void setProgress(in PrintJobId printJobId, in float progress); |
| 46 |
|
| 47 |
/** |
| 48 |
* Set the status of this print job |
| 49 |
* |
| 50 |
* @param printJobId The print job to update |
| 51 |
* @param status The new status, can be null |
| 52 |
*/ |
| 53 |
void setStatus(in PrintJobId printJobId, in CharSequence status); |
| 54 |
|
| 55 |
/** |
| 56 |
* Set the status of this print job |
| 57 |
* |
| 58 |
* @param printJobId The print job to update |
| 59 |
* @param status The new status as a string resource |
| 60 |
* @param appPackageName The app package name the string belongs to |
| 61 |
*/ |
| 62 |
void setStatusRes(in PrintJobId printJobId, int status, in CharSequence appPackageName); |
| 63 |
|
| 64 |
void onPrintersAdded(in ParceledListSlice printers); |
| 65 |
void onPrintersRemoved(in ParceledListSlice printerIds); |
| 66 |
|
| 67 |
/** |
| 68 |
* Handle that a custom icon for a printer was loaded. |
| 69 |
* |
| 70 |
* @param printerId the id of the printer the icon belongs to |
| 71 |
* @param icon the icon that was loaded |
| 72 |
* @see android.print.PrinterInfo.Builder#setHasCustomPrinterIcon() |
| 73 |
*/ |
| 74 |
void onCustomPrinterIconLoaded(in PrinterId printerId, in Icon icon); |
| 75 |
} |