<?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 [
  <!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd">
  %messengerDTD;
  <!ENTITY % msgViewPickerDTD SYSTEM "chrome://messenger/locale/msgViewPickerOverlay.dtd" >
  %msgViewPickerDTD;
  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
  %brandDTD;
]>

<?xml-stylesheet href="chrome://messenger/skin/searchBox.css" type="text/css"?>

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

  <popupset>
    <panel type="glodacomplete-richlistbox"
           id="PopupGlodaAutocomplete" noautofocus="true" />
  </popupset>

  <toolbarpalette id="MailToolbarPalette">
    <!-- gloda search widget; provides global (message) searching.  -->
    <toolbaritem id="gloda-search" insertafter="button-stop"
                 title="&glodaSearch.title;"
                 align="center"
                 flex="1"
                 class="chromeclass-toolbar-additional">
        <textbox id="searchInput" 
                 flex="1"
                 type="glodacomplete"
                 searchbutton="true"
                 autocompletesearch="gloda"
                 autocompletepopup="PopupGlodaAutocomplete"
                 autocompletesearchparam="global"
                 enablehistory="false"
                 timeout="200"
                 maxlength="192"
                 placeholder=""
                 emptytextbase="&search.label.base;"
                 keyLabelNonMac="&search.keyLabel.nonmac;"
                 keyLabelMac="&search.keyLabel.mac;"
                 >
          <!-- Mimic the search/clear buttons of the standard search textbox,
               but adjust for the reality that clear doesn't make much sense
               since gloda results only show in a tab and the idiom for closing
               tabs is closing the tab.  Our binding does process escape to
               clear the box, if people want to clear it that way...
               -->
          <hbox>
            <image class="gloda-search-icon"
                   onclick="document.getElementById('searchInput').doSearch();"
                   />
          </hbox>
        </textbox>
    </toolbaritem>

    <toolbarbutton id="button-compact" class="toolbarbutton-1"
                   insertafter="button-mark"
                   label="&compactButton.label;"
                   tooltiptext="&compactButton.tooltip;"
                   oncommand="goDoCommand('button_compact');"
                   observes="button_compact"/>
    <toolbaritem id="folder-location-container" insert-after="button-stop"
                 title="&folderLocationToolbarItem.title;"
                 align="center"
                 class="chromeclass-toolbar-additional">
      <menulist id="locationFolders"
                class="folderMenuItem"
                label="&folderLocationToolbarItem.title;"
                context="folderPaneContext"
                maxwidth="300"
                crop="center">
        <menupopup id="folderLocationPopup"
                   class="menulist-menupopup"
                   type="folder"
                   flex="1"
                   showFileHereLabel="true"
                   oncommand="gFolderTreeView.selectFolder(event.target._folder);"/>
      </menulist>
    </toolbaritem>
    <toolbaritem id="mailviews-container"
                 title="&mailViewsToolbarItem.title;"
                 align="center"
                 class="chromeclass-toolbar-additional">
      <label id="viewPickerLabel"
             value="&viewPicker.label;"
             control="viewPicker"
             accesskey="&viewPicker.accesskey;"/>
      <menulist id="viewPicker" oncommand="ViewChangeByMenuitem(event.target);">
        <menupopup id="viewPickerPopup" onpopupshowing="RefreshViewPopup(this);">
          <menuitem id="viewPickerAll" value="0"
                    label="&viewAll.label;"
                    type="radio"/>
          <menuitem id="viewPickerUnread" value="1"
                    label="&viewUnread.label;"
                    type="radio"/>
          <menuitem id="viewPickerNotDeleted" value="3"
                    label="&viewNotDeleted.label;"
                    type="radio"/>
          <menuseparator id="afterViewPickerUnreadSeparator"/>
          <menu id="viewPickerTags" label="&viewTags.label;">
            <menupopup id="viewPickerTagsPopup"
                       class="menulist-menupopup"
                       onpopupshowing="RefreshTagsPopup(this, true);"/>
          </menu>
          <menu id="viewPickerCustomViews" label="&viewCustomViews.label;">
            <menupopup id="viewPickerCustomViewsPopup"
                       class="menulist-menupopup"
                       onpopupshowing="RefreshCustomViewsPopup(this, true);"/>
          </menu>
          <menuseparator id="afterViewPickerCustomViewsSeparator"/>
          <menuitem id="viewPickerVirtualFolder"
                    value="7"
                    label="&viewVirtualFolder.label;"/>
          <menuitem id="viewPickerCustomize"
                    value="8"
                    label="&viewCustomizeView.label;"/>
        </menupopup>
      </menulist>
    </toolbaritem>

  </toolbarpalette>
</overlay>
