Package com.clover.sdk.v1.printer
Interface IPrinterService
-
- All Superinterfaces:
IInterface
- All Known Implementing Classes:
IPrinterService.Default
,IPrinterService.Stub
public interface IPrinterService extends IInterface
An interface for adding, listing, and removing Clover printers. To print to a Clover printer, use the classes in thecom.clover.sdk.v1.printer.job
package. To open a cash drawer connected to a Clover printer, use theCashDrawer
class. To interact with the Clover print queue, use thePrintQueue
class.
The Printer service is a bound AIDL service. Bind to this service as follows,Intent serviceIntent = new Intent(PrinterIntent.ACTION_PRINTER_SERVICE); serviceIntent.putExtra(PrinterIntent.EXTRA_ACCOUNT, CloverAccount.getAccount(context)); serviceIntent.putExtra(PrinterIntent.EXTRA_VERSION, 1); context.bindService(serviceIntent);
You may also interact with the printer service through thePrinterConnector
class, which handles binding and asynchronous invocation of service methods.- See Also:
PrinterIntent
,CloverAccount
,PrinterConnector
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IPrinterService.Default
Default implementation for IPrinterService.static class
IPrinterService.Stub
Local-side IPC implementation stub class.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Printer
getPrinterById(String id, ResultStatus status)
Returns the printer which matches thePrinter.getUuid()
if any, or null if none.List<Printer>
getPrinters(ResultStatus status)
Get all configured printers for this merchant.List<Printer>
getPrintersByCategory(Category category, ResultStatus status)
Get all printers configured by this merchant for the given category.TypeDetails
getPrinterTypeDetails(Printer p, ResultStatus status)
Returns the TypeDetails for the given printer.boolean
isPrinterSet(Category category, ResultStatus status)
Returns true if there is any configured printer in the given category.void
removePrinter(Printer p, ResultStatus status)
Removes a printer from being configured.Printer
setPrinter(Printer p, ResultStatus status)
Adds a printer optionally with a category.-
Methods inherited from interface android.os.IInterface
asBinder
-
-
-
-
Method Detail
-
getPrinters
List<Printer> getPrinters(ResultStatus status) throws RemoteException
Get all configured printers for this merchant. A printer must be associated to at least one category to be considered configured. The same printer may be configured for more than one category and if so will appear multiple times in the returned list.- Throws:
RemoteException
-
getPrintersByCategory
List<Printer> getPrintersByCategory(Category category, ResultStatus status) throws RemoteException
Get all printers configured by this merchant for the given category.- Throws:
RemoteException
-
isPrinterSet
boolean isPrinterSet(Category category, ResultStatus status) throws RemoteException
Returns true if there is any configured printer in the given category.- Throws:
RemoteException
-
getPrinterById
Printer getPrinterById(String id, ResultStatus status) throws RemoteException
Returns the printer which matches thePrinter.getUuid()
if any, or null if none. This may return a printer which has not been configured.- Throws:
RemoteException
-
removePrinter
void removePrinter(Printer p, ResultStatus status) throws RemoteException
Removes a printer from being configured. If a category is supplied then the printer has only the configuration for that category removed. If no category is supplied then the printer is completely removed.- Throws:
RemoteException
-
setPrinter
Printer setPrinter(Printer p, ResultStatus status) throws RemoteException
Adds a printer optionally with a category. If a new printer is added without a category it is unconfigured. A new or existing printer may configured by supplying a category.- Throws:
RemoteException
-
getPrinterTypeDetails
TypeDetails getPrinterTypeDetails(Printer p, ResultStatus status) throws RemoteException
Returns the TypeDetails for the given printer.- Throws:
RemoteException
-
-