# Print output for @column tags ?>
public
final
class
PrintJobInfo
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.print.PrintJobInfo |
This class represents the description of a print job. The print job state includes properties such as its id, print attributes used for generating the content, and so on. Note that the print jobs state may change over time and this class represents a snapshot of this state.
Nested classes | |
---|---|
class |
PrintJobInfo.Builder
Builder for creating a |
Constants | |
---|---|
int |
STATE_BLOCKED
Print job state: The print job is blocked. |
int |
STATE_CANCELED
Print job state: The print job is canceled. |
int |
STATE_COMPLETED
Print job state: The print job is successfully printed. |
int |
STATE_CREATED
Print job state: The print job is being created but not yet ready to be printed. |
int |
STATE_FAILED
Print job state: The print job was printing but printing failed. |
int |
STATE_QUEUED
Print job state: The print jobs is created, it is ready to be printed and should be processed. |
int |
STATE_STARTED
Print job state: The print job is being printed. |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<PrintJobInfo> |
CREATOR
|
Public methods | |
---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
int
|
getAdvancedIntOption(String key)
Gets the value of an advanced (printer specific) print option. |
String
|
getAdvancedStringOption(String key)
Gets the value of an advanced (printer specific) print option. |
PrintAttributes
|
getAttributes()
Gets the print job attributes. |
int
|
getCopies()
Gets the number of copies. |
long
|
getCreationTime()
Gets the wall time in millisecond when this print job was created. |
PrintJobId
|
getId()
Gets the unique print job id. |
String
|
getLabel()
Gets the human readable job label. |
PageRange[]
|
getPages()
Gets the included pages. |
PrinterId
|
getPrinterId()
Gets the unique target printer id. |
int
|
getState()
Gets the current job state. |
boolean
|
hasAdvancedOption(String key)
Gets whether this job has a given advanced (printer specific) print option. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel parcel, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
public static final int STATE_BLOCKED
Print job state: The print job is blocked.
Next valid states: STATE_FAILED
, STATE_CANCELED
,
STATE_STARTED
Constant Value: 4 (0x00000004)
public static final int STATE_CANCELED
Print job state: The print job is canceled. This is a terminal state.
Next valid states: None
Constant Value: 7 (0x00000007)
public static final int STATE_COMPLETED
Print job state: The print job is successfully printed. This is a terminal state.
Next valid states: None
Constant Value: 5 (0x00000005)
public static final int STATE_CREATED
Print job state: The print job is being created but not yet ready to be printed.
Next valid states: STATE_QUEUED
Constant Value: 1 (0x00000001)
public static final int STATE_FAILED
Print job state: The print job was printing but printing failed.
Next valid states: STATE_CANCELED
, STATE_STARTED
Constant Value: 6 (0x00000006)
public static final int STATE_QUEUED
Print job state: The print jobs is created, it is ready to be printed and should be processed.
Next valid states: STATE_STARTED
, STATE_FAILED
,
STATE_CANCELED
Constant Value: 2 (0x00000002)
public static final int STATE_STARTED
Print job state: The print job is being printed.
Next valid states: STATE_COMPLETED
, STATE_FAILED
,
STATE_CANCELED
, STATE_BLOCKED
Constant Value: 3 (0x00000003)
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
public int getAdvancedIntOption (String key)
Gets the value of an advanced (printer specific) print option.
Parameters | |
---|---|
key |
String : The option key. |
Returns | |
---|---|
int |
The option value. |
public String getAdvancedStringOption (String key)
Gets the value of an advanced (printer specific) print option.
Parameters | |
---|---|
key |
String : The option key. |
Returns | |
---|---|
String |
The option value. |
public PrintAttributes getAttributes ()
Gets the print job attributes.
Returns | |
---|---|
PrintAttributes |
The attributes.
This value cannot be null . |
public int getCopies ()
Gets the number of copies.
Returns | |
---|---|
int |
The number of copies or zero if not set. Value is 0 or greater |
public long getCreationTime ()
Gets the wall time in millisecond when this print job was created.
Returns | |
---|---|
long |
The creation time in milliseconds. |
public PrintJobId getId ()
Gets the unique print job id.
Returns | |
---|---|
PrintJobId |
The id.
This value may be null . |
public String getLabel ()
Gets the human readable job label.
Returns | |
---|---|
String |
The label.
This value cannot be null . |
public PageRange[] getPages ()
Gets the included pages.
Returns | |
---|---|
PageRange[] |
The included pages or null if not set. |
public PrinterId getPrinterId ()
Gets the unique target printer id.
Returns | |
---|---|
PrinterId |
The target printer id.
This value may be null . |
public int getState ()
Gets the current job state.
Returns | |
---|---|
int |
The job state.
Value is STATE_CREATED , STATE_QUEUED , STATE_STARTED , STATE_BLOCKED , STATE_COMPLETED , STATE_FAILED , or STATE_CANCELED |
public boolean hasAdvancedOption (String key)
Gets whether this job has a given advanced (printer specific) print option.
Parameters | |
---|---|
key |
String : The option key. |
Returns | |
---|---|
boolean |
Whether the option is present. |
public String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel parcel, int flags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
parcel |
Parcel : The Parcel in which the object should be written. |
flags |
int : Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |