<?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 copiesAndFolderOverlay..
   -
   - The Initial Developer of the Original Code is
   - The Mozilla Foundation.
   - Portions created by the Initial Developer are Copyright (C) 2005
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -   Scott MacGregor <mscott@mozilla.org>
   -
   - 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 LGPL or the GPL. 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 href="chrome://messenger/skin/accountManage.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/folderMenus.css" type="text/css"?>

<!DOCTYPE overlay [
<!ENTITY % copiesDTD SYSTEM "chrome://messenger/locale/am-copies.dtd">%copiesDTD;
<!ENTITY % pickerDTD SYSTEM "chrome://messenger/locale/msgFolderPickerOverlay.dtd"> %pickerDTD;
]>

<overlay xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/javascript" src="chrome://messenger/content/widgetglue.js"/>
  <script type="application/javascript" src="chrome://messenger/content/am-copies.js"/>

  <vbox flex="1" id="copiesAndFolders">
    <!-- stringbundle is used by msgFolderPickerOverlay.js-->
    <stringbundleset id="stringbundleset">
    <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
    </stringbundleset>

    <broadcaster id="broadcaster_doFcc"/>
    <broadcaster id="broadcaster_archiveEnabled"/>

    <label hidden="true" wsm_persist="true" id="identity.fccFolder"
                  pref="true" preftype="string" prefattribute="value"
                  prefstring="mail.identity.%identitykey%.fcc_folder"/>
    <label hidden="true" wsm_persist="true" id="identity.draftFolder"
                  pref="true" preftype="string" prefattribute="value"
                  prefstring="mail.identity.%identitykey%.draft_folder"/>
    <label hidden="true" wsm_persist="true" id="identity.archiveFolder"
                  pref="true" preftype="string" prefattribute="value"
                  prefstring="mail.identity.%identitykey%.archive_folder"/>
    <label hidden="true" wsm_persist="true" id="identity.stationeryFolder"
                  pref="true" preftype="string" prefattribute="value"
                  prefstring="mail.identity.%identitykey%.stationary_folder"/>
    <label hidden="true" wsm_persist="true" id="identity.email"/>
    <label hidden="true" wsm_persist="true" id="identity.fccFolderPickerMode"
                  pref="true" preftype="int" prefattribute="value"
                  prefstring="mail.identity.%identitykey%.fcc_folder_picker_mode"/>
    <label hidden="true" wsm_persist="true" id="identity.draftsFolderPickerMode"
                  pref="true" preftype="int" prefattribute="value"
                  prefstring="mail.identity.%identitykey%.drafts_folder_picker_mode"/>
    <label hidden="true" wsm_persist="true" id="identity.archivesFolderPickerMode"
                  pref="true" preftype="int" prefattribute="value"
                  prefstring="mail.identity.%identitykey%.archives_folder_picker_mode"/>
    <label hidden="true" wsm_persist="true" id="identity.tmplFolderPickerMode"
                  pref="true" preftype="int" prefattribute="value"
                  prefstring="mail.identity.%identitykey%.tmpl_folder_picker_mode"/>
    <groupbox id="copiesGroup">
      <caption label="&sendingPrefix.label;"/>

      <hbox align="center">
        <checkbox wsm_persist="true" id="identity.doFcc" label="&fccMailFolder.label;"
                  accesskey="&fccMailFolder.accesskey;"
                  prefattribute="value"
                  prefstring="mail.identity.%identitykey%.fcc"
                  oncommand="setupFccItems();"/>
      </hbox>
        <radiogroup id="doFcc" aria-labelledby="identity.doFcc">
        <grid class="specialFolderPickerGrid">
          <columns>
            <column/>
            <column flex="1"/>
          </columns>
          <rows>
            <row align="center">
              <radio id="fcc_selectAccount"
                     value="0" label="&sentFolderOn.label;"
                     accesskey="&sentFolderOn.accesskey;"
                     oncommand="setPickersState('msgFccAccountPicker', 'msgFccFolderPicker', event)"
                     observes="broadcaster_doFcc"/>
                <menulist id="msgFccAccountPicker"
                          aria-labelledby="fcc_selectAccount"
                          observes="broadcaster_doFcc"
                          oncommand="noteSelectionChange('fcc', 'Account', event)">
                  <menupopup id="msgFccAccountPopup" type="folder" mode="filing"
                             expandFolders="false"/>
                </menulist>
            </row>
            <row align="center">
              <radio id="fcc_selectFolder"
                     value="1" label="&sentInOtherFolder.label;"
                     accesskey="&sentInOtherFolder.accesskey;"
                     oncommand="setPickersState('msgFccFolderPicker', 'msgFccAccountPicker', event)"
                     observes="broadcaster_doFcc"/>
                <menulist id="msgFccFolderPicker"
                          aria-labelledby="fcc_selectFolder"
                          oncommand="noteSelectionChange('fcc', 'Folder', event)"
                          observes="broadcaster_doFcc">
                  <menupopup id="msgFccFolderPopup" type="folder" mode="filing"
                             class="menulist-menupopup"
                             showFileHereLabel="true"
                             fileHereLabel="&filemessageschoosethis.label;"/>
                </menulist>
            </row>
          </rows>
        </grid>
      </radiogroup>

      <hbox align="center" class="fccReplyFollowsParent" hidable="true" hidefor="nntp,rss">
        <checkbox wsm_persist="true" id="identity.fccReplyFollowsParent"
              label="&fccReplyFollowsParent.label;"
              accesskey="&fccReplyFollowsParent.accesskey;"
              prefattribute="value"
              prefstring="mail.identity.%identitykey%.fcc_reply_follows_parent"
              observes="broadcaster_doFcc"/>
      </hbox>

      <grid>
        <columns>
          <column/>
          <column flex="1"/>
        </columns>

        <rows>
          <row align="center">
            <checkbox wsm_persist="true" id="identity.doCc" label="&ccAddress.label;"
                  accesskey="&ccAddress.accesskey;"
                  control="identity.doCcList"
                  oncommand="setupCcTextbox();"
                  prefattribute="value"
                  prefstring="mail.identity.%identitykey%.doCc"/>
            <textbox wsm_persist="true" id="identity.doCcList" flex="1"
                  aria-labelledby="identity.doCc"
                  prefstring="mail.identity.%identitykey%.doCcList" class="uri-element"
                  placeholder="&ccAddressList.placeholder;"/>
          </row>
          <row align="center">
            <checkbox wsm_persist="true" id="identity.doBcc" label="&bccAddress.label;"
                  accesskey="&bccAddress.accesskey;"
                  control="identity.doBccList"
                  oncommand="setupBccTextbox();"
                  prefattribute="value"
                  prefstring="mail.identity.%identitykey%.doBcc"/>
            <textbox wsm_persist="true" id="identity.doBccList" flex="1"
                  aria-labelledby="identity.doBcc"
                  prefstring="mail.identity.%identitykey%.doBccList" class="uri-element"
                  placeholder="&bccAddressList.placeholder;"/>
          </row>
        </rows>
      </grid>

    </groupbox>

    <groupbox id="archivesGroup">
      <caption label="&archivesTitle.label;"/>

      <hbox align="center">
        <checkbox wsm_persist="true" id="identity.archiveEnabled"
                  label="&keepArchives.label;"
                  accesskey="&keepArchives.accesskey;"
                  prefattribute="value"
                  prefstring="mail.identity.%identitykey%.archive_enabled"
                  oncommand="setupArchiveItems();"/>
        <spacer flex="1"/>
        <button id="archiveHierarchyButton"
                label="&archiveHierarchyButton.label;"
                accesskey="&archiveHierarchyButton.accesskey;"
                oncommand="ChangeArchiveHierarchy();"
                observes="broadcaster_archiveEnabled"/>
      </hbox>

      <radiogroup id="messageArchives">
        <grid class="specialFolderPickerGrid">
          <columns>
            <column/>
            <column flex="1"/>
          </columns>
          <rows>
            <row align="center">
              <radio id="archive_selectAccount"
                     value="0" label="&archivesFolderOn.label;"
                     accesskey="&archivesFolderOn.accesskey;"
                     oncommand="setPickersState('msgArchivesAccountPicker', 'msgArchivesFolderPicker', event)"
                     observes="broadcaster_archiveEnabled"/>
                <menulist id="msgArchivesAccountPicker"
	                      aria-labelledby="archive_selectAccount"
                          observes="broadcaster_archiveEnabled"
                          oncommand="noteSelectionChange('archive', 'Account', event)">
                <menupopup id="msgArchivesAccountPopup" type="folder" mode="filing"
                           expandFolders="false"/>
              </menulist>
            </row>
            <row align="center">
              <radio id="archive_selectFolder"
                     value="1" label="&archiveInOtherFolder.label;"
                     accesskey="&archiveInOtherFolder.accesskey;"
                     oncommand="setPickersState('msgArchivesFolderPicker', 'msgArchivesAccountPicker', event)"
                     observes="broadcaster_archiveEnabled"/>
                <menulist id="msgArchivesFolderPicker"
                          aria-labelledby="archive_selectFolder"
                          oncommand="noteSelectionChange('archive', 'Folder', event)"
                          observes="broadcaster_archiveEnabled">
                <menupopup id="msgArchivesFolderPopup" type="folder" mode="filing"
                           class="menulist-menupopup"
                           showFileHereLabel="true"
                           fileHereLabel="&filemessageschoosethis.label;"/>
              </menulist>
            </row>
          </rows>
        </grid>
      </radiogroup>
    </groupbox>

    <groupbox id="foldersGroup">
      <caption label="&specialFolders.label;"/>

      <hbox align="center">
        <label value="&keepDrafts.label;" control="messageDrafts"/>
      </hbox>

      <radiogroup id="messageDrafts">
        <grid class="specialFolderPickerGrid">
          <columns>
            <column/>
            <column flex="1"/>
          </columns>
          <rows>
            <row align="center">
              <radio id="draft_selectAccount"
                     oncommand="setPickersState('msgDraftsAccountPicker', 'msgDraftsFolderPicker', event)"
                     value="0" label="&draftsFolderOn.label;"
                     accesskey="&draftsFolderOn.accesskey;"/>
              <menulist id="msgDraftsAccountPicker"
	                    aria-labelledby="draft_selectAccount"
                        oncommand="noteSelectionChange('draft', 'Account', event)">
                <menupopup id="msgDraftAccountPopup" type="folder" mode="filing"
                           expandFolders="false"/>
              </menulist>
            </row>
            <row align="center">
              <radio id="draft_selectFolder"
                     oncommand="setPickersState('msgDraftsFolderPicker', 'msgDraftsAccountPicker', event)"
                     value="1" label="&draftInOtherFolder.label;"
                     accesskey="&draftInOtherFolder.accesskey;"/>
  	          <menulist id="msgDraftsFolderPicker"
                        aria-labelledby="draft_selectFolder"
                        oncommand="noteSelectionChange('draft', 'Folder', event)">
                <menupopup id="msgDraftFolderPopup" type="folder" mode="filing"
                           class="menulist-menupopup"
                           showFileHereLabel="true"
                           fileHereLabel="&filemessageschoosethis.label;"/>
              </menulist>
            </row>
          </rows>
        </grid>
      </radiogroup>

      <hbox align="center">
        <label value="&keepTemplates.label;" control="messageTemplates"/>
      </hbox>

      <radiogroup id="messageTemplates">
        <grid class="specialFolderPickerGrid">
          <columns>
            <column/>
            <column flex="1"/>
          </columns>
          <rows>
            <row align="center">
              <radio id="tmpl_selectAccount"
                     oncommand="setPickersState('msgStationeryAccountPicker', 'msgStationeryFolderPicker', event)"
                     value="0" label="&templatesFolderOn.label;"
                     accesskey="&templatesFolderOn.accesskey;"/>
  	          <menulist id="msgStationeryAccountPicker"
                        aria-labelledby="tmpl_selectAccount"
                        oncommand="noteSelectionChange('tmpl', 'Account', event)">
                <menupopup id="msgFccAccountPopup" type="folder" mode="filing"
                           expandFolders="false"/>
              </menulist>
            </row>
            <row align="center">
              <radio id="tmpl_selectFolder"
                     oncommand="setPickersState('msgStationeryFolderPicker', 'msgStationeryAccountPicker', event)"
                     value="1" label="&templateInOtherFolder.label;"
                     accesskey="&templateInOtherFolder.accesskey;"/>
              <menulist id="msgStationeryFolderPicker"
                        aria-labelledby="tmpl_selectFolder"
                        oncommand="noteSelectionChange('tmpl', 'Folder', event)">
                <menupopup id="msgTemplFolderPopup" type="folder" mode="filing"
                           class="menulist-menupopup"
                           showFileHereLabel="true"
                           fileHereLabel="&filemessageschoosethis.label;"/>
              </menulist>
            </row>
          </rows>
        </grid>
      </radiogroup>
      <hbox align="center">
        <checkbox wsm_persist="true" id="identity.showSaveMsgDlg" label="&saveMessageDlg.label;"
                  accesskey="&saveMessageDlg.accesskey;"
                  prefattribute="value"
                  prefstring="mail.identity.%identitykey%.showSaveMsgDlg"/>
      </hbox>
    </groupbox>
  </vbox>
</overlay>
