calendar/base/public/calICalendarView.idl
author Simon Paquet <bugzilla@babylonsounds.com>
Sun, 26 Sep 2010 22:43:39 +0200
changeset 6430 a7262e7a2fff00a3fc5b7e4f5c7b5a2f12c4788f
parent 3288 2ea9a2b2888672608f434f135123b77d7fc10a5f
child 11987 ef3ee6f165dec8a123f5d02cf02ad48fac5357a5
permissions -rw-r--r--
Bug 599586 - Add Serbian as a supported locale for Lightning

/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is calendar views.
 *
 * The Initial Developer of the Original Code is
 *   Oracle Corporation
 * Portions created by the Initial Developer are Copyright (C) 2005
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Vladimir Vukicevic <vladimir.vukicevic@oracle.com>
 *   Dan Mosedale <dan.mosedale@oracle.com>
 *   Berend Cornelius <berend.cornelius@sun.com>
 *   Philipp Kewisch <mozilla@kewis.ch>
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */


#include "nsISupports.idl"

interface calICalendar;
interface calIDateTime;
interface calICalendarViewController;
interface calIItemBase;

/**
 * An interface for view widgets containing calendaring data.
 *
 * @note Code that implements this interface is intended to be pure
 * widgetry and thus not have any preference dependencies.
 */

[scriptable, uuid(0e392744-4b2e-4b64-8862-2fb707d900a7)]
interface calICalendarView : nsISupports
{

  /**
   * Oftentimes other elements in the DOM in which a calIDecoratedView is
   * used want to be aware of whether or not the view is selected.  An element
   * whose ID is observerID can be included in that DOM, and will be set to be
   * enabled or disabled depending on whether the view is selected.
   */
  readonly attribute AUTF8String observerID;

  /**
   * Generally corresponds to whether or not the view has been previously shown.
   * Strictly speaking, it reports whether displayCalendar, startDay and endDay
   * are all non-null.
   */
  readonly attribute boolean initialized;

  /**
   * the calendar that this view is displaying
   */
  attribute calICalendar displayCalendar;

  /**
   * the controller for this view
   */
  attribute calICalendarViewController controller;

  /**
   * If true, the view supports workdays only
   */
  readonly attribute boolean supportsWorkdaysOnly;

  /**
   * If this is set to 'true', the view should not display days specified to be
   * non-workdays.  The implementor is responsible for obtaining what those
   * days are on its own.
   */
  attribute boolean workdaysOnly;

  /**
   * Whether or not tasks are to be displayed in the calICalendarView
   */
  attribute boolean tasksInView;

  /**
   * If true, the view is rotatable
   */
  readonly attribute boolean supportsRotation;

  /**
   * If set, the view will be rotated (i.e time on top, date at left)
   */
  attribute boolean rotated;

  /**
   * If true, the view is zoomable
   */
  readonly attribute boolean supportsZoom;

  /**
   * Zoom view in one level. Defaults to one level.
   */
  void zoomIn([optional] in PRUint32 level);

  /**
   * Zoom view out one level. Defaults to one level.
   */
  void zoomOut([optional] in PRUint32 level);

  /**
   * Reset view zoom.
   */
  void zoomReset();

  /**
   * Whether or not completed tasks are shown in the calICalendarView
   */
  attribute boolean showCompleted;

  /**
   * Ensure that the given date is visible; the view is free
   * to show more dates than the given date (e.g. week view
   * would show the entire week).
   */
  void showDate(in calIDateTime aDate);

  /**
   * Set a date range for the view to display, from aStartDate
   * to aEndDate, inclusive.
   *
   * Some views may decide to utilize the time portion of these
   * calIDateTimes; pass in calIDateTimes that are dates if you
   * want to make sure this doesn't happen.
   */
  void setDateRange(in calIDateTime aStartDate, in calIDateTime aEndDate);

  /**
   * The start date of the view's display.  If the view is displaying
   * disjoint dates, this will be the earliest date that's displayed.
   */
  readonly attribute calIDateTime startDate;

  /**
   * The end date of the view's display.  If the view is displaying
   * disjoint dates, this will be the latest date that's displayed.
   *
   * Note that this won't be equivalent to the aEndDate passed to
   * setDateRange, because that date isn't actually displayed!
   */
  readonly attribute calIDateTime endDate;

  /**
   * The first day shown in the embedded view
   */
  readonly attribute calIDateTime startDay;

  /**
   * The last day shown in the embedded view
   */
  readonly attribute calIDateTime endDay;

  /**
   * True if this view supports disjoint dates
   */
  readonly attribute boolean supportsDisjointDates;

  /**
   * True if this view currently has a disjoint date set.
   */
  readonly attribute boolean hasDisjointDates;

  /**
   * Set a disjoint date list for this view to show.  Throws
   * if supportsDisjointDates is false for this view.
   */
  void setDateList(in unsigned long aCount, [array,size_is(aCount)] in calIDateTime aDates);

  /**
   * Returns the list of dates being shown by this calendar.
   * If a date range is set, it will expand out the date range by
   * day and return the full set.
   */
  void getDateList(out unsigned long aCount, [array,size_is(aCount),retval] out calIDateTime aDates);

  /**
   * Get the items currently selected in this view.
   * 
   * @param aCount a variable to hold the number of items in this array
   *
   * @return the array of items currently selected in this.
   */
  void getSelectedItems(out unsigned long aCount,
                        [array,size_is(aCount),retval] out calIItemBase aItems);

   /**
    * Select an array of items in the view.  Items outside the view's current
    * display range will be ignored.
    *
    * @param aCount the number of items to select
    * @param aItems an array of items to select
    * @param aSuppressEvent if true, the 'itemselect' event will not be fired.
    */
  void setSelectedItems(in unsigned long aCount,
                        [array,size_is(aCount)] in calIItemBase aItems,
                        in boolean aSuppressEvent);

  /**
   * Make as many of the selected items as possible are visible in the view.
   */
  void centerSelectedItems();

  /**
   * Get or set the selected day.
   */
  attribute calIDateTime selectedDay;

  /**
   * Get or set the timezone that the view's elements should be displayed in.
   * Setting this does not refresh the view.
   */
  attribute AUTF8String timezone;

  /**
   * Ensures that the given date is visible, and that the view is centered
   * around this date.  aDate becomes the selectedDay of the view.  Calling
   * this function with the current selectedDay effectively refreshes the view
   *
   * @param aDate       the date that must be shown in the view and becomes
   *                    the selected day
   */
  void goToDay(in calIDateTime aDate);

  /**
   * Moves the view a specific number of pages.  Negative numbers correspond to
   * moving the view backwards.  Note that it is up to the view to determine
   * how the selected day ought to move as well.
   *
   * @param aNumber       the number of pages to move the view
   */
  void moveView(in long aNumber);

  /**
   * gets the description of the range displayed by the view
   */
  AString getRangeDescription();

  /**
   * The type of the view e.g "day", "week", "multiweek" or "month" that refers
   * to the displayed time period.
   */
  readonly attribute string type;
  /**
   * removes the dropshadows that are inserted into childelements during a
   * drag and drop session
   */

  void removeDropShadows();
};