<?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/. -->

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

<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/history/placesOverlay.xul"?>

<!DOCTYPE window [
<!ENTITY % historyDTD SYSTEM "chrome://communicator/locale/history/history.dtd">
%historyDTD;
<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuOverlayDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>

<window title="&historyWindowTitle.label;" id="history-window"
        onload="HistoryCommonInit();"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        width="500" height="400"
        persist="width height screenX screenY sizemode"
        toggletoolbar="true"
        windowtype="history:manager">

  <commandset id="tasksCommands">
    <!-- File Menu -->
    <command id="cmd_close" oncommand="window.close()"/>
    <command id="bm_cmd_saveas"/>
    <!-- Search Box -->
    <command id="cmd_search_focus"
             oncommand="focusElement(gSearchBox);"/>
  </commandset>
  <commandset id="selectEditMenuItems">
    <command id="cmd_cut"/>
    <command id="cmd_copy"/>
    <command id="cmd_delete"/>
    <command id="cmd_selectAll"/>
  </commandset>
  <commandset id="placesCommands"/>

  <broadcaster id="Communicator:WorkMode"/>

  <keyset id="tasksKeys">
    <!-- File Menu -->
    <key id="key_close"/>
    <!-- Edit Menu -->
    <key id="key_cut"/>
    <key id="key_copy"/>
    <key id="key_delete"/>
    <key id="key_delete2"/>
    <key id="key_selectAll"/>
    <!-- Search Box -->
    <key id="key_search_focus"
         command="cmd_search_focus"
         key="&search.key;"
         modifiers="accel"/>
  </keyset>

  <popupset id="placesPopupset">
    <menupopup id="placesContext"/>
  </popupset>

  <toolbox id="history-toolbox">
    <toolbar id="placesToolbar"
             type="menubar">
      <menubar id="history-menu"
#ifdef MOZ_WIDGET_GTK
               _moz-menubarkeeplocal="true"
#endif
               grippytooltiptext="&menuBar.tooltip;">

        <menu id="menu_File">
          <menupopup id="menu_FilePopup">
            <menuitem id="menu_close"/>
          </menupopup>
        </menu>

        <menu id="menu_Edit">
          <menupopup>
            <menuitem id="menu_cut"/>
            <menuitem id="menu_copy"/>
            <menuitem id="menu_delete"/>
            <menuitem id="menu_deleteByHostname" command="placesCmd_delete:hostname"/>
            <menuitem id="menu_deleteByDomain" command="placesCmd_delete:domain"/>
            <menuseparator/>
            <menuitem id="menu_selectAll"/>
          </menupopup>
        </menu>

        <menu id="menu_View">
          <menupopup id="viewPopup"
                     onpopupshowing="onViewToolbarsPopupShowing(event)"
                     oncommand="onViewToolbarCommand(event);">
            <menuseparator id="toolbarmode-sep"/>
          </menupopup>
        </menu>

        <menu id="tasksMenu"/>
        <menu id="windowMenu"/>
        <menu id="menu_Help"/>
      </menubar>
      <toolbarspring/>
      <textbox id="search-box"
               clickSelectsAll="true"
               type="search"
               aria-controls="historyTree"
               placeholder="&search.placeholder;"
               oncommand="searchHistory(this.value);"/>
    </toolbar>
  </toolbox>

  <tree id="historyTree"
        class="placesTree plain"
        context="placesContext"
        flex="1" type="places"
        enableColumnDrag="true"
        onselect="historyOnSelect();"
        onkeypress="if (event.keyCode == KeyEvent.DOM_VK_RETURN) PlacesUIUtils.openNodeWithEvent(gHistoryTree.selectedNode, event);">
    <treecols context="">
      <treecol label="&col.title.label;" id="Name" flex="4"
               persist="width hidden ordinal sortActive sortDirection"/>
      <splitter class="tree-splitter"/>
      <treecol label="&col.url.label;" id="URL" flex="4"
               persist="width hidden ordinal sortActive sortDirection"/>
      <splitter class="tree-splitter"/>
      <treecol label="&col.lastvisit.label;" id="Date" flex="1"
               persist="width hidden ordinal sortActive sortDirection"/>
      <splitter class="tree-splitter"/>
      <treecol label="&col.visitcount.label;" id="VisitCount" flex="1" hidden="true"
               persist="width hidden ordinal sortActive sortDirection"/>
    </treecols>
    <treechildren ondblclick="if (event.button == 0) PlacesUIUtils.openNodeWithEvent(gHistoryTree.selectedNode, event);"
                  onclick="if (event.button == 1) PlacesUIUtils.openNodeWithEvent(gHistoryTree.selectedNode, event);"/>
  </tree>
  <statusbar id="status-bar" class="chromeclass-status">
    <statusbarpanel id="statusbar-display" flex="1"/>
    <statusbarpanel class="statusbarpanel-iconic" id="offline-status"/>
  </statusbar>

</window>
