<?xml version="1.0"?>


<!--
The contents of this file are subject to the Netscape 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/NPL/

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 Mozilla Communicator client code, released
March 31, 1998.

The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
 Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
<?xul-overlay href="chrome://messenger/content/threadPane.xul"?>
<?xul-overlay href="chrome://messenger/content/searchTermOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/msgFolderPickerOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>

<!DOCTYPE window SYSTEM "chrome://messenger/locale/SearchDialog.dtd" >

<window xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    onload="searchOnLoad(); SetDatasources()"
    onunload="searchOnUnload();"
    onclose="onSearchStop();"
    title="&searchDialogTitle.label;"
    width="640" height="470"
    persist="screenX screenY width height"
    class="color-dialog"
    orient="vertical">

  <stringbundle id="bundle_search" src="chrome://messenger/locale/search.properties"/>
  <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
  <stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
  <!-- XXX: only mailWidgets.xml requires strres.js (<script> isn't valid in XBL yet - see hyatt)-->
  <script type="text/javascript" src="chrome://global/content/strres.js"/>
  <script src="chrome://messenger/content/mailWindow.js"/>
  <script src="chrome://messenger/content/threadPane.js"/>
  <script src="chrome://messenger/content/msgMail3PaneWindow.js"/>
  <script src="chrome://global/content/globalOverlay.js"/>
  <script src="chrome://messenger/content/mailCommands.js"/>
  <script src="chrome://messenger/content/mailWindowOverlay.js"/>
  <script src="chrome://messenger/content/commandglue.js"/>
  <script src="chrome://messenger/content/SearchDialog.js"/>

  <commands id="commands">
    <commandset id="mailSearchItems"
                commandupdater="true"
                events="mail-search"
                oncommandupdate="goUpdateSearchItems(this)">
      <command id="cmd_open" oncommand="goDoCommand('cmd_open')" disabled="true"/>
      <command id="cmd_delete" oncommand="goDoCommand('cmd_delete')" disabled="true"/>
      <command id="file_message_button"/>
    </commandset>
  </commands>

  <dummy class="usesMailWidgets"/>
  <box flex="1" orient="vertical">
    
    <titledbox orient="vertical" class="dialog box-padded" flex="1">
      <label value="&conditions.label;"/>
      <box autostretch="never">
        <text class="label" value="&searchHeading.label;"/>
        <menulist id="searchableFolders" flex="2"/>
        <spring flex="1"/>
          <checkbox id="checkSearchSubFolders" label="&searchSubfolders.label;" checked="true"/>
      </box>
      <separator/>
      <text class="label" value="&conditionDesc.label;"/>

      <box flex="1">
        <box id="searchTermListBox" flex="1"/>
        <box orient="vertical">
           <spring flex="1"/>
           <button label="&searchButton.label;" id="search-button" oncommand="onSearchButton(event);"/>
           <button label="&resetButton.label;" oncommand="onReset(event);"/>
           <spring flex="1"/>
         </box>
      </box>
    </titledbox>
    
    <splitter id="gray_horizontal_splitter" collapse="after"  persist="state"/>
    
    <titledbox orient="horizontal" class="dialog box-padded" flex="1">
       <label value="&results.label;"/>
       <box id="searchTermListBox" orient="vertical" flex="1">
            <outliner id="threadOutliner" flex="1" context="threadPaneContext"/>
       </box>
       <box orient="vertical">
            <spring flex="1" />
            <button label="&openButton.label;" id="openButton" observes="cmd_open"/>
            <button label="&deleteButton.label;" id="deleteButton" observes="cmd_delete"/>
            <spring flex="1" />
       </box>      
    </titledbox>

    <box align="left">
		<menubutton class="menubutton-dual-dropmarker-box" id="fileMessageButton" observes="file_message_button" oncommand="MoveMessageInSearch(event.target)" datasources="rdf:null" ignore="http://home.netscape.com/NC-rdf#MessageChild" label="&fileButton.label;">
			<menupopup/>
			<template> 
			<rule nc:NoSelect="true" iscontainer="true" isempty="false">
				<menupopup>
					<menu uri="..."  class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name">
						<menupopup>
							<menuitem uri="..." label="&fileHereMenu.label;"/>
							<menuseparator/>
						</menupopup>
					</menu>
				</menupopup>
			</rule> 
			<rule nc:NoSelect="true">
				<menupopup>
					<menuitem uri="..."  class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"/>
				</menupopup>
			</rule>
				<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
					<menupopup>
						<menu uri="..."  class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
						 SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
						 BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
						 IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
						 ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
							<menupopup>
								<menuitem uri="..." label="&fileHereMenu.label;"
								 SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
								 BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
								 IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
								 ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
								<menuseparator/>
							</menupopup>
						</menu>
					</menupopup>
				</rule>
	            <rule nc:CanFileMessages="false" nc:ServerType="nntp"/>
				<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
				<!-- note, there is no "file here" -->
					<menupopup>
						<menu uri="..."  class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
						 SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
						 BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
						 IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
						 ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
							<menupopup/>
						</menu>
					</menupopup>
				</rule>
				<rule nc:CanFileMessages="true">
					<menupopup>
						<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
						 SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
						 BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
						 IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
						 ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
					</menupopup>
				</rule>
			</template>
		</menubutton>
    </box>
        
    <box autostretch="never" align="right">

      <button label="&closeButton.label;" oncommand="window.close();"/>
    </box>
  
  </box>
  <statusbar id="status-bar"/>
  
</window>
