summaryrefslogtreecommitdiffstats
path: root/comm/calendar/base/public/calICalendarViewController.idl
blob: 823a72fe34e1cbf32499518b303936fdb0b0913c (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
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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"

interface calICalendar;
interface calIDateTime;
interface calIEvent;
interface calIItemBase;

[scriptable, uuid(40430501-a666-4c24-b234-eeac5ccb70f6)]
interface calICalendarViewController : nsISupports
{
  /**
   * Create an event, with an optional start time and optional end
   * time in the given Calendar.  The Calendar will be the
   * displayCalendar set on the View which invokes this method
   * on the controller, or null, if the views wish to delegate the
   * choice of the calendar to the controller.
   *
   * If neither aStartTime or aEndTime are given, the user wants to
   * create a generic event with no information prefilled.
   *
   * If aStartTime is given and is a date, the user wants to
   * create an all day event, optionally a multi-all-day event if
   * aEndTime is given (and is also a date).
   *
   * If aStartTime is given and is a time, but no aEndTime is
   * given, the user wants to create an event starting at
   * aStartTime and of the default duration.  The controller has the
   * option of creating this event automatically or via the dialog.
   *
   * If both aStartTime and aEndTime are given as times, then
   * the user wants to create an event going from aStartTime
   * to aEndTime.
   */
  void createNewEvent (in calICalendar aCalendar,
		       in calIDateTime aStartTime,
		       in calIDateTime aEndTime);

  /**
   * View an occurrence of an event. This opens the event in a read-only
   * summary dialog.
   */
  void viewOccurrence(in calIItemBase aOccurrence);

  /**
   * Modify aOccurrence.  If aNewStartTime and aNewEndTime are given,
   * update the event to those times.  If aNewTitle is given, modify the title
   * of the item.  If no parameters are given, ask the user to modify.
   */
  void modifyOccurrence (in calIItemBase aOccurrence,
                         in calIDateTime aNewStartTime,
                         in calIDateTime aNewEndTime,
                         in AString aNewTitle);
  /**
   * Delete all events in the given array. If more than one event is passed,
   * this will prompt whether to delete just this occurrence or all occurrences.
   * All passed events will be handled in one transaction, i.e undoing this will
   * make all events reappear.
   *
   * @param aCount          The number of events in the array
   * @param aOccurrences    An array of Items/Occurrences to delete
   * @param aUseParentItems If set, each occurrence will have its parent item
   *                        deleted.
   * @param aDoNotConfirm   If set, the events will be deleted without
   *                        confirmation.
   */
  void deleteOccurrences (in Array<calIItemBase> aOccurrences,
                          in boolean aUseParentItems,
                          in boolean aDoNotConfirm);
};