PrinterInfo.Builder
public
static
final
class
PrinterInfo.Builder
extends Object
java.lang.Object | |
↳ | android.print.PrinterInfo.Builder |
Builder for creating of a PrinterInfo
.
Summary
Public constructors | |
---|---|
PrinterInfo.Builder(PrinterId printerId, String name, int status)
Constructor. |
|
PrinterInfo.Builder(PrinterInfo other)
Constructor. |
Public methods | |
---|---|
PrinterInfo
|
build()
Creates a new |
PrinterInfo.Builder
|
setCapabilities(PrinterCapabilitiesInfo capabilities)
Sets the printer capabilities. |
PrinterInfo.Builder
|
setDescription(String description)
Sets the localized printer description which is shown to the user |
PrinterInfo.Builder
|
setHasCustomPrinterIcon(boolean hasCustomPrinterIcon)
Declares that the print service can load a custom per printer's icon. |
PrinterInfo.Builder
|
setIconResourceId(int iconResourceId)
Set a drawable resource as icon for this printer. |
PrinterInfo.Builder
|
setInfoIntent(PendingIntent infoIntent)
Sets the |
PrinterInfo.Builder
|
setName(String name)
Sets the localized printer name which is shown to the user |
PrinterInfo.Builder
|
setStatus(int status)
Sets the printer status. |
Inherited methods | |
---|---|
Public constructors
PrinterInfo.Builder
PrinterInfo.Builder (PrinterId printerId, String name, int status)
Constructor.
Parameters | |
---|---|
printerId |
PrinterId : The printer id. Cannot be null. |
name |
String : The printer name. Cannot be empty.This value must never be |
status |
int : The printer status. Must be a valid status.Value is |
Throws | |
---|---|
IllegalArgumentException |
If the printer id is null, or the printer name is empty or the status is not a valid one. |
PrinterInfo.Builder
PrinterInfo.Builder (PrinterInfo other)
Constructor.
Parameters | |
---|---|
other |
PrinterInfo : Other info from which to start building.
This value must never be |
Public methods
build
PrinterInfo build ()
Creates a new PrinterInfo
.
Returns | |
---|---|
PrinterInfo |
A new PrinterInfo .
This value will never be |
setCapabilities
PrinterInfo.Builder setCapabilities (PrinterCapabilitiesInfo capabilities)
Sets the printer capabilities.
Parameters | |
---|---|
capabilities |
PrinterCapabilitiesInfo : The capabilities.This value must never be |
Returns | |
---|---|
PrinterInfo.Builder |
This builder.
This value will never be |
setDescription
PrinterInfo.Builder setDescription (String description)
Sets the localized printer description which is shown to the user
Parameters | |
---|---|
description |
String : The description.This value must never be |
Returns | |
---|---|
PrinterInfo.Builder |
This builder.
This value will never be |
setHasCustomPrinterIcon
PrinterInfo.Builder setHasCustomPrinterIcon (boolean hasCustomPrinterIcon)
Declares that the print service can load a custom per printer's icon. If both
setIconResourceId(int)
and a custom icon are set the resource icon
is shown while the custom icon loads but then the custom icon is used. If
setIconResourceId(int)
is not set the printer's service's icon is
shown while loading.
The icon is requested asynchronously and only when needed via
onRequestCustomPrinterIcon(PrinterId, CancellationSignal, CustomPrinterIconCallback)
.
Parameters | |
---|---|
hasCustomPrinterIcon |
boolean : If the printer has a custom icon or not. |
Returns | |
---|---|
PrinterInfo.Builder |
This builder.
This value will never be |
setIconResourceId
PrinterInfo.Builder setIconResourceId (int iconResourceId)
Set a drawable resource as icon for this printer. If no icon is set the printer's service's icon is used for the printer.
Parameters | |
---|---|
iconResourceId |
int : The resource ID of the icon. |
Returns | |
---|---|
PrinterInfo.Builder |
This builder. This value will never be |
See also:
setInfoIntent
PrinterInfo.Builder setInfoIntent (PendingIntent infoIntent)
Sets the PendingIntent
that launches an activity showing more information about
the printer.
Parameters | |
---|---|
infoIntent |
PendingIntent : The intent .This value must never be |
Returns | |
---|---|
PrinterInfo.Builder |
This builder.
This value will never be |
setName
PrinterInfo.Builder setName (String name)
Sets the localized printer name which is shown to the user
Parameters | |
---|---|
name |
String : The name.This value must never be |
Returns | |
---|---|
PrinterInfo.Builder |
This builder.
This value will never be |
setStatus
PrinterInfo.Builder setStatus (int status)
Sets the printer status.
Parameters | |
---|---|
status |
int : The status.Value is |
Returns | |
---|---|
PrinterInfo.Builder |
This builder. This value will never be |
See also:
Classes
- PageRange
- PrintAttributes
- PrintAttributes.Builder
- PrintAttributes.Margins
- PrintAttributes.MediaSize
- PrintAttributes.Resolution
- PrintDocumentAdapter
- PrintDocumentAdapter.LayoutResultCallback
- PrintDocumentAdapter.WriteResultCallback
- PrintDocumentInfo
- PrintDocumentInfo.Builder
- PrinterCapabilitiesInfo
- PrinterCapabilitiesInfo.Builder
- PrinterId
- PrinterInfo
- PrinterInfo.Builder
- PrintJob
- PrintJobId
- PrintJobInfo
- PrintJobInfo.Builder
- PrintManager