Android APIs
public final class

PrintJobInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.print.PrintJobInfo

Class Overview

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.

Summary

Nested Classes
class PrintJobInfo.Builder Builder for creating a PrintJobInfo
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.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<PrintJobInfo> CREATOR
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
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.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel parcel, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int STATE_BLOCKED

Added in API level 19

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

Added in API level 19

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

Added in API level 19

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

Added in API level 19

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

Added in API level 19

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

Added in API level 19

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

Added in API level 19

Print job state: The print job is being printed.

Next valid states: STATE_COMPLETED, STATE_FAILED, STATE_CANCELED, STATE_BLOCKED

Constant Value: 3 (0x00000003)

Fields

public static final Creator<PrintJobInfo> CREATOR

Added in API level 19

Public Methods

public int describeContents ()

Added in API level 19

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public PrintAttributes getAttributes ()

Added in API level 19

Gets the print job attributes.

Returns
  • The attributes.

public int getCopies ()

Added in API level 19

Gets the number of copies.

Returns
  • The number of copies or zero if not set.

public long getCreationTime ()

Added in API level 19

Gets the wall time in millisecond when this print job was created.

Returns
  • The creation time in milliseconds.

public PrintJobId getId ()

Added in API level 19

Gets the unique print job id.

Returns
  • The id.

public String getLabel ()

Added in API level 19

Gets the human readable job label.

Returns
  • The label.

public PageRange[] getPages ()

Added in API level 19

Gets the included pages.

Returns
  • The included pages or null if not set.

public PrinterId getPrinterId ()

Added in API level 19

Gets the unique target printer id.

Returns
  • The target printer id.

public int getState ()

Added in API level 19

Gets the current job state.

Returns
  • The job state.

public String toString ()

Added in API level 19

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel parcel, int flags)

Added in API level 19

Flatten this object in to a Parcel.

Parameters
parcel The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.