summaryrefslogtreecommitdiffstats
path: root/comm/calendar/base/public/calIDuration.idl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--comm/calendar/base/public/calIDuration.idl104
1 files changed, 104 insertions, 0 deletions
diff --git a/comm/calendar/base/public/calIDuration.idl b/comm/calendar/base/public/calIDuration.idl
new file mode 100644
index 0000000000..a6bb00ed79
--- /dev/null
+++ b/comm/calendar/base/public/calIDuration.idl
@@ -0,0 +1,104 @@
+/* -*- 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"
+
+[scriptable, uuid(78537f21-fd5c-4e02-ab26-8ff6a3d946cb)]
+interface calIDuration : nsISupports
+{
+ /**
+ * isMutable is true if this instance is modifiable.
+ * If isMutable is false, any attempts to modify
+ * the object will throw CAL_ERROR_ITEM_IS_MUTABLE.
+ */
+ readonly attribute boolean isMutable;
+
+ /**
+ * Make this calIDuration instance immutable.
+ */
+ void makeImmutable();
+
+ /**
+ * Clone this calIDuration instance into a new
+ * mutable object.
+ */
+ calIDuration clone();
+
+ /**
+ * Is Negative
+ */
+ attribute boolean isNegative;
+
+ /**
+ * Weeks
+ */
+ attribute short weeks;
+
+ /**
+ * Days
+ */
+ attribute short days;
+
+ /**
+ * Hours
+ */
+ attribute short hours;
+
+ /**
+ * Minutes
+ */
+ attribute short minutes;
+
+ /**
+ * Seconds
+ */
+ attribute short seconds;
+
+ /**
+ * total duration in seconds
+ */
+ attribute long inSeconds;
+
+ /*
+ * Methods
+ */
+
+ /**
+ * Add a duration
+ */
+ void addDuration(in calIDuration aDuration);
+
+ /**
+ * Compare with another duration
+ *
+ * @param aOther to be compared with this object
+ *
+ * @return -1, 0, 1 if this < aOther, this == aOther, or this > aOther,
+ * respectively.
+ */
+ long compare(in calIDuration aOther);
+
+ /**
+ * Reset this duration to 0
+ */
+ void reset();
+
+ /**
+ * Normalize the duration
+ */
+ void normalize();
+
+ /**
+ * Return a string representation of this instance.
+ */
+ AUTF8String toString();
+
+ attribute jsval icalDuration;
+
+ /**
+ * This object as an iCalendar DURATION string
+ */
+ attribute ACString icalString;
+};