/* 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 nsIUTF8StringEnumerator;
interface calITimezone;

[scriptable, uuid(0E502BF5-4FD3-4090-9122-F1EC3CA701BB)]
interface calITimezoneProvider : nsISupports
{
    readonly attribute nsIUTF8StringEnumerator timezoneIds;

    /**
     * Gets a timezone defintion passing a TZID.
     * Returns null in case of an unknown TZID.
     *
     * @param tzid       a TZID to be resolved
     * @return           a timezone object or null
     */
    calITimezone getTimezone(in AUTF8String tzid);
};

/**
 * This service acts as a central access point for the up to date set
 * of Olson timezone definitions.
 */
[scriptable, uuid(AB1BFE6A-EE95-4038-B594-34AEEDA9911A)]
interface calITimezoneService : calITimezoneProvider
{
    readonly attribute calITimezone floating;
    readonly attribute calITimezone UTC;

    /**
     * Provides the version of the underlying timezone database.
     */
    readonly attribute AString version;

    /**
     * Returns the default timezone from calendar.timezone.local. If no timezone
     * has been set, a best guess is taken from the operating system and the
     * timezone is saved into the above mentioned pref.
     */
    readonly attribute calITimezone defaultTimezone;
};
