Sequenceablepublic class NotificationUserInput extends Object implements Sequenceable
IntentAgent.
You should always use NotificationUserInput.Builder to create instances of this class.
You can call NotificationActionButton.Builder#addNotificationUserInput(NotificationUserInput) to add
a NotificationUserInput object to a NotificationActionButton.SystemCapability.Notification#ANS| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
NotificationUserInput.Builder |
Builder class for
NotificationUserInput object. |
Sequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static Sequenceable.Producer<NotificationUserInput> |
PRODUCER |
Creates a
NotificationUserInput instance from a Parcel. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static void |
addInputsToIntent(List<NotificationUserInput> userInputs,
Intent intent,
PacMap pacMap) |
Adds a list of
NotificationUserInput objects to an Intent. |
static void |
addMimeInputToIntent(NotificationUserInput userInput,
Intent intent,
Map<String,Uri> results) |
Adds the given
NotificationUserInput object of a specified MIME type to an
Intent. |
PacMap |
getAdditionalData() |
Obtains the additional data included in this
NotificationUserInput object. |
int |
getEditType() |
Obtains the edit type of the options provided by this
NotificationUserInput object. |
String |
getInputKey() |
Obtains the key of this
NotificationUserInput object. |
static PacMap |
getInputsFromIntent(Intent intent) |
Obtains the input text results from a specified
ohos.aafwk.content.Intent. |
static int |
getInputsSource(Intent intent) |
Obtains the input source of this
NotificationUserInput object. |
static Map<String,Uri> |
getMimeInputsFromIntent(Intent intent,
String inputKey) |
Obtains the input results of a particular MIME type from a specified
ohos.aafwk.content.Intent. |
List<String> |
getOptions() |
Obtains the options provided to the user to satisfy user input needs.
|
Set<String> |
getPermitMimeTypes() |
Obtains the MIME types allowed by this
NotificationUserInput object. |
String |
getTag() |
Obtains the tag to be displayed to the user when collecting this input from the user.
|
boolean |
isMimeTypeOnly() |
Checks whether this
NotificationUserInput object allows only values of particular MIME types. |
boolean |
isPermitFreeFormInput() |
Checks whether users can provide arbitrary values for this
NotificationUserInput object. |
boolean |
marshalling(Parcel out) |
Marshals a
NotificationUserInput object into a Parcel. |
static void |
setInputsSource(Intent intent,
NotificationConstant.InputsSource source) |
Sets the input source of this
NotificationUserInput object. |
String |
toString() |
Returns a string representation of the object.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals a
NotificationUserInput object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasFileDescriptorpublic static final Sequenceable.Producer<NotificationUserInput> PRODUCER
NotificationUserInput instance from a Parcel.public static void addMimeInputToIntent(NotificationUserInput userInput, Intent intent, Map<String,Uri> results)
NotificationUserInput object of a specified MIME type to an
Intent. This method is similar to addInputsToIntent(java.util.List<ohos.event.notification.NotificationUserInput>, ohos.aafwk.content.Intent, ohos.utils.PacMap) except that
the MIME type must be specified.userInput - Indicates the NotificationUserInput object for which the input results are provided.intent - Indicates the Intent to which the input results are to be added.results - Indicates a map containing the MIME type and its URI result.public static void addInputsToIntent(List<NotificationUserInput> userInputs, Intent intent, PacMap pacMap)
NotificationUserInput objects to an Intent.
This method should only be called by user input collection services when sending input results to an
IntentAgent.userInputs - Indicates the list of NotificationUserInput objects for which
the input results are provided.intent - Indicates the Intent to which the input results are to be added.pacMap - Indicates the PacMap object holding the input results.
The PacMap key must match the keys contained in the objects specified in userInputs.public static Map<String,Uri> getMimeInputsFromIntent(Intent intent, String inputKey)
ohos.aafwk.content.Intent.
This method is similar to getInputsFromIntent(ohos.aafwk.content.Intent) but uses the key of the NotificationUserInput.intent - Indicates the Intent containing the user input results.inputKey - Indicates the key of the NotificationUserInput results to obtain.public static PacMap getInputsFromIntent(Intent intent)
ohos.aafwk.content.Intent.intent - Indicates the Intent object containing one or more user input results.PacMap object containing the input text results.public static void setInputsSource(Intent intent, NotificationConstant.InputsSource source)
NotificationUserInput object.intent - Indicates the Intent to which the input result is to be added.source - Indicates the input source. For available values, see NotificationConstant.InputsSource.public static int getInputsSource(Intent intent)
NotificationUserInput object.intent - Indicates the Intent containing the input result.NotificationUserInput object, as enumerated in
NotificationConstant.InputsSource.public String getInputKey()
NotificationUserInput object.NotificationUserInput object.public String getTag()
public List<String> getOptions()
public Set<String> getPermitMimeTypes()
NotificationUserInput object.public PacMap getAdditionalData()
NotificationUserInput object.NotificationUserInput object.public boolean isPermitFreeFormInput()
NotificationUserInput object.true if this object allows arbitrary values; returns false otherwise.public boolean isMimeTypeOnly()
NotificationUserInput object allows only values of particular MIME types.true if this object allows only values of particular MIME types;
returns false otherwise.public int getEditType()
NotificationUserInput object.NotificationConstant.InputEditTypepublic boolean marshalling(Parcel out)
NotificationUserInput object into a Parcel.
A process can call the unmarshalling(ohos.utils.Parcel) method to unmarshal a
NotificationUserInput object from a Parcel to implement inter-process communication (IPC).
marshalling 在接口中 Sequenceableout - Indicates the Parcel object for marshalling.true if the marshalling is successful; returns false otherwise.public boolean unmarshalling(Parcel in)
NotificationUserInput object from a Parcel.unmarshalling 在接口中 Sequenceablein - Indicates the Parcel object for unmarshalling.true if the unmarshalling is successful; returns false otherwise.public String toString()
ObjecttoString 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())