IPrintManager.aidl revision bb9f686b40743df2642b7d3b7778dbf7284ae665
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
17package android.print;
18
19import android.graphics.drawable.Icon;
20import android.os.Bundle;
21import android.print.IPrinterDiscoveryObserver;
22import android.print.IPrintDocumentAdapter;
23import android.print.PrintJobId;
24import android.print.IPrintJobStateChangeListener;
25import android.print.PrinterId;
26import android.print.PrintJobInfo;
27import android.print.PrintAttributes;
28import android.printservice.PrintServiceInfo;
29
30/**
31 * Interface for communication with the core print manager service.
32 *
33 * @hide
34 */
35interface IPrintManager {
36    List<PrintJobInfo> getPrintJobInfos(int appId, int userId);
37    PrintJobInfo getPrintJobInfo(in PrintJobId printJobId, int appId, int userId);
38    Bundle print(String printJobName, in IPrintDocumentAdapter printAdapter,
39            in PrintAttributes attributes, String packageName, int appId, int userId);
40    void cancelPrintJob(in PrintJobId printJobId, int appId, int userId);
41    void restartPrintJob(in PrintJobId printJobId, int appId, int userId);
42
43    void addPrintJobStateChangeListener(in IPrintJobStateChangeListener listener,
44            int appId, int userId);
45    void removePrintJobStateChangeListener(in IPrintJobStateChangeListener listener,
46            int userId);
47
48    List<PrintServiceInfo> getInstalledPrintServices(int userId);
49    List<PrintServiceInfo> getEnabledPrintServices(int userId);
50
51    void createPrinterDiscoverySession(in IPrinterDiscoveryObserver observer, int userId);
52    void startPrinterDiscovery(in IPrinterDiscoveryObserver observer,
53            in List<PrinterId> priorityList, int userId);
54    void stopPrinterDiscovery(in IPrinterDiscoveryObserver observer, int userId);
55    void validatePrinters(in List<PrinterId> printerIds, int userId);
56    void startPrinterStateTracking(in PrinterId printerId, int userId);
57
58    /**
59     * Get the custom icon for a printer. If the icon is not cached, the icon is
60     * requested asynchronously. Once it is available the printer is updated.
61     *
62     * @param printerId the id of the printer the icon should be loaded for
63     * @param userId the id of the user requesting the printer
64     * @return the custom icon to be used for the printer or null if the icon is
65     *         not yet available
66     * @see android.print.PrinterInfo.Builder#setHasCustomPrinterIcon()
67     */
68    Icon getCustomPrinterIcon(in PrinterId printerId, int userId);
69
70    void stopPrinterStateTracking(in PrinterId printerId, int userId);
71    void destroyPrinterDiscoverySession(in IPrinterDiscoveryObserver observer,
72            int userId);
73}
74