<?xml version="1.0"?>
<!-- -*- Mode: Java; tab-width: 2; 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/. -->

<!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % displayDTD SYSTEM "chrome://messenger/locale/preferences/display.dtd" >
%brandDTD;
%displayDTD;
]>

<overlay id="DisplayPaneOverlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <prefpane id="paneDisplay" onpaneload="gDisplayPane.init();">
    <script type="application/javascript"
            src="chrome://mozapps/content/preferences/fontbuilder.js"/>
    <script type="application/javascript"
            src="chrome://messenger/content/preferences/display.js"/>

    <preferences id="displayPreferences">
      <preference id="mail.preferences.display.selectedTabIndex" name="mail.preferences.display.selectedTabIndex" type="int"/>
      <preference id="mail.fixed_width_messages" name="mail.fixed_width_messages" type="bool"/>
      <preference id="mail.quoted_style" name="mail.quoted_style" type="int"/>
      <preference id="mail.quoted_size" name="mail.quoted_size" type="int"/>
      <preference id="mail.citation_color" name="mail.citation_color" type="string"/>
      <preference id="mail.display_glyph" name="mail.display_glyph" type="bool"/>
      <preference id="mailnews.labels.description.1" name="mailnews.labels.description.1" type="wstring"/>
      <preference id="mailnews.labels.color.1" name="mailnews.labels.color.1" type="string"/>
      <preference id="mailnews.labels.description.2" name="mailnews.labels.description.2" type="wstring"/>
      <preference id="mailnews.labels.color.2" name="mailnews.labels.color.2" type="string"/>
      <preference id="mailnews.labels.description.3" name="mailnews.labels.description.3" type="wstring"/>
      <preference id="mailnews.labels.color.3" name="mailnews.labels.color.3" type="string"/>
      <preference id="mailnews.labels.description.4" name="mailnews.labels.description.4" type="wstring"/>
      <preference id="mailnews.labels.color.4" name="mailnews.labels.color.4" type="string"/>
      <preference id="mailnews.labels.description.5" name="mailnews.labels.description.5" type="wstring"/>
      <preference id="mailnews.labels.color.5" name="mailnews.labels.color.5" type="string"/>

      <!-- FONTS -->
      <preference id="font.language.group" name="font.language.group"
                  type="wstring" onchange="gDisplayPane._rebuildFonts();"/>

      <!-- TABS -->
      <preference id="mail.openMessageBehavior" name="mail.openMessageBehavior" type="int"/>
      <preference id="mail.autoHideTabBar" name="mail.tabs.autoHide" type="bool"/>
      <preference id="mail.close_message_window.on_delete"
                  name="mail.close_message_window.on_delete" type="bool"/>
      <preference id="mail.addonsManager" name="extensions.openInTab" type="bool"/>
      <preference id="mail.errorConsole" name="toolkit.console.openInTab" type="bool"/>

      <!-- Advanced -->
      <preference id="mail.showCondensedAddresses" name="mail.showCondensedAddresses" type="bool"/>
      <preference id="mailnews.mark_message_read.auto"
                  name="mailnews.mark_message_read.auto" type="bool"/>
      <preference id="mailnews.mark_message_read.delay"
                  name="mailnews.mark_message_read.delay" type="bool"
                  onchange="gDisplayPane.updateMarkAsReadTextbox(this.value);"/>
      <preference id="mailnews.mark_message_read.delay.interval"
                  name="mailnews.mark_message_read.delay.interval" type="int"/>
    </preferences>

    <tabbox id="displayPrefs" flex="1" onselect="gDisplayPane.tabSelectionChanged();">
      <tabs id="displayPrefsTabs">
        <tab id="formattingTab" label="&itemFormatting.label;"/>
        <tab id="tagTab" label="&itemTags.label;"/>
        <tab id="TabsTab" label="&itemTabs.label;"/>
        <tab id="displayTab" label="&itemAdvanced.label;"/>
      </tabs>

      <tabpanels id="displayPrefsPanels" flex="1">

        <tabpanel orient="vertical">
          <!-- Fonts and Colors -->
          <groupbox id="fontsGroup">
            <caption label="&fontsAndColors1.label;"/>

            <grid id="fontsGrid">
              <columns>
                <column flex="1"/>
                <column/>
              </columns>
              <rows id="fontsRows">
                <row id="fontRow">
                  <hbox align="center">
                    <label accesskey="&defaultFont.accesskey;"
                           control="defaultFont">&defaultFont.label;</label>
                    <menulist id="defaultFont" flex="1" sizetopopup="pref" crop="center"
                              onsyncfrompreference="return gDisplayPane.readFontSelection()"/>
                    <label accesskey="&defaultSize.accesskey;"
                           control="defaultFontSize">&defaultSize.label;</label>
                    <menulist id="defaultFontSize">
                      <menupopup>
                        <menuitem value="9" label="9"/>
                        <menuitem value="10" label="10"/>
                        <menuitem value="11" label="11"/>
                        <menuitem value="12" label="12"/>
                        <menuitem value="13" label="13"/>
                        <menuitem value="14" label="14"/>
                        <menuitem value="15" label="15"/>
                        <menuitem value="16" label="16"/>
                        <menuitem value="17" label="17"/>
                        <menuitem value="18" label="18"/>
                        <menuitem value="20" label="20"/>
                        <menuitem value="22" label="22"/>
                        <menuitem value="24" label="24"/>
                        <menuitem value="26" label="26"/>
                        <menuitem value="28" label="28"/>
                        <menuitem value="30" label="30"/>
                        <menuitem value="32" label="32"/>
                        <menuitem value="34" label="34"/>
                        <menuitem value="36" label="36"/>
                        <menuitem value="40" label="40"/>
                        <menuitem value="44" label="44"/>
                        <menuitem value="48" label="48"/>
                        <menuitem value="56" label="56"/>
                        <menuitem value="64" label="64"/>
                        <menuitem value="72" label="72"/>
                      </menupopup>
                    </menulist>
                  </hbox>
                  <spacer style="width: 15px"/>
                  <button id="advancedFonts" label="&fontOptions.label;"
                          icon="select-font" accesskey="&fontOptions.accesskey;"
                          oncommand="gDisplayPane.configureFonts();"/>
                </row>
                <row id="colorsRow">
                  <hbox/>
                  <spacer style="width: 15px"/>
                  <button id="colors" icon="select-color"
                          label="&colorButton.label;"
                          accesskey="&colorButton.accesskey;"
                          oncommand="gDisplayPane.configureColors();"/>
                </row>
              </rows>
            </grid>
          </groupbox>

          <groupbox>
            <hbox>
              <checkbox id="displayGlyph"
                        label="&convertEmoticons.label;"
                        preference="mail.display_glyph"
                        accesskey="&convertEmoticons.accesskey;"/>
              <spacer flex="1"/>
            </hbox>
            <caption label="&displayWidth.label;"/>

            <separator class="thin"/>

            <label control="displayText">&displayText.label;</label>
            <hbox id="displayText" class="indent" align="center" role="group">
              <label value="&style.label;" accesskey="&style.accesskey;" control="mailQuotedStyle"/>
              <menulist id="mailQuotedStyle" preference="mail.quoted_style">
                <menupopup>
                  <menuitem value="0" label="&regularStyle.label;"/>
                  <menuitem value="1" label="&bold.label;"/>
                  <menuitem value="2" label="&italic.label;"/>
                  <menuitem value="3" label="&boldItalic.label;"/>
                </menupopup>
              </menulist>
              <label value="&size.label;" accesskey="&size.accesskey;" control="mailQuotedSize"/>
              <menulist id="mailQuotedSize" preference="mail.quoted_size">
                <menupopup>
                  <menuitem value="0" label="&regularSize.label;"/>
                  <menuitem value="1" label="&bigger.label;"/>
                  <menuitem value="2" label="&smaller.label;"/>
                </menupopup>
              </menulist>
              <label value="&quotedTextColor.label;" accesskey="&quotedTextColor.accesskey;" control="citationmenu"/>
              <colorpicker type="button" id="citationmenu" palettename="standard" preference="mail.citation_color"/>
            </hbox>
          </groupbox>

        </tabpanel>

        <tabpanel orient="vertical">
          <label control="tagList">&displayTagsText.label;</label>
          <hbox>
            <listbox id="tagList" flex="1" rows="10" ondblclick="gDisplayPane.editTag();"
                     onselect="gDisplayPane.onSelect();"/>
            <vbox>
              <button label="&newTagButton.label;" accesskey="&newTagButton.accesskey;"
                      oncommand="gDisplayPane.addTag();"/>
              <button id="editTagButton" disabled="true"
                      label="&editTagButton1.label;"
                      accesskey="&editTagButton1.accesskey;"
                      oncommand="gDisplayPane.editTag();"/>
              <button id="removeTagButton" disabled="true"
                      label="&removeTagButton.label;"
                      accesskey="&removeTagButton.accesskey;"
                      oncommand="gDisplayPane.removeTag();"/>
            </vbox>
          </hbox>
        </tabpanel>

       <!-- Tabbed Mail -->
        <tabpanel orient="vertical">
          <vbox>
            <label value="&openMsgIn.label;"
                   control="mailOpenMessageBehavior"/>
            <radiogroup id="mailOpenMessageBehavior" class="indent"
                        preference="mail.openMessageBehavior">
              <radio id="newWindow" value="0" label="&reuseExpRadio0.label;"
                     accesskey="&reuseExpRadio0.accesskey;"/>
              <radio id="existingWindow" value="1"
                     label="&reuseExpRadio1.label;"
                     accesskey="&reuseExpRadio1.accesskey;"/>
              <radio id="newTab" value="2" label="&openMsgInNewTab.label;"
                     accesskey="&openMsgInNewTab.accesskey;"/>
            </radiogroup>

            <checkbox id="autoHideTabBar"
                      label="&autoHide.label;"
                      preference="mail.autoHideTabBar"/>
            <checkbox id="closeMsgOnMoveOrDelete"
                      label="&closeMsgOnMoveOrDelete.label;"
                      accesskey="&closeMsgOnMoveOrDelete.accesskey;"
                      preference="mail.close_message_window.on_delete"/>
            <checkbox id="addonsManager"
                      label="&addonsManager.label;"
                      preference="mail.addonsManager"/>
            <checkbox id="errorConsole"
                      label="&errorConsole.label;"
                      preference="mail.errorConsole"/>
          </vbox>
        </tabpanel>

        <!-- Advanced -->
        <tabpanel orient="vertical">
          <groupbox>
            <caption label="&reading.caption;"/>

            <vbox>
              <hbox>
                <checkbox id="automaticallyMarkAsRead"
                          preference="mailnews.mark_message_read.auto"
                          label="&autoMarkAsRead.label;"
                          accesskey="&autoMarkAsRead.accesskey;"
                          oncommand="gDisplayPane.updateMarkAsReadOptions(this.checked)"/>
              </hbox>

              <radiogroup id="markAsReadAutoPreferences" orient="vertical"
                          class="indent"
                          align="start"
                          preference="mailnews.mark_message_read.delay">
                <radio id="mark_read_immediately"
                       label="&markAsReadNoDelay.label;"
                       value="false"
                       accesskey="&markAsReadNoDelay.accesskey;"/>
                <hbox align="center">
                  <radio id="markAsReadAfterDelay" value="true"
                         label="&markAsReadDelay.label;"
                         accesskey="&markAsReadDelay.accesskey;"/>
                  <textbox id="markAsReadDelay" size="2"
                           type="number" min="1" max="2147483"
                           preference="mailnews.mark_message_read.delay.interval"
                           aria-labelledby="markAsReadAfterDelay markAsReadDelay secondsLabel"/>
                  <label id="secondsLabel" value="&secondsLabel.label;"/>
                </hbox>
              </radiogroup>
            </vbox>
          </groupbox>

          <groupbox>
            <caption label="&display.caption;"/>

            <hbox>
              <checkbox id="showCondensedAddresses"
                        label="&showCondensedAddresses.label;"
                        accesskey="&showCondensedAddresses.accesskey;"
                        preference="mail.showCondensedAddresses"/>
            </hbox>
          </groupbox>

        </tabpanel>
      </tabpanels>
    </tabbox>
    <separator/>
  </prefpane>
</overlay>
