widget/nsIDatePicker.idl
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 20 Feb 2017 14:22:21 +0900
changeset 343841 b10f3f8d8d7776b38308825738db5f6a4b10fc54
parent 302208 14ac8b409bcd40985ef2abe2ee63ad3b08ab7c69
permissions -rw-r--r--
Bug 1225696 - Part 2. Use DateTimeFormat instead of dateFormat.properties. r=mak MozReview-Commit-ID: 9ufUVeppwHk

/* -*- Mode: C++; 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 mozIDOMWindowProxy;

[scriptable, uuid(13388a28-1b0b-4218-a31b-588f7a4ec26c)]
interface nsIDatePickerShownCallback : nsISupports
{
 /**
  * Callback called when the user selects cancel in the date picker
  * This callback can not be called after done() is called.
  */
 void cancel();

 /**
  * Callback called when the user has finished selecting the date
  *
  * @param  date  The new selected date value following the format "YYYY-MM-DD"
  */
  void done(in AString date);
};

[scriptable, uuid(7becfc64-966b-4d53-87d2-9161f36bd3b3)]
interface nsIDatePicker : nsISupports
{
 /**
  * Initialize the date picker widget. The date picker will not be shown until
  * open() is called.
  * If the initialDate parameter does not follow the format "YYYY-MM-DD" then
  * the behavior will be unspecified.
  *
  * @param      parent       nsIDOMWindow parent. This dialog will be dependent
  *                          on this parent. parent may be null.
  * @param      title        The title for the date picker widget.
  * @param      initialDate  The date to show when the widget is opened. The
  *                          parameter has to follow the format "YYYY-MM-DD"
  */
  void init(in mozIDOMWindowProxy parent, in AString title, in AString initialDate);

 /**
  * Opens the date dialog asynchrounously.
  * The results are provided via the callback object.
  */
  void open(in nsIDatePickerShownCallback callback);
};