Fields Summary |
---|
public static final int | STATE_ANYConstant for matching any print job state. |
public static final int | STATE_ANY_VISIBLE_TO_CLIENTSConstant for matching any print job state. |
public static final int | STATE_ANY_ACTIVEConstant for matching any active print job state. |
public static final int | STATE_ANY_SCHEDULEDConstant for matching any scheduled, i.e. delivered to a print
service, print job state. |
public static final int | STATE_CREATEDPrint job state: The print job is being created but not yet
ready to be printed.
Next valid states: {@link #STATE_QUEUED}
|
public static final int | STATE_QUEUEDPrint job state: The print jobs is created, it is ready
to be printed and should be processed.
Next valid states: {@link #STATE_STARTED}, {@link #STATE_FAILED},
{@link #STATE_CANCELED}
|
public static final int | STATE_STARTEDPrint job state: The print job is being printed.
Next valid states: {@link #STATE_COMPLETED}, {@link #STATE_FAILED},
{@link #STATE_CANCELED}, {@link #STATE_BLOCKED}
|
public static final int | STATE_BLOCKEDPrint job state: The print job is blocked.
Next valid states: {@link #STATE_FAILED}, {@link #STATE_CANCELED},
{@link #STATE_STARTED}
|
public static final int | STATE_COMPLETEDPrint job state: The print job is successfully printed.
This is a terminal state.
Next valid states: None
|
public static final int | STATE_FAILEDPrint job state: The print job was printing but printing failed.
Next valid states: {@link #STATE_CANCELED}, {@link #STATE_STARTED}
|
public static final int | STATE_CANCELEDPrint job state: The print job is canceled.
This is a terminal state.
Next valid states: None
|
private PrintJobId | mIdThe unique print job id. |
private String | mLabelThe human readable print job label. |
private PrinterId | mPrinterIdThe unique id of the printer. |
private String | mPrinterNameThe name of the printer - internally used |
private int | mStateThe state of the print job. |
private int | mAppIdThe id of the app that created the job. |
private String | mTagOptional tag assigned by a print service. |
private long | mCreationTimeThe wall time when the print job was created. |
private int | mCopiesHow many copies to print. |
private String | mStateReasonReason for the print job being in its current state. |
private PageRange[] | mPageRangesThe pages to print |
private PrintAttributes | mAttributesThe print job attributes size. |
private PrintDocumentInfo | mDocumentInfoInformation about the printed document. |
private android.os.Bundle | mAdvancedOptionsAdvanced printer specific options. |
private boolean | mCancelingWhether we are trying to cancel this print job. |
public static final Parcelable.Creator | CREATOR |
Methods Summary |
---|
public int | describeContents()
return 0;
|
public int | getAdvancedIntOption(java.lang.String key)Gets the value of an advanced (printer specific) print option.
if (mAdvancedOptions != null) {
return mAdvancedOptions.getInt(key);
}
return 0;
|
public android.os.Bundle | getAdvancedOptions()Gets the advanced options.
return mAdvancedOptions;
|
public java.lang.String | getAdvancedStringOption(java.lang.String key)Gets the value of an advanced (printer specific) print option.
if (mAdvancedOptions != null) {
return mAdvancedOptions.getString(key);
}
return null;
|
public int | getAppId()Sets the owning application id.
return mAppId;
|
public PrintAttributes | getAttributes()Gets the print job attributes.
return mAttributes;
|
public int | getCopies()Gets the number of copies.
return mCopies;
|
public long | getCreationTime()Gets the wall time in millisecond when this print job was created.
return mCreationTime;
|
public PrintDocumentInfo | getDocumentInfo()Gets the info describing the printed document.
return mDocumentInfo;
|
public PrintJobId | getId()Gets the unique print job id.
return mId;
|
public java.lang.String | getLabel()Gets the human readable job label.
return mLabel;
|
public PageRange[] | getPages()Gets the included pages.
return mPageRanges;
|
public PrinterId | getPrinterId()Gets the unique target printer id.
return mPrinterId;
|
public java.lang.String | getPrinterName()Gets the name of the target printer.
return mPrinterName;
|
public int | getState()Gets the current job state.
return mState;
|
public java.lang.String | getStateReason()Gets the reason for the print job being in the current state.
return mStateReason;
|
public java.lang.String | getTag()Gets the optional tag assigned by a print service.
return mTag;
|
public boolean | hasAdvancedOption(java.lang.String key)Gets whether this job has a given advanced (printer specific) print
option.
return mAdvancedOptions != null && mAdvancedOptions.containsKey(key);
|
public boolean | isCancelling()Gets whether this print is being cancelled.
return mCanceling;
|
public void | setAdvancedOptions(android.os.Bundle options)Sets the advanced options.
mAdvancedOptions = options;
|
public void | setAppId(int appId)Sets the owning application id.
mAppId = appId;
|
public void | setAttributes(PrintAttributes attributes)Sets the print job attributes.
mAttributes = attributes;
|
public void | setCancelling(boolean cancelling)Sets whether this print is being cancelled.
mCanceling = cancelling;
|
public void | setCopies(int copyCount)Sets the number of copies.
if (copyCount < 1) {
throw new IllegalArgumentException("Copies must be more than one.");
}
mCopies = copyCount;
|
public void | setCreationTime(long creationTime)Sets the wall time in milliseconds when this print job was created.
if (creationTime < 0) {
throw new IllegalArgumentException("creationTime must be non-negative.");
}
mCreationTime = creationTime;
|
public void | setDocumentInfo(PrintDocumentInfo info)Sets the info describing the printed document.
mDocumentInfo = info;
|
public void | setId(PrintJobId id)Sets the unique print job id.
this.mId = id;
|
public void | setLabel(java.lang.String label)Sets the human readable job label.
mLabel = label;
|
public void | setPages(PageRange[] pageRanges)Sets the included pages.
mPageRanges = pageRanges;
|
public void | setPrinterId(PrinterId printerId)Sets the unique target pritner id.
mPrinterId = printerId;
|
public void | setPrinterName(java.lang.String printerName)Sets the name of the target printer.
mPrinterName = printerName;
|
public void | setState(int state)Sets the current job state.
mState = state;
|
public void | setStateReason(java.lang.String stateReason)Sets the reason for the print job being in the current state.
mStateReason = stateReason;
|
public void | setTag(java.lang.String tag)Sets the optional tag assigned by a print service.
mTag = tag;
|
public static java.lang.String | stateToString(int state)
switch (state) {
case STATE_CREATED: {
return "STATE_CREATED";
}
case STATE_QUEUED: {
return "STATE_QUEUED";
}
case STATE_STARTED: {
return "STATE_STARTED";
}
case STATE_BLOCKED: {
return "STATE_BLOCKED";
}
case STATE_FAILED: {
return "STATE_FAILED";
}
case STATE_COMPLETED: {
return "STATE_COMPLETED";
}
case STATE_CANCELED: {
return "STATE_CANCELED";
}
default: {
return "STATE_UNKNOWN";
}
}
|
public java.lang.String | toString()
StringBuilder builder = new StringBuilder();
builder.append("PrintJobInfo{");
builder.append("label: ").append(mLabel);
builder.append(", id: ").append(mId);
builder.append(", state: ").append(stateToString(mState));
builder.append(", printer: " + mPrinterId);
builder.append(", tag: ").append(mTag);
builder.append(", creationTime: " + mCreationTime);
builder.append(", copies: ").append(mCopies);
builder.append(", attributes: " + (mAttributes != null
? mAttributes.toString() : null));
builder.append(", documentInfo: " + (mDocumentInfo != null
? mDocumentInfo.toString() : null));
builder.append(", cancelling: " + mCanceling);
builder.append(", pages: " + (mPageRanges != null
? Arrays.toString(mPageRanges) : null));
builder.append(", hasAdvancedOptions: " + (mAdvancedOptions != null));
builder.append("}");
return builder.toString();
|
public void | writeToParcel(android.os.Parcel parcel, int flags)
parcel.writeParcelable(mId, flags);
parcel.writeString(mLabel);
parcel.writeParcelable(mPrinterId, flags);
parcel.writeString(mPrinterName);
parcel.writeInt(mState);
parcel.writeInt(mAppId);
parcel.writeString(mTag);
parcel.writeLong(mCreationTime);
parcel.writeInt(mCopies);
parcel.writeString(mStateReason);
parcel.writeParcelableArray(mPageRanges, flags);
parcel.writeParcelable(mAttributes, flags);
parcel.writeParcelable(mDocumentInfo, 0);
parcel.writeInt(mCanceling ? 1 : 0);
parcel.writeBundle(mAdvancedOptions);
|