<?xml version="1.0"?>

<!-- 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 SYSTEM "chrome://messenger/locale/messengercompose/pref-formatting.dtd">

<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <prefpane id="formatting_pane"
            label="&pref.formatting.title;"
            script="chrome://messenger/content/messengercompose/pref-formatting.js">
    <preferences id="formatting_preferences">
      <preference id="mail.default_html_action"
                  name="mail.default_html_action"
                  type="int"/>
      <preference id="mailnews.html_domains"
                  name="mailnews.html_domains"
                  type="string"/>
      <preference id="mailnews.plaintext_domains"
                  name="mailnews.plaintext_domains"
                  type="string"/>
      <preference id="mailnews.sendformat.auto_downgrade"
                  name="mailnews.sendformat.auto_downgrade"
                  type="bool"/>
    </preferences>

    <data id="formatting_error_msg"
          title="&domainnameError.title;"
          inverr="&invalidEntryError.label;"/>

    <description>&sendMaildesc.label;</description>

    <radiogroup id="mailDefaultHTMLAction"
                preference="mail.default_html_action">
      <radio value="0"
             label="&askMe.label;"
             accesskey="&askMe.accesskey;"/>
      <radio value="1"
             label="&convertPlain2.label;"
             accesskey="&convertPlain2.accesskey;"/>
      <radio value="2"
             label="&sendHTML2.label;"
             accesskey="&sendHTML2.accesskey;"/>
      <radio value="3"
             label="&sendBoth2.label;"
             accesskey="&sendBoth2.accesskey;"/>
    </radiogroup>

    <groupbox flex="1">
      <caption label="&domain.title;"/>

      <description>&domaindesc.label;</description>

      <hbox flex="1">
        <vbox flex="1">
          <label value="&HTMLdomaintitle.label;"
                 accesskey="&HTMLdomaintitle.accesskey;"
                 control="html_domains"/>
          <hbox flex="1">
            <listbox id="html_domains"
                     title="&add.htmltitle;"
                     msg="&add.htmldomain;"
                     flex="1"
                     seltype="multiple"
                     preference="mailnews.html_domains"
                     onsyncfrompreference="return this.pane.ReadDomains(this);"
                     onsynctopreference="return this.pane.WriteDomains(this);"
                     onkeypress="RemoveDomains('html', event);"/>
            <vbox>
              <button label="&AddButton.label;"
                      accesskey="&AddHtmlDomain.accesskey;"
                      oncommand="AddDomain('html');">
                <observes element="html_domains" attribute="disabled"/>
              </button>
              <button label="&DeleteButton.label;"
                      accesskey="&DeleteHtmlDomain.accesskey;"
                      oncommand="RemoveDomains('html', null);">
                <observes element="html_domains" attribute="disabled"/>
              </button>
            </vbox>
          </hbox>
        </vbox>
        <vbox flex="1">
          <label value="&PlainTexttitle.label;"
                 accesskey="&PlainTexttitle.accesskey;"
                 control="plaintext_domains"/>
          <hbox flex="1">
            <listbox id="plaintext_domains"
                     title="&add.plaintexttitle;"
                     msg="&add.plaintextdomain;"
                     flex="1"
                     seltype="multiple"
                     preference="mailnews.plaintext_domains"
                     onsyncfrompreference="return this.pane.ReadDomains(this);"
                     onsynctopreference="return this.pane.WriteDomains(this);"
                     onkeypress="RemoveDomains('plaintext', event);"/>
            <vbox>
              <button label="&AddButton.label;"
                      accesskey="&AddPlainText.accesskey;"
                      oncommand="AddDomain('plaintext');">
                <observes element="plaintext_domains" attribute="disabled"/>
              </button>
              <button label="&DeleteButton.label;"
                      accesskey="&DeletePlainText.accesskey;"
                      oncommand="RemoveDomains('plaintext', null);">
                <observes element="plaintext_domains" attribute="disabled"/>
              </button>
            </vbox>
          </hbox>
        </vbox>
      </hbox>
    </groupbox>

    <checkbox id="autoDowngrade"
              label="&autoDowngrade.label;"
              accesskey="&autoDowngrade.accesskey;"
              preference="mailnews.sendformat.auto_downgrade"/>
  </prefpane>
</overlay>
