Skip to content

Commit

Permalink
MailAccount, MailIdentity and OnShownData (bug 1625746)
Browse files Browse the repository at this point in the history
  • Loading branch information
jobisoft committed Mar 4, 2021
1 parent f70ca54 commit cba3382
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 157 deletions.
227 changes: 125 additions & 102 deletions menus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -426,109 +426,9 @@ Fired when a menu is shown. The extension can add, modify or remove menu items a

.. api-member::
:name: ``info``
:type: (object)

Information about the context of the menu action and the created menu items. For more information about each property, see :ref:`menus.OnClickData`.

Some properties are only included if the extension has host permission for the given context, for example :permission:`activeTab` for content tabs, :permission:`compose` for compose tabs and :permission:`messagesRead` for message display tabs.

.. api-member::
:name: ``contexts``
:type: (array of :ref:`menus.ContextType`)

A list of all contexts that apply to the menu.


.. api-member::
:name: ``editable``
:type: (boolean)


.. api-member::
:name: ``menuIds``
:type: (array of None)

A list of IDs of the menu items that were shown.


.. api-member::
:name: [``attachments``]
:type: (array of :ref:`compose.ComposeAttachment`)
:annotation: -- [Added in TB 83]

The selected attachments of a message being composed. The :permission:`compose` permission is required.


.. api-member::
:name: [``frameUrl``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``linkText``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``linkUrl``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``mediaType``]
:type: (string)


.. api-member::
:name: [``pageUrl``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``selectedFolder``]
:type: (:ref:`folders.MailFolder`)

The selected folder, if the context menu was opened in the folder pane. The :permission:`accountsRead` permission is required.


.. api-member::
:name: [``selectedMessages``]
:type: (:ref:`messages.MessageList`)

The selected messages, if the context menu was opened in the message list. The :permission:`messagesRead` permission is required.


.. api-member::
:name: [``selectionText``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``srcUrl``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``targetElementId``]
:type: (integer)


.. api-member::
:name: [``viewType``]
:type: (`ViewType <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/extension/ViewType>`_)
:type: (:ref:`menus.OnShowData`)

Information about the context of the menu action and the created menu items.


.. api-member::
Expand Down Expand Up @@ -793,6 +693,13 @@ Information sent when a context menu item is clicked.
The parent ID, if any, for the item clicked.


.. api-member::
:name: [``selectedAccount``]
:type: (:ref:`accounts.MailAccount`)

The selected account, if the context menu was opened on an account entry in the folder pane. The :permission:`accountsRead` permission is required.


.. api-member::
:name: [``selectedFolder``]
:type: (:ref:`folders.MailFolder`)
Expand Down Expand Up @@ -842,6 +749,122 @@ Information sent when a context menu item is clicked.
A flag indicating the state of a checkbox or radio item before it was clicked.


.. _menus.OnShowData:

OnShowData
----------

.. api-section-annotation-hack::

Information sent when a context menu is being shown. For more information about each property, see :ref:`menus.OnClickData`.

Some properties are only included if the extension has host permission for the given context, for example :permission:`activeTab` for content tabs, :permission:`compose` for compose tabs and :permission:`messagesRead` for message display tabs.

.. api-header::
:label: object


.. api-member::
:name: ``contexts``
:type: (array of :ref:`menus.ContextType`)

A list of all contexts that apply to the menu.


.. api-member::
:name: ``editable``
:type: (boolean)


.. api-member::
:name: ``menuIds``
:type: (array of None)

A list of IDs of the menu items that were shown.


.. api-member::
:name: [``attachments``]
:type: (array of :ref:`compose.ComposeAttachment`)


.. api-member::
:name: [``displayedFolder``]
:type: (:ref:`folders.MailFolder`)


.. api-member::
:name: [``frameUrl``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``linkText``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``linkUrl``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``mediaType``]
:type: (string)


.. api-member::
:name: [``pageUrl``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``selectedAccount``]
:type: (:ref:`accounts.MailAccount`)


.. api-member::
:name: [``selectedFolder``]
:type: (:ref:`folders.MailFolder`)


.. api-member::
:name: [``selectedMessages``]
:type: (:ref:`messages.MessageList`)


.. api-member::
:name: [``selectionText``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``srcUrl``]
:type: (string)

Host permission is required.


.. api-member::
:name: [``targetElementId``]
:type: (integer)


.. api-member::
:name: [``viewType``]
:type: (`ViewType <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/extension/ViewType>`_)


.. rst-class:: api-main-section

Properties
Expand Down
56 changes: 1 addition & 55 deletions overlay/accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,8 @@
"id": "MailAccount",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "A unique identifier for this account."
},
"name": {
"type": "string",
"description": "The human-friendly name of this account."
},
"type": {
"type": "string",
"description": "What sort of account this is, e.g. ``imap``, ``nntp``, or ``pop3``."
},
"folders": {
"type": "array",
"description": "The folders for this account.",
"items": {
"$ref": "folders.MailFolder"
}
},
"identities": {
"type": "array",
"description": "The identities associated with this account. The default identity is listed first, others in no particular order.",
"added": "76",
"items": {
"$ref": "accounts.MailIdentity"
}
"added": "76"
}
}
},
Expand All @@ -40,37 +16,7 @@
"type": "object",
"added": "76",
"properties": {
"accountId": {
"type": "string",
"description": "The id of the :ref:`accounts.MailAccount` this identity belongs to."
},
"id": {
"type": "string",
"description": "A unique identifier for this identity."
},
"label": {
"type": "string",
"description": "A user-defined label for this identity."
},
"name": {
"type": "string",
"description": "The user's name as used when messages are sent from this identity."
},
"email": {
"type": "string",
"description": "The user's email address as used when messages are sent from this identity."
},
"replyTo": {
"type": "string",
"description": "The reply-to email address associated with this identity."
},
"organization": {
"type": "string",
"description": "The organization associated with this identity."
},
"composeHtml": {
"type": "boolean",
"description": "Wether the identity uses HTML as the default compose format.",
"added": "85",
"backported": "78.7.0"
}
Expand Down

0 comments on commit cba3382

Please sign in to comment.