<?xml version="1.0"?>
<!-- ***** 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 Sun Microsystems code.
   -
   - The Initial Developer of the Original Code is Sun Microsystems.
   - Portions created by the Initial Developer are Copyright (C) 2006
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -   Michael Buettner <michael.buettner@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 ***** -->

<?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/skin/calendar-alarms.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/skin/calendar-event-dialog.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/skin/calendar-event-dialog-reminder.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/content/datetimepickers/datetimepickers.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/content/calendar-bindings.css"?>

<!DOCTYPE dialog SYSTEM "chrome://calendar/locale/dialogs/calendar-event-dialog-reminder.dtd" >

<dialog id="calendar-event-dialog-reminder"
        title="&reminderdialog.title;"
        windowtype="Calendar:EventDialog:Reminder"
        onload="onLoad()"
        ondialogaccept="return onAccept();"
        ondialogcancel="return onCancel();"
        persist="screenX screenY width height"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Javascript includes -->
  <script type="application/javascript" src="chrome://calendar/content/calendar-event-dialog-reminder.js"/>
  <script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js"/>
  <script type="application/javascript" src="chrome://calendar/content/calUtils.js"/>

  <notificationbox id="reminder-notifications"/>

  <!-- Listbox with custom reminders -->
  <vbox flex="1">
    <listbox id="reminder-listbox"
             seltype="single"
             class="event-dialog-listbox"
             onselect="onReminderSelected()"
             flex="1"/>
    <hbox id="reminder-action-buttons-box" pack="end">
      <button id="reminder-new-button"
              label="&reminder.add.label;"
              accesskey="&reminder.add.accesskey;"
              oncommand="onNewReminder()"/>
      <button id="reminder-remove-button"
              label="&reminder.remove.label;"
              accesskey="&reminder.remove.accesskey;"
              oncommand="onRemoveReminder()"/>
    </hbox>
  </vbox>

  <!-- Custom reminder details -->
  <calendar-caption id="reminder-details-caption" label="&reminder.reminderDetails.label;"/>
  <radiogroup id="reminder-relation-radiogroup"
                onselect="setupRadioEnabledState(); updateReminder(event)">
    <hbox id="reminder-relative-box" align="top" flex="1">
      <radio id="reminder-relative-radio"
             value="relative"
             aria-labeledby="reminder-length reminder-unit reminder-relation reminder-origin"/>
      <vbox id="reminder-relative-box" flex="1">
        <hbox id="reminder-relative-length-unit-relation" flex="1">
          <textbox id="reminder-length"
                   type="number"
                   size="1"
                   min="0"
                   onkeyup="updateReminder(event)"/>
          <menulist id="reminder-unit" oncommand="updateReminder(event)" flex="1">
            <menupopup id="reminder-unit-menupopup">
              <menuitem id="reminder-minutes-menuitem"
                        label="&alarm.units.minutes;"
                        value="minutes"/>
              <menuitem id="reminder-hours-menuitem"
                        label="&alarm.units.hours;"
                        value="hours"/>
              <menuitem id="reminder-days-menuitem"
                        label="&alarm.units.days;"
                        value="days"/>
            </menupopup>
          </menulist>
        </hbox>
        <menulist id="reminder-relation-origin" oncommand="updateReminder(event)">
          <menupopup id="reminder-relation-origin-menupopup">
            <!-- The labels here will be set in calendar-event-dialog-reminder.js -->
            <menuitem id="reminder-before-start-menuitem"
                      value="before-START"/>
            <menuitem id="reminder-after-start-menuitem"
                      value="after-START"/>
            <menuitem id="reminder-before-end-menuitem"
                      value="before-END"/>
            <menuitem id="reminder-after-end-menuitem"
                      value="after-END"/>
          </menupopup>
        </menulist>
      </vbox>
    </hbox>
    <hbox id="reminder-absolute-box" flex="1">
      <radio id="reminder-absolute-radio"
             control="reminder-absolute-date"
             value="absolute"/>
      <datetimepicker id="reminder-absolute-date"/>
    </hbox>
  </radiogroup>

  <!-- Custom reminder action -->
  <calendar-caption id="reminder-actions-caption"
                    control="reminder-actions-menulist"
                    label="&reminder.action.label;"/>
  <menulist id="reminder-actions-menulist"
            oncommand="updateReminder(event)"
            class="reminder-icon">
    <!-- Make sure the id is formatted "reminder-action-<VALUE>", for accessibility -->
    <!-- TODO provider specific -->
    <menupopup id="reminder-actions-menupopup">
      <menuitem id="reminder-action-DISPLAY"
                class="reminder-icon menuitem-iconic"
                value="DISPLAY"
                label="&reminder.action.alert.label;"/>
      <menuitem id="reminder-action-EMAIL"
                class="reminder-icon menuitem-iconic"
                value="EMAIL"
                label="&reminder.action.email.label;"/>
    </menupopup>
  </menulist>
</dialog>
