Most visited

Recently visited

Added in API level 19

PrintJobInfo

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.

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.

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 instance's marshaled 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 representation of the object.

void writeToParcel(Parcel parcel, int flags)

Flatten this object in to a Parcel.

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

Constants

STATE_BLOCKED

Added in API level 19
int STATE_BLOCKED

Print job state: The print job is blocked.

Next valid states: STATE_FAILED, STATE_CANCELED, STATE_STARTED

Constant Value: 4 (0x00000004)

STATE_CANCELED

Added in API level 19
int STATE_CANCELED

Print job state: The print job is canceled. This is a terminal state.

Next valid states: None

Constant Value: 7 (0x00000007)

STATE_COMPLETED

Added in API level 19
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)

STATE_CREATED

Added in API level 19
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)

STATE_FAILED

Added in API level 19
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)

STATE_QUEUED

Added in API level 19
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)

STATE_STARTED

Added in API level 19
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)

Fields

CREATOR

Added in API level 19
Creator<PrintJobInfo> CREATOR

Public methods

describeContents

Added in API level 19
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(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.

getAttributes

Added in API level 19
PrintAttributes getAttributes ()

Gets the print job attributes.

Returns
PrintAttributes The attributes.

getCopies

Added in API level 19
int getCopies ()

Gets the number of copies.

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

getCreationTime

Added in API level 19
long getCreationTime ()

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

Returns
long The creation time in milliseconds.

getId

Added in API level 19
PrintJobId getId ()

Gets the unique print job id.

Returns
PrintJobId The id.

getLabel

Added in API level 19
String getLabel ()

Gets the human readable job label.

Returns
String The label.

getPages

Added in API level 19
PageRange[] getPages ()

Gets the included pages.

Returns
PageRange[] The included pages or null if not set.

getPrinterId

Added in API level 19
PrinterId getPrinterId ()

Gets the unique target printer id.

Returns
PrinterId The target printer id.

getState

Added in API level 19
int getState ()

Gets the current job state.

Returns
int The job state.

See also:

toString

Added in API level 19
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.

writeToParcel

Added in API level 19
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_WRITE_RETURN_VALUE.

Hooray!