1/* -*- Mode: idl; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6#include "nsISupports.idl"
7
8interface calIItemBase;
9interface calICalendar;
10
11/**
12 * calIItipItem is an interface used to carry information between the mime
13 * parser, the imip-bar UI, and the iTIP processor. It encapsulates a list of
14 * calIItemBase objects and provides specialized iTIP methods for those items.
15 */
16[scriptable, uuid(7539c158-c30d-41d0-90e9-41d315ac3eb1)]
17interface calIItipItem : nsISupports
18{
19    /**
20     * Initializes the item with an ics string
21     * @param - in parameter - AString of ical Data
22     */
23    void init(in  AUTF8String icalData);
24
25    /**
26     * Creates a new calItipItem with the same attributes as the one that
27     * clone() is called upon.
28     */
29    calIItipItem clone();
30
31    /**
32     * Attribute: isSend - set to TRUE when sending this item to initiate an
33     * iMIP communication. This will be used by the iTIP processor to route
34     * the item directly to the email subsystem so that communication can be
35     * initiated. For example, if you are Sending a REQUEST, you would set
36     * this flag, and send the iTIP Item into the iTIP processor, which would
37     * handle everything else.
38     */
39    attribute boolean isSend;
40
41    /**
42     * Attribute: sender - set to the email address of the sender if part of an
43     * iMIP communication.
44     */
45    attribute AUTF8String sender;
46
47    /**
48     * Attribute: receivedMethod - method the iTIP item had upon receipt
49     */
50    attribute AUTF8String receivedMethod;
51
52    /**
53     * Attribute: responseMethod - method that the protocol handler (or the
54     * user) decides to use to respond to the iTIP item (could be COUNTER,
55     * REPLY, DECLINECOUNTER, etc)
56     */
57    attribute AUTF8String responseMethod;
58
59    /**
60     * Attribute: autoResponse Set to one of the three constants below
61     */
62    attribute unsigned long autoResponse;
63
64    /**
65     * Used to tell the iTIP processor to use an automatic response when
66     * handling this iTIP item
67     */
68    const unsigned long AUTO = 0;
69
70    /**
71     * Used to tell the iTIP processor to allow the user to edit the response
72     */
73    const unsigned long USER = 1;
74
75    /**
76     * Used to tell the iTIP processor not to respond at all.
77     */
78    const unsigned long NONE = 2;
79
80    /**
81     * Attribute: targetCalendar - the calendar that this thing should be
82     * stored in, if it should be stored onto a calendar.
83     */
84    attribute calICalendar targetCalendar;
85
86    /**
87     * The identity this item was received on. Helps to determine which
88     * attendee to manipulate. This should be the full email address of the
89     * attendee that is considered to be the local user.
90     */
91    attribute AUTF8String identity;
92
93    /**
94     * localStatus: The response that the user has made to the invitation in
95     *              this ItipItem.
96     */
97    attribute AUTF8String localStatus;
98
99    /**
100     * Get the list of items that are encapsulated in this calIItipItem
101     * @returns An array of calIItemBase items that are inside this
102     *          calIItipItem
103     */
104    Array<calIItemBase> getItemList();
105
106    /**
107     * Modifies the state of the given attendee in the item's ics
108     * @param attendeeId - AString containing attendee address
109     * @param status - AString containing the new attendee status
110     */
111    void setAttendeeStatus(in AString attendeeId, in AString status);
112};
113