summaryrefslogtreecommitdiffstats
path: root/comm/mailnews/base/public/nsIMailChannel.idl
blob: f5785e6e6548eea7d5e381a9117b2187df7973c8 (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
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"
#include "calIItipItem.idl"
#include "nsIPropertyBag2.idl"
#include "nsIMsgSMIMEHeaderSink.idl"

interface nsIMailProgressListener;
interface nsIWebProgress;
interface nsIRequest;

/**
 * An interface that email-streaming channels can use to provide access to
 * parsed message headers, message attachment info, and other metadata.
 * The intended use is by QIing nsIChannel to nsIMailChannel.
 */
[scriptable, uuid(e4abdb58-54fa-4deb-8c43-714a69519b3a)]
interface nsIMailChannel : nsISupports {
  /**
   * Called by MIME emitters to add a header to this mail channel.
   * Do not call otherwise.
   */
  void addHeaderFromMIME(in AUTF8String name, in AUTF8String value);

  /**
   * Header names for this request, available at onStopRequest.
   * The number of header names is the same as the number of header values,
   * and they are in the same order.
   */
  readonly attribute Array<AUTF8String> headerNames;

  /**
   * Header values for this request, available at onStopRequest.
   */
  readonly attribute Array<AUTF8String> headerValues;

  /**
   * Called by MIME emitters to add attachment info to this mail channel.
   * Do not call otherwise.
   */
  void handleAttachmentFromMIME(in AUTF8String contentType,
                        in AUTF8String url,
                        in AUTF8String displayName,
                        in AUTF8String uri,
                        in boolean aNotDownloaded);

  /**
   * Called by MIME emitters to add attachment info to this mail channel.
   * Do not call otherwise.
   */
  void addAttachmentFieldFromMIME(in AUTF8String field, in AUTF8String value);

  /**
   * Attachments for this request, available at onStopRequest.
   */
  readonly attribute Array<nsIPropertyBag2> attachments;

  /**
   * The character set of the message, according to the MIME parser. Not the
   * character set of the channel, which should always be UTF-8.
   */
  attribute AUTF8String mailCharacterSet;

  /**
   * The method property of iMIP attachments, as determined by the MIME parser.
   * Not to be set after onStopRequest.
   */
  attribute AUTF8String imipMethod;

  /**
   * The actual iMIP invitation, as created by CalMIMEConverter.
   * Not to be set after onStopRequest.
   */
  attribute calIItipItem imipItem;

  /**
   * Set this in onStartRequest to receive security status notifications.
   */
  attribute nsIMsgSMIMEHeaderSink smimeHeaderSink;

  /**
   * A listener for progress events. This object must also implement
   * nsISupportsWeakReference.
   */
  attribute nsIMailProgressListener listener;
};

[scriptable, uuid(1286f969-1c20-422e-8247-233fe0d26ba5)]
interface nsIMailProgressListener : nsISupports {
  /**
   * Receive a notification from the parser that it has finished outputting
   * the headers to the channel.
   */
  void onHeadersComplete(in nsIMailChannel mailChannel);

  /**
   * Receive a notification from the parser that it has finished outputting
   * the message body to the channel.
   */
  void onBodyComplete(in nsIMailChannel mailChannel);

  /**
   * Receive a notification from the parser that it has finished outputting
   * the attachment information to the channel.
   */
  void onAttachmentsComplete(in nsIMailChannel mailChannel);
};