summaryrefslogtreecommitdiffstats
path: root/comm/mail/components/extensions/schemas/mailTabs.json
blob: 6346d614be8d21654b71ad89cd80cae5112e4602 (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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
[
  {
    "namespace": "mailTabs",
    "types": [
      {
        "id": "MailTab",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "windowId": {
            "type": "integer"
          },
          "active": {
            "type": "boolean"
          },
          "sortType": {
            "type": "string",
            "description": "**Note:** ``sortType`` and ``sortOrder`` depend on each other, so both should be present, or neither.",
            "optional": true,
            "enum": [
              "none",
              "date",
              "subject",
              "author",
              "id",
              "thread",
              "priority",
              "status",
              "size",
              "flagged",
              "unread",
              "recipient",
              "location",
              "tags",
              "junkStatus",
              "attachments",
              "account",
              "custom",
              "received",
              "correspondent"
            ]
          },
          "sortOrder": {
            "type": "string",
            "description": "**Note:** ``sortType`` and ``sortOrder`` depend on each other, so both should be present, or neither.",
            "optional": true,
            "enum": ["none", "ascending", "descending"]
          },
          "viewType": {
            "type": "string",
            "optional": true,
            "enum": ["ungrouped", "groupedByThread", "groupedBySortType"]
          },
          "layout": {
            "type": "string",
            "enum": ["standard", "wide", "vertical"]
          },
          "folderPaneVisible": {
            "type": "boolean",
            "optional": true
          },
          "messagePaneVisible": {
            "type": "boolean",
            "optional": true
          },
          "displayedFolder": {
            "$ref": "folders.MailFolder",
            "optional": true,
            "description": "The <permission>accountsRead</permission> permission is required for this property to be included."
          }
        }
      },
      {
        "id": "QuickFilterTextDetail",
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "String to match against the ``recipients``, ``author``, ``subject``, or ``body``."
          },
          "recipients": {
            "type": "boolean",
            "description": "Shows messages where ``text`` matches the recipients.",
            "optional": true
          },
          "author": {
            "type": "boolean",
            "description": "Shows messages where ``text`` matches the author.",
            "optional": true
          },
          "subject": {
            "type": "boolean",
            "description": "Shows messages where ``text`` matches the subject.",
            "optional": true
          },
          "body": {
            "type": "boolean",
            "description": "Shows messages where ``text`` matches the message body.",
            "optional": true
          }
        }
      }
    ],
    "functions": [
      {
        "name": "query",
        "type": "function",
        "description": "Gets all mail tabs that have the specified properties, or all mail tabs if no properties are specified.",
        "async": "callback",
        "parameters": [
          {
            "type": "object",
            "name": "queryInfo",
            "optional": true,
            "default": {},
            "properties": {
              "active": {
                "type": "boolean",
                "optional": true,
                "description": "Whether the tabs are active in their windows."
              },
              "currentWindow": {
                "type": "boolean",
                "optional": true,
                "description": "Whether the tabs are in the current window."
              },
              "lastFocusedWindow": {
                "type": "boolean",
                "optional": true,
                "description": "Whether the tabs are in the last focused window."
              },
              "windowId": {
                "type": "integer",
                "optional": true,
                "minimum": -2,
                "description": "The ID of the parent window, or :ref:`windows.WINDOW_ID_CURRENT` for the current window."
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "type": "array",
                "items": {
                  "$ref": "MailTab"
                }
              }
            ]
          }
        ]
      },
      {
        "name": "get",
        "type": "function",
        "description": "Get the properties of a mail tab.",
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer",
            "description": "ID of the requested mail tab. Throws if the requested tab is not a mail tab."
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "MailTab"
              }
            ]
          }
        ]
      },
      {
        "name": "getCurrent",
        "type": "function",
        "description": "Get the properties of the active mail tab, if the active tab is a mail tab. Returns undefined otherwise.",
        "async": "callback",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "MailTab",
                "optional": true
              }
            ]
          }
        ]
      },
      {
        "name": "update",
        "type": "function",
        "description": "Modifies the properties of a mail tab. Properties that are not specified in ``updateProperties`` are not modified.",
        "async": true,
        "parameters": [
          {
            "name": "tabId",
            "type": "integer",
            "description": "Defaults to the active tab of the current window.",
            "optional": true,
            "minimum": 1
          },
          {
            "name": "updateProperties",
            "type": "object",
            "properties": {
              "displayedFolder": {
                "$ref": "folders.MailFolder",
                "description": "Sets the folder displayed in the tab. The extension must have the <permission>accountsRead</permission> permission to do this. The previous message selection in the given folder will be restored.",
                "optional": true
              },
              "sortType": {
                "type": "string",
                "description": "Sorts the list of messages. ``sortOrder`` must also be given.",
                "optional": true,
                "enum": [
                  "none",
                  "date",
                  "subject",
                  "author",
                  "id",
                  "thread",
                  "priority",
                  "status",
                  "size",
                  "flagged",
                  "unread",
                  "recipient",
                  "location",
                  "tags",
                  "junkStatus",
                  "attachments",
                  "account",
                  "custom",
                  "received",
                  "correspondent"
                ]
              },
              "sortOrder": {
                "type": "string",
                "description": "Sorts the list of messages. ``sortType`` must also be given.",
                "optional": true,
                "enum": ["none", "ascending", "descending"]
              },
              "viewType": {
                "type": "string",
                "optional": true,
                "enum": ["ungrouped", "groupedByThread", "groupedBySortType"]
              },
              "layout": {
                "type": "string",
                "description": "Sets the arrangement of the folder pane, message list pane, and message display pane. Note that setting this applies it to all mail tabs.",
                "optional": true,
                "enum": ["standard", "wide", "vertical"]
              },
              "folderPaneVisible": {
                "type": "boolean",
                "description": "Shows or hides the folder pane.",
                "optional": true
              },
              "messagePaneVisible": {
                "type": "boolean",
                "description": "Shows or hides the message display pane.",
                "optional": true
              }
            }
          }
        ]
      },
      {
        "name": "getSelectedMessages",
        "type": "function",
        "description": "Lists the selected messages in the current folder.",
        "permissions": ["messagesRead"],
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer",
            "description": "Defaults to the active tab of the current window.",
            "optional": true,
            "minimum": 1
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "messages.MessageList"
              }
            ]
          }
        ]
      },
      {
        "name": "setSelectedMessages",
        "type": "function",
        "description": "Selects none, one or multiple messages.",
        "permissions": ["messagesRead", "accountsRead"],
        "async": true,
        "parameters": [
          {
            "name": "tabId",
            "type": "integer",
            "description": "Defaults to the active tab of the current window.",
            "optional": true,
            "minimum": 1
          },
          {
            "name": "messageIds",
            "type": "array",
            "description": "The IDs of the messages, which should be selected. The mailTab will switch to the folder of the selected messages. Throws if they belong to different folders. Array can be empty to deselect any currently selected message.",
            "items": {
              "type": "integer"
            }
          }
        ]
      },
      {
        "name": "setQuickFilter",
        "type": "function",
        "description": "Sets the Quick Filter user interface based on the options specified.",
        "async": true,
        "parameters": [
          {
            "name": "tabId",
            "type": "integer",
            "description": "Defaults to the active tab of the current window.",
            "optional": true,
            "minimum": 1
          },
          {
            "name": "properties",
            "type": "object",
            "properties": {
              "show": {
                "type": "boolean",
                "description": "Shows or hides the Quick Filter bar.",
                "optional": true
              },
              "unread": {
                "type": "boolean",
                "description": "Shows only unread messages.",
                "optional": true
              },
              "flagged": {
                "type": "boolean",
                "description": "Shows only flagged messages.",
                "optional": true
              },
              "contact": {
                "type": "boolean",
                "description": "Shows only messages from people in the address book.",
                "optional": true
              },
              "tags": {
                "optional": true,
                "choices": [
                  {
                    "type": "boolean"
                  },
                  {
                    "$ref": "messages.TagsDetail"
                  }
                ],
                "description": "Shows only messages with tags on them."
              },
              "attachment": {
                "type": "boolean",
                "description": "Shows only messages with attachments.",
                "optional": true
              },
              "text": {
                "$ref": "QuickFilterTextDetail",
                "description": "Shows only messages matching the supplied text.",
                "optional": true
              }
            }
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onDisplayedFolderChanged",
        "type": "function",
        "description": "Fired when the displayed folder changes in any mail tab.",
        "permissions": ["accountsRead"],
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "displayedFolder",
            "$ref": "folders.MailFolder"
          }
        ]
      },
      {
        "name": "onSelectedMessagesChanged",
        "type": "function",
        "description": "Fired when the selected messages change in any mail tab.",
        "permissions": ["messagesRead"],
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "selectedMessages",
            "$ref": "messages.MessageList"
          }
        ]
      }
    ]
  }
]