TtsSpan
open class TtsSpan : ParcelableSpan
kotlin.Any | |
↳ | android.text.style.TtsSpan |
A span that supplies additional meta-data for the associated text intended for text-to-speech engines. If the text is being processed by a text-to-speech engine, the engine may use the data in this span in addition to or instead of its associated text. Each instance of a TtsSpan has a type, for example TYPE_DATE
or TYPE_MEASURE
. And a list of arguments, provided as key-value pairs in a bundle. The inner classes are there for convenience and provide builders for each TtsSpan type.
Summary
Nested classes | |
---|---|
open |
A simple builder for TtsSpans. |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans, has setters for morphosyntactic features. |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
open |
A builder for TtsSpans of type |
Constants | |
---|---|
static String | |
static String | |
static String |
String argument supplying animacy information. |
static String |
String argument supplying case information. |
static String |
Argument used to specify the country code of a telephone number. |
static String |
Argument used to specify the currency. |
static String |
Argument used to specify the day of the month of a date. |
static String |
Argument used to specify the denominator of a fraction. |
static String |
Argument used to specify a string of digits. |
static String |
Argument used to specify the domain part of a URI. |
static String |
Argument used to specify the extension part of a telephone number. |
static String |
Argument used to specify the fractional part of a decimal. |
static String |
Argument used to specify the fragment id of a URI. |
static String |
String argument supplying gender information. |
static String |
Argument used to specify the hours of a time. |
static String |
Argument used to specify the integer part of a decimal or fraction. |
static String |
Argument used to specify the minutes of a time. |
static String |
Argument used to specify the month of a date. |
static String |
String argument supplying multiplicity information. |
static String |
Argument used to specify a whole number. |
static String |
Argument used to specify the main number part of a telephone number. |
static String |
Argument used to specify the numerator of a fraction. |
static String |
Argument used to specify the password part of a URI. |
static String |
Argument used to specify the path part of a URI. |
static String |
Argument used to specify the port number of a URI. |
static String |
Argument used to specify the protocol of a URI. |
static String |
Argument used to choose the suffix (thousand, million, etc) that is used to pronounce large amounts of money. |
static String |
Argument used to specify the query string of a URI. |
static String |
String supplying the text to be synthesized. |
static String |
Argument used to specify the unit of a measure. |
static String |
Argument used to specify the username part of a URI. |
static String |
Argument used to specify a string where the characters are read verbatim, except whitespace. |
static String |
Argument used to specify the weekday of a date. |
static String |
Argument used to specify the year of a date. |
static String | |
static String | |
static String | |
static String | |
static String | |
static String | |
static String | |
static String | |
static String | |
static String | |
static String | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static String | |
static String | |
static String | |
static String |
The text associated with this span is a cardinal. |
static String |
The text associated with this span is a date. |
static String |
The text associated with this span is a decimal number. |
static String |
The text associated with this span is a series of digits that have to be read sequentially. |
static String |
The text associated with this span is a URI (can be used for URLs and email addresses). |
static String |
The text associated with this span is a fractional number. |
static String |
The text associated with this span is a measure, consisting of a number and a unit. |
static String |
The text associated with this span is an amount of money. |
static String |
The text associated with this span is an ordinal. |
static String |
The text associated with this span is a telephone number. |
static String |
This span type can be used to add morphosyntactic features to the text it spans over, or synthesize a something else than the spanned text. |
static String |
The text associated with this span is a time, consisting of a number of hours and minutes, specified with |
static String |
The text associated with this span is a series of characters that have to be read verbatim. |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int | |
static Int |
Public constructors | |
---|---|
TtsSpan(type: String!, args: PersistableBundle!) |
Public methods | |
---|---|
open Int | |
open PersistableBundle! |
getArgs() Returns a bundle of the arguments set. |
open Int | |
open String! |
getType() Returns the type. |
open Unit |
writeToParcel(dest: Parcel, flags: Int) |
Constants
ANIMACY_INANIMATE
static val ANIMACY_INANIMATE: String
Value: "android.inanimate"
ARG_ANIMACY
static val ARG_ANIMACY: String
String argument supplying animacy information. Can be ANIMACY_ANIMATE
or ANIMACY_INANIMATE
Value: "android.arg.animacy"
ARG_CASE
static val ARG_CASE: String
String argument supplying case information. Can be any of CASE_NOMINATIVE
, CASE_ACCUSATIVE
, CASE_DATIVE
, CASE_ABLATIVE
, CASE_GENITIVE
, CASE_VOCATIVE
, CASE_LOCATIVE
and CASE_INSTRUMENTAL
Value: "android.arg.case"
ARG_COUNTRY_CODE
static val ARG_COUNTRY_CODE: String
Argument used to specify the country code of a telephone number. Can be a string of digits optionally prefixed with a "+". Can be used with TYPE_TELEPHONE
.
Value: "android.arg.country_code"
ARG_CURRENCY
static val ARG_CURRENCY: String
Argument used to specify the currency. Should be a ISO4217 currency code, e.g. "USD". Can be used with TYPE_MONEY
.
Value: "android.arg.money"
ARG_DAY
static val ARG_DAY: String
Argument used to specify the day of the month of a date. The value should be provided as an integer in the range from 1 up to and including 31. Can be used with TYPE_DATE
.
Value: "android.arg.day"
ARG_DENOMINATOR
static val ARG_DENOMINATOR: String
Argument used to specify the denominator of a fraction. The value can be a string of digits of any size optionally prefixed with a + or -. Can be used with TYPE_FRACTION
.
Value: "android.arg.denominator"
ARG_DIGITS
static val ARG_DIGITS: String
Argument used to specify a string of digits. Can be used with TYPE_DIGITS
.
Value: "android.arg.digits"
ARG_DOMAIN
static val ARG_DOMAIN: String
Argument used to specify the domain part of a URI. For example "source.android.com". Can be used with TYPE_ELECTRONIC
.
Value: "android.arg.domain"
ARG_EXTENSION
static val ARG_EXTENSION: String
Argument used to specify the extension part of a telephone number. Can be a string of digits. Can be used with TYPE_TELEPHONE
.
Value: "android.arg.extension"
ARG_FRACTIONAL_PART
static val ARG_FRACTIONAL_PART: String
Argument used to specify the fractional part of a decimal. The value can be a string of digits of any size. Can be used with TYPE_DECIMAL
.
Value: "android.arg.fractional_part"
ARG_FRAGMENT_ID
static val ARG_FRAGMENT_ID: String
Argument used to specify the fragment id of a URI. Should be specified as a string. Can be used with TYPE_ELECTRONIC
.
Value: "android.arg.fragment_id"
ARG_GENDER
static val ARG_GENDER: String
String argument supplying gender information. Can be any of GENDER_NEUTRAL
, GENDER_MALE
and GENDER_FEMALE
.
Value: "android.arg.gender"
ARG_HOURS
static val ARG_HOURS: String
Argument used to specify the hours of a time. The hours should be provided as an integer in the range from 0 up to and including 24. Can be used with TYPE_TIME
.
Value: "android.arg.hours"
ARG_INTEGER_PART
static val ARG_INTEGER_PART: String
Argument used to specify the integer part of a decimal or fraction. The value can be a string of digits of any size optionally prefixed with a - or +. Can be used with TYPE_DECIMAL
and TYPE_FRACTION
.
Value: "android.arg.integer_part"
ARG_MINUTES
static val ARG_MINUTES: String
Argument used to specify the minutes of a time. The minutes should be provided as an integer in the range from 0 up to and including 59. Can be used with TYPE_TIME
.
Value: "android.arg.minutes"
ARG_MONTH
static val ARG_MONTH: String
Argument used to specify the month of a date. The value should be provided as an integer and can be any of MONTH_JANUARY
, MONTH_FEBRUARY
, MONTH_MARCH
, MONTH_APRIL
, MONTH_MAY
, MONTH_JUNE
, MONTH_JULY
, MONTH_AUGUST
, MONTH_SEPTEMBER
, MONTH_OCTOBER
, MONTH_NOVEMBER
and MONTH_DECEMBER
. Can be used with TYPE_DATE
.
Value: "android.arg.month"
ARG_MULTIPLICITY
static val ARG_MULTIPLICITY: String
String argument supplying multiplicity information. Can be any of MULTIPLICITY_SINGLE
, MULTIPLICITY_DUAL
and MULTIPLICITY_PLURAL
Value: "android.arg.multiplicity"
ARG_NUMBER
static val ARG_NUMBER: String
Argument used to specify a whole number. The value can be a string of digits of any size optionally prefixed with a - or +. Can be used with TYPE_CARDINAL
and TYPE_ORDINAL
.
Value: "android.arg.number"
ARG_NUMBER_PARTS
static val ARG_NUMBER_PARTS: String
Argument used to specify the main number part of a telephone number. Can be a string of digits where the different parts of the telephone number can be separated with a space, '-', '/' or '.'. Can be used with TYPE_TELEPHONE
.
Value: "android.arg.number_parts"
ARG_NUMERATOR
static val ARG_NUMERATOR: String
Argument used to specify the numerator of a fraction. The value can be a string of digits of any size optionally prefixed with a - or +. Can be used with TYPE_FRACTION
.
Value: "android.arg.numerator"
ARG_PASSWORD
static val ARG_PASSWORD: String
Argument used to specify the password part of a URI. Should be set as a string. Can be used with TYPE_ELECTRONIC
.
Value: "android.arg.password"
ARG_PATH
static val ARG_PATH: String
Argument used to specify the path part of a URI. For example "source/index.html". Can be used with TYPE_ELECTRONIC
.
Value: "android.arg.path"
ARG_PORT
static val ARG_PORT: String
Argument used to specify the port number of a URI. Should be specified as an integer. Can be used with TYPE_ELECTRONIC
.
Value: "android.arg.port"
ARG_PROTOCOL
static val ARG_PROTOCOL: String
Argument used to specify the protocol of a URI. Examples are "http" and "ftp". Can be used with TYPE_ELECTRONIC
.
Value: "android.arg.protocol"
ARG_QUANTITY
static val ARG_QUANTITY: String
Argument used to choose the suffix (thousand, million, etc) that is used to pronounce large amounts of money. For example it can be used to disambiguate between "two thousand five hundred dollars" and "two point five thousand dollars". If implemented, engines should support at least "1000", "1000000", "1000000000" and "1000000000000". Example: if the ARG_INTEGER_PART
argument is "10", the ARG_FRACTIONAL_PART
argument is "4", the ARG_QUANTITY
argument is "1000" and the ARG_CURRENCY
argument is "usd", the TTS engine may pronounce the span as "ten point four thousand dollars". With the same example but with the quantity set as "1000000" the TTS engine may pronounce the span as "ten point four million dollars". Can be used with TYPE_MONEY
.
Value: "android.arg.quantity"
ARG_QUERY_STRING
static val ARG_QUERY_STRING: String
Argument used to specify the query string of a URI. For example "arg=value&argtwo=value". Can be used with TYPE_ELECTRONIC
.
Value: "android.arg.query_string"
ARG_TEXT
static val ARG_TEXT: String
String supplying the text to be synthesized. The synthesizer is free to decide how to interpret the text. Can be used with TYPE_TEXT
.
Value: "android.arg.text"
ARG_UNIT
static val ARG_UNIT: String
Argument used to specify the unit of a measure. The unit should always be specified in English singular form. Prefixes may be used. Engines will do their best to pronounce them correctly in the language used. Engines are expected to at least support the most common ones like "meter", "second", "degree celsius" and "degree fahrenheit" with some common prefixes like "milli" and "kilo". Can be used with TYPE_MEASURE
.
Value: "android.arg.unit"
ARG_USERNAME
static val ARG_USERNAME: String
Argument used to specify the username part of a URI. Should be set as a string. Can be used with TYPE_ELECTRONIC
.
Value: "android.arg.username"
ARG_VERBATIM
static val ARG_VERBATIM: String
Argument used to specify a string where the characters are read verbatim, except whitespace. Can be used with TYPE_VERBATIM
.
Value: "android.arg.verbatim"
ARG_WEEKDAY
static val ARG_WEEKDAY: String
Argument used to specify the weekday of a date. The value should be provided as an integer and can be any of WEEKDAY_SUNDAY
, WEEKDAY_MONDAY
, WEEKDAY_TUESDAY
, WEEKDAY_WEDNESDAY
, WEEKDAY_THURSDAY
, WEEKDAY_FRIDAY
and WEEKDAY_SATURDAY
. Can be used with TYPE_DATE
.
Value: "android.arg.weekday"
ARG_YEAR
static val ARG_YEAR: String
Argument used to specify the year of a date. The value should be provided as a positive integer. Can be used with TYPE_DATE
.
Value: "android.arg.year"
CASE_ACCUSATIVE
static val CASE_ACCUSATIVE: String
Value: "android.accusative"
CASE_INSTRUMENTAL
static val CASE_INSTRUMENTAL: String
Value: "android.instrumental"
CASE_NOMINATIVE
static val CASE_NOMINATIVE: String
Value: "android.nominative"
MULTIPLICITY_PLURAL
static val MULTIPLICITY_PLURAL: String
Value: "android.plural"
MULTIPLICITY_SINGLE
static val MULTIPLICITY_SINGLE: String
Value: "android.single"
TYPE_CARDINAL
static val TYPE_CARDINAL: String
The text associated with this span is a cardinal. Must include the number to be synthesized with ARG_NUMBER
. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.cardinal"
TYPE_DATE
static val TYPE_DATE: String
The text associated with this span is a date. At least one of the arguments ARG_MONTH
and ARG_YEAR
has to be provided. The argument ARG_DAY
is optional if ARG_MONTH
is set. The argument ARG_WEEKDAY
is optional if ARG_DAY
is set. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.date"
TYPE_DECIMAL
static val TYPE_DECIMAL: String
The text associated with this span is a decimal number. Must include the number to be synthesized with ARG_INTEGER_PART
and ARG_FRACTIONAL_PART
. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.decimal"
TYPE_DIGITS
static val TYPE_DIGITS: String
The text associated with this span is a series of digits that have to be read sequentially. The digits can be set with ARG_DIGITS
. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.digits"
TYPE_ELECTRONIC
static val TYPE_ELECTRONIC: String
The text associated with this span is a URI (can be used for URLs and email addresses). The full schema for URLs, which email addresses can effectively be seen as a subset of, is: protocol://username:password@domain:port/path?query_string#fragment_id Hence populating just username and domain will read as an email address. All arguments are optional, but at least one has to be provided: ARG_PROTOCOL
, ARG_USERNAME
, ARG_PASSWORD
, ARG_DOMAIN
, ARG_PORT
, ARG_PATH
, ARG_QUERY_STRING
and ARG_FRAGMENT_ID
. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.electronic"
TYPE_FRACTION
static val TYPE_FRACTION: String
The text associated with this span is a fractional number. Must include the number to be synthesized with ARG_NUMERATOR
and ARG_DENOMINATOR
. ARG_INTEGER_PART
is optional Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.fraction"
TYPE_MEASURE
static val TYPE_MEASURE: String
The text associated with this span is a measure, consisting of a number and a unit. The number can be a cardinal, decimal or a fraction. Set the number with the same arguments as TYPE_CARDINAL
, TYPE_DECIMAL
or TYPE_FRACTION
. The unit can be specified with ARG_UNIT
. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.measure"
TYPE_MONEY
static val TYPE_MONEY: String
The text associated with this span is an amount of money. Set the amount with the same arguments as TYPE_DECIMAL
. ARG_CURRENCY
is used to set the currency. ARG_QUANTITY
is optional. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.money"
TYPE_ORDINAL
static val TYPE_ORDINAL: String
The text associated with this span is an ordinal. Must include the number to be synthesized with ARG_NUMBER
. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.ordinal"
TYPE_TELEPHONE
static val TYPE_TELEPHONE: String
The text associated with this span is a telephone number. The argument ARG_NUMBER_PARTS
is required. ARG_COUNTRY_CODE
and ARG_EXTENSION
are optional. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.telephone"
TYPE_TEXT
static val TYPE_TEXT: String
This span type can be used to add morphosyntactic features to the text it spans over, or synthesize a something else than the spanned text. Use the argument ARG_TEXT
to set a different text. Accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.text"
TYPE_TIME
static val TYPE_TIME: String
The text associated with this span is a time, consisting of a number of hours and minutes, specified with ARG_HOURS
and ARG_MINUTES
. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.time"
TYPE_VERBATIM
static val TYPE_VERBATIM: String
The text associated with this span is a series of characters that have to be read verbatim. The engine will attempt to read out any character like punctuation but excluding whitespace. ARG_VERBATIM
is required. Also accepts the arguments ARG_GENDER
, ARG_ANIMACY
, ARG_MULTIPLICITY
and ARG_CASE
.
Value: "android.type.verbatim"
Public constructors
Public methods
describeContents
open fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getArgs
open fun getArgs(): PersistableBundle!
Returns a bundle of the arguments set.
Return | |
---|---|
PersistableBundle! |
The bundle of the arguments set. |
getType
open fun getType(): String!
Returns the type.
Return | |
---|---|
String! |
The type of this instance. |
writeToParcel
open fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Parameters | |
---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |