summaryrefslogtreecommitdiffstats
path: root/comm/mail/components/extensions/schemas/messageDisplay.json
blob: f7e3d4ae6dfcc5aad7cf8bde6e78fee618e0f133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
[
  {
    "namespace": "messageDisplay",
    "permissions": ["messagesRead"],
    "events": [
      {
        "name": "onMessageDisplayed",
        "type": "function",
        "description": "Fired when a message is displayed, whether in a 3-pane tab, a message tab, or a message window.",
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "message",
            "$ref": "messages.MessageHeader"
          }
        ]
      },
      {
        "name": "onMessagesDisplayed",
        "type": "function",
        "description": "Fired when either a single message is displayed or when multiple messages are displayed, whether in a 3-pane tab, a message tab, or a message window.",
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "messages",
            "type": "array",
            "items": {
              "$ref": "messages.MessageHeader"
            }
          }
        ]
      }
    ],
    "functions": [
      {
        "name": "getDisplayedMessage",
        "type": "function",
        "description": "Gets the currently displayed message in the specified tab (even if the tab itself is currently not visible). It returns <value>null</value> if no messages are displayed, or if multiple messages are displayed.",
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer",
            "minimum": 1
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "choices": [
                  {
                    "$ref": "messages.MessageHeader"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "name": "getDisplayedMessages",
        "type": "function",
        "description": "Gets an array of the currently displayed messages in the specified tab (even if the tab itself is currently not visible). The array is empty if no messages are displayed.",
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer",
            "minimum": 1
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "type": "array",
                "items": {
                  "$ref": "messages.MessageHeader"
                }
              }
            ]
          }
        ]
      },
      {
        "name": "open",
        "type": "function",
        "description": "Opens a message in a new tab or in a new window.",
        "async": "callback",
        "parameters": [
          {
            "name": "openProperties",
            "type": "object",
            "description": "Settings for opening the message. Exactly one of messageId, headerMessageId or file must be specified.",
            "properties": {
              "file": {
                "type": "object",
                "optional": true,
                "isInstanceOf": "File",
                "additionalProperties": true,
                "description": "The DOM file object of a message to be opened."
              },
              "messageId": {
                "type": "integer",
                "optional": true,
                "minimum": 1,
                "description": "The id of a message to be opened. Will throw an <em>ExtensionError</em>, if the provided ``messageId`` is unknown or invalid."
              },
              "headerMessageId": {
                "type": "string",
                "optional": true,
                "description": "The headerMessageId of a message to be opened. Will throw an <em>ExtensionError</em>, if the provided ``headerMessageId`` is unknown or invalid. Not supported for external messages."
              },
              "location": {
                "type": "string",
                "enum": ["tab", "window"],
                "optional": true,
                "description": "Where to open the message. If not specified, the users preference is honoured."
              },
              "active": {
                "type": "boolean",
                "optional": true,
                "description": "Whether the new tab should become the active tab in the window. Only applicable to messages opened in tabs."
              },
              "windowId": {
                "type": "integer",
                "minimum": -2,
                "optional": true,
                "description": "The id of the window, where the new tab should be created. Defaults to the current window. Only applicable to messages opened in tabs."
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "name": "tab",
                "$ref": "tabs.Tab"
              }
            ]
          }
        ]
      }
    ]
  }
]