calendar/base/public/calIPeriod.idl
author Gervase Markham <gerv@gerv.net>
Wed, 30 May 2012 17:48:24 +0100
changeset 12286 84ac3c71109811da751f0ef2d72108075938f094
parent 372 7c0bfdcda6731e77303f3c47b01736aaa93d5534
child 15514 638db6e0f8a7e299666fffd0d127c1c6fd7eb25e
permissions -rw-r--r--
Bug 757018 - upgrade license to MPL 2.

/* -*- Mode: idl; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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 calIDateTime;
interface calIDuration;

[ptr] native icalperiodtypeptr(struct icalperiodtype);

[scriptable,uuid(03cde9c7-c864-4109-8bea-ebbff01cbab9)]
interface calIPeriod : nsISupports
{
  /**
   * isMutable is true if this instance is modifiable.
   * If isMutable is false, any attempts to modify
   * the object will throw NS_ERROR_OBJECT_IS_IMMUTABLE.
   */
  readonly attribute boolean isMutable;

  /**
   * Make this calIPeriod instance immutable.
   */
  void makeImmutable();

  /**
   * Clone this calIPeriod instance into a new
   * mutable object.
   */
  calIPeriod clone();

  /**
   * The start datetime of this period
   */
  attribute calIDateTime start;

  /**
   * The end datetime of this period
   */
  attribute calIDateTime end;

  /**
   * The duration, equal to end-start
   */
  readonly attribute calIDuration duration;


  /**
   * Return a string representation of this instance.
   */
  AUTF8String toString();

  [noscript,notxpcom] void toIcalPeriod(in icalperiodtypeptr idt);

  /**
   * This object as an iCalendar DURATION string
   */
  attribute ACString icalString;
};