Struct google_mirror1::MenuItem[][src]

pub struct MenuItem {
    pub contextual_command: Option<String>,
    pub values: Option<Vec<MenuValue>>,
    pub remove_when_selected: Option<bool>,
    pub action: Option<String>,
    pub payload: Option<String>,
    pub id: Option<String>,
}

A custom menu item that can be presented to the user by a timeline item.

This type is not used in any activity, and only used as part of another schema.

Fields

The ContextualMenus.Command associated with this MenuItem (e.g. READ_ALOUD). The voice label for this command will be displayed in the voice menu and the touch label will be displayed in the touch menu. Note that the default menu value's display name will be overriden if you specify this property. Values that do not correspond to a ContextualMenus.Command name will be ignored.

For CUSTOM items, a list of values controlling the appearance of the menu item in each of its states. A value for the DEFAULT state must be provided. If the PENDING or CONFIRMED states are missing, they will not be shown.

If set to true on a CUSTOM menu item, that item will be removed from the menu after it is selected.

Controls the behavior when the user picks the menu option. Allowed values are:

  • CUSTOM - Custom action set by the service. When the user selects this menuItem, the API triggers a notification to your callbackUrl with the userActions.type set to CUSTOM and the userActions.payload set to the ID of this menu item. This is the default value.
  • Built-in actions:
  • REPLY - Initiate a reply to the timeline item using the voice recording UI. The creator attribute must be set in the timeline item for this menu to be available.
  • REPLY_ALL - Same behavior as REPLY. The original timeline item's recipients will be added to the reply item.
  • DELETE - Delete the timeline item.
  • SHARE - Share the timeline item with the available contacts.
  • READ_ALOUD - Read the timeline item's speakableText aloud; if this field is not set, read the text field; if none of those fields are set, this menu item is ignored.
  • GET_MEDIA_INPUT - Allow users to provide media payloads to Glassware from a menu item (currently, only transcribed text from voice input is supported). Subscribe to notifications when users invoke this menu item to receive the timeline item ID. Retrieve the media from the timeline item in the payload property.
  • VOICE_CALL - Initiate a phone call using the timeline item's creator.phoneNumber attribute as recipient.
  • NAVIGATE - Navigate to the timeline item's location.
  • TOGGLE_PINNED - Toggle the isPinned state of the timeline item.
  • OPEN_URI - Open the payload of the menu item in the browser.
  • PLAY_VIDEO - Open the payload of the menu item in the Glass video player.
  • SEND_MESSAGE - Initiate sending a message to the timeline item's creator:
  • If the creator.phoneNumber is set and Glass is connected to an Android phone, the message is an SMS.
  • Otherwise, if the creator.email is set, the message is an email.

A generic payload whose meaning changes depending on this MenuItem's action.

  • When the action is OPEN_URI, the payload is the URL of the website to view.
  • When the action is PLAY_VIDEO, the payload is the streaming URL of the video
  • When the action is GET_MEDIA_INPUT, the payload is the text transcription of a user's speech input

The ID for this menu item. This is generated by the application and is treated as an opaque token.

Trait Implementations

impl Default for MenuItem
[src]

Returns the "default value" for a type. Read more

impl Clone for MenuItem
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for MenuItem
[src]

Formats the value using the given formatter. Read more

impl Part for MenuItem
[src]

Auto Trait Implementations

impl Send for MenuItem

impl Sync for MenuItem