FormWidgetInfo


public final class FormWidgetInfo implements Parcelable


Information about a form widget of a PDF document.

Summary

Constants

static final int

Represents a checkbox type form widget

static final int

Represents a combobox type form widget

static final int

Represents a listbox type form widget

static final int

Represents a push button type form widget

static final int

Represents a radio button type form widget

static final int

Represents a signature type form widget

static final int

Represents a text field type form widget

static final int

Represents a form widget type that is unknown

Public fields

static final @NonNull Parcelable.Creator<@NonNull FormWidgetInfo>

Public methods

static final @NonNull FormWidgetInfo
createCheckbox(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly
)

Factory method for creating form widget of type WIDGET_TYPE_CHECKBOX.

static final @NonNull FormWidgetInfo
createComboBox(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly,
    boolean isEditableText,
    @FloatRange(from = 0.0) float fontSize,
    @NonNull List<@NonNull ListItem> listItems
)

Factory method for creating form widget of type WIDGET_TYPE_COMBOBOX.

static final @NonNull FormWidgetInfo
createListBox(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly,
    boolean isMultiSelect,
    @NonNull List<@NonNull ListItem> listItems
)
static final @NonNull FormWidgetInfo
createPushButton(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly
)

Factory method for creating form widget of type WIDGET_TYPE_PUSHBUTTON.

static final @NonNull FormWidgetInfo
createRadioButton(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly
)

Factory method for creating form widget of type WIDGET_TYPE_RADIOBUTTON.

static final @NonNull FormWidgetInfo
createSignature(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly
)

Factory method for creating form widget of type WIDGET_TYPE_SIGNATURE.

static final @NonNull FormWidgetInfo
createTextField(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly,
    boolean isEditableText,
    boolean isMultiLineText,
    @IntRange(from = 0) int maxLength,
    @FloatRange(from = 0.0) float fontSize
)

Factory method for creating form widget of type WIDGET_TYPE_TEXTFIELD.

int
boolean
equals(Object other)
final String

The accessibility label for this widget, if present.

final float

The configured font size for a form widget that accepts text input (WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_TEXTFIELD), or 0 for widgets this does not apply to.

final @NonNull List<@NonNull ListItem>

The set of choice options in a form widget of type WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_LISTBOX, or an empty list for other widget types.

final int

The configured maximum text length for a form widget of type WIDGET_TYPE_TEXTFIELD), or -1 for widgets this does not apply to.

final String

The text value of this widget, if present.

final int

The index of this widget among all form widgets on the page

final @NonNull Rect

The bounds of this widget in PDF coordinates

final int

The WidgetType of this widget

int
final boolean

True if this widget has editable text.

final boolean

True if this widget supports multi-line text input.

final boolean

True if this widget supports selecting multiple ListItems.

final boolean

True if this widget is read-only and accepts changes

void
writeToParcel(@NonNull Parcel dest, int flags)

Constants

WIDGET_TYPE_CHECKBOX

public static final int WIDGET_TYPE_CHECKBOX = 2

Represents a checkbox type form widget

WIDGET_TYPE_COMBOBOX

public static final int WIDGET_TYPE_COMBOBOX = 4

Represents a combobox type form widget

WIDGET_TYPE_LISTBOX

public static final int WIDGET_TYPE_LISTBOX = 5

Represents a listbox type form widget

WIDGET_TYPE_PUSHBUTTON

public static final int WIDGET_TYPE_PUSHBUTTON = 1

Represents a push button type form widget

WIDGET_TYPE_RADIOBUTTON

public static final int WIDGET_TYPE_RADIOBUTTON = 3

Represents a radio button type form widget

WIDGET_TYPE_SIGNATURE

public static final int WIDGET_TYPE_SIGNATURE = 7

Represents a signature type form widget

WIDGET_TYPE_TEXTFIELD

public static final int WIDGET_TYPE_TEXTFIELD = 6

Represents a text field type form widget

WIDGET_TYPE_UNKNOWN

public static final int WIDGET_TYPE_UNKNOWN = 0

Represents a form widget type that is unknown

Public fields

CREATOR

public static final @NonNull Parcelable.Creator<@NonNull FormWidgetInfoCREATOR

Public methods

createCheckbox

Added in 1.0.0-alpha13
public static final @NonNull FormWidgetInfo createCheckbox(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly
)

Factory method for creating form widget of type WIDGET_TYPE_CHECKBOX.

createComboBox

Added in 1.0.0-alpha13
public static final @NonNull FormWidgetInfo createComboBox(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly,
    boolean isEditableText,
    @FloatRange(from = 0.0) float fontSize,
    @NonNull List<@NonNull ListItem> listItems
)

Factory method for creating form widget of type WIDGET_TYPE_COMBOBOX.

createListBox

Added in 1.0.0-alpha13
public static final @NonNull FormWidgetInfo createListBox(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly,
    boolean isMultiSelect,
    @NonNull List<@NonNull ListItem> listItems
)

createPushButton

Added in 1.0.0-alpha13
public static final @NonNull FormWidgetInfo createPushButton(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly
)

Factory method for creating form widget of type WIDGET_TYPE_PUSHBUTTON.

createRadioButton

Added in 1.0.0-alpha13
public static final @NonNull FormWidgetInfo createRadioButton(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly
)

Factory method for creating form widget of type WIDGET_TYPE_RADIOBUTTON.

createSignature

Added in 1.0.0-alpha13
public static final @NonNull FormWidgetInfo createSignature(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly
)

Factory method for creating form widget of type WIDGET_TYPE_SIGNATURE.

createTextField

Added in 1.0.0-alpha13
public static final @NonNull FormWidgetInfo createTextField(
    @IntRange(from = 0) int widgetIndex,
    @NonNull Rect widgetRect,
    String textValue,
    String accessibilityLabel,
    boolean isReadOnly,
    boolean isEditableText,
    boolean isMultiLineText,
    @IntRange(from = 0) int maxLength,
    @FloatRange(from = 0.0) float fontSize
)

Factory method for creating form widget of type WIDGET_TYPE_TEXTFIELD.

describeContents

Added in 1.0.0-alpha13
public int describeContents()

equals

public boolean equals(Object other)

getAccessibilityLabel

Added in 1.0.0-alpha13
public final String getAccessibilityLabel()

The accessibility label for this widget, if present. Comes from the "TU" or "T" value in the annotation dictionary.

See PDF spec 1.7 Table 8.69

getFontSize

Added in 1.0.0-alpha13
public final float getFontSize()

The configured font size for a form widget that accepts text input (WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_TEXTFIELD), or 0 for widgets this does not apply to.

getListItems

Added in 1.0.0-alpha13
public final @NonNull List<@NonNull ListItemgetListItems()

The set of choice options in a form widget of type WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_LISTBOX, or an empty list for other widget types.

getMaxLength

Added in 1.0.0-alpha13
public final int getMaxLength()

The configured maximum text length for a form widget of type WIDGET_TYPE_TEXTFIELD), or -1 for widgets this does not apply to.

getTextValue

Added in 1.0.0-alpha13
public final String getTextValue()

The text value of this widget, if present. Comes from the "V" value in the annotation dictionary.

See PDF spec 1.7 Table 8.69

getWidgetIndex

Added in 1.0.0-alpha13
public final int getWidgetIndex()

The index of this widget among all form widgets on the page

getWidgetRect

Added in 1.0.0-alpha13
public final @NonNull Rect getWidgetRect()

The bounds of this widget in PDF coordinates

getWidgetType

Added in 1.0.0-alpha13
public final int getWidgetType()

The WidgetType of this widget

hashCode

public int hashCode()

isEditableText

Added in 1.0.0-alpha13
public final boolean isEditableText()

True if this widget has editable text. Only applicable to WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_TEXTFIELD. Defaults to 'false' for other widget types.

isMultiLineText

Added in 1.0.0-alpha13
public final boolean isMultiLineText()

True if this widget supports multi-line text input. Only applicable to WIDGET_TYPE_TEXTFIELD. Defaults to 'false' for other widget types.

isMultiSelect

Added in 1.0.0-alpha13
public final boolean isMultiSelect()

True if this widget supports selecting multiple ListItems. Only applicable to WIDGET_TYPE_LISTBOX. Defaults to 'false' for other widget types.

isReadOnly

Added in 1.0.0-alpha13
public final boolean isReadOnly()

True if this widget is read-only and accepts changes

writeToParcel

Added in 1.0.0-alpha13
public void writeToParcel(@NonNull Parcel dest, int flags)