<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
<!--

  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.org code.
 
  The Initial Developer of the Original Code is Netscape
  Communications Corporation.  Portions created by Netscape are
  Copyright (C) 1998 Netscape Communications Corporation. All
  Rights Reserved.

  Original Author(s):
    Robert John Churchill    <rjc@netscape.com>

  Contributor(s): 

-->

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

<!DOCTYPE window SYSTEM "chrome://communicator/locale/bookmarks/bm-find.dtd">

<window title="&window.title.label;" id="bookmark-find-window"
	xmlns:html="http://www.w3.org/TR/REC-html40"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:web="http://home.netscape.com/WEB-rdf#"
	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
	width="630" height="400" x="20" y="20" persist="width height x y" align="vertical"
	windowtype="bookmarks:find" class="dialog"
	onload="doLoad()" onunload="doUnload()"
	>

	<html:script src="chrome://communicator/content/bookmarks/bm-find.js" />
	<html:script src="chrome://global/content/treePopups.js" />

	<menubar>
		<menu value="&menu.file.label;">
			<menupopup>
				<menuitem value="&menuitem.close.label;" oncommand="window.close()" />
			</menupopup>
		</menu>

		<menu value="&menu.edit.label;">
			<menupopup>
				<menuitem value="&menuitem.undo.label;" disabled="true" />
				<menuseparator/>
				<menuitem value="&menuitem.cut.label;" disabled="true" />
				<menuitem value="&menuitem.copy.label;" disabled="true" />
				<menuitem value="&menuitem.paste.label;" disabled="true" />
				<menuitem value="&menuitem.delete.label;" disabled="true" />
				<menuitem value="&menuitem.selectAll.label;" disabled="true" />
			</menupopup>
		</menu>
	</menubar>

	<titledbox orient="horizontal">
	<spring align="horizontal" flex="100%" />
	<box align="vertical">
		<box align="horizontal">
			<spring align="horizontal" flex="100%" />
			<text value="&search1.label;" />
			<menulist id="datasource">
				<menupopup id="datasourcePopup">
					<menuitem data="rdf:bookmarks" value="&bookmarks.label;" />
					<menuitem data="rdf:history" value="&history.label;" />
				</menupopup>
			</menulist>
			<text value="&search2.label;" />
			<spring align="horizontal" flex="100%" />
		</box>

		<box align="horizontal">
			<spring align="horizontal" flex="100%" />
			<menulist id="match">
				<menupopup id="matchPopup">
					<menuitem data="http://home.netscape.com/NC-rdf#Name" value="&name.label;" />
					<menuitem data="http://home.netscape.com/NC-rdf#URL" value="&url.label;" />
					<menuitem data="http://home.netscape.com/NC-rdf#ShortcutURL" value="&shortcut.label;" />
					<menuitem data="http://home.netscape.com/NC-Description" value="&description.label;" />
				</menupopup>
			</menulist>
			<menulist id="method">
				<menupopup id="methodPopup">
					<menuitem data="contains" value="&contains.label;" />
					<menuitem data="startswith" value="&startswith.label;" />
					<menuitem data="endswith" value="&endswith.label;" />
					<menuitem data="is" value="&is.label;" />
					<menuitem data="isnot" value="&isnot.label;" />
					<menuitem data="doesntcontain" value="&doesntcontain.label;" />
				</menupopup>
			</menulist>

			<textfield id="findtext" type="text" style="width:10em;" onkeypress="if (event.which == 13) { return doFind(); }" />
			<box autostretch="never">
				<button value="&search.button.label;" onclick="return doFind();" class="dialog toolbar-non-iconic" />
			</box>
			<spring align="horizontal" flex="100%" />
		</box>
	</box>
	<spring align="horizontal" flex="100%" />
	</titledbox>

	<box height="10" />

	<tree id="findresultstree" ref="" flex="100%" style="height:0px"
		datasources="rdf:bookmarks rdf:history rdf:localsearch"
		onclick="return OpenURL(event, event.target.parentNode.parentNode);">

		<treecolgroup id="theColumns">
			<treecol id="NameColumn" persist="hidden width" width="2*"
				rdf:resource="http://home.netscape.com/NC-rdf#Name"
				sortActive="true" sortDirection="ascending" />
			<treecol id="URLColumn" persist="hidden width" width="2*"
				rdf:resource="http://home.netscape.com/NC-rdf#URL"/>
			<treecol id="ShortcutURLColumn" persist="hidden width" width="1*"
				rdf:resource="http://home.netscape.com/NC-rdf#ShortcutURL"/>
			<treecol id="DescriptionColumn" persist="hidden width" width="1*"
				rdf:resource="http://home.netscape.com/NC-rdf#Description"/>
			<treecol id="PopupColumn" persist="width" fixed="true" width="14" />
		</treecolgroup>

		<template>
			<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
                                <treechildren>
				<treeitem uri="...">
					<treerow>
						<treecell>
							<html:hr width="100%" align="center" size="1" />
						</treecell>
					</treerow>
				</treeitem>  	
                                </treechildren>	
			</rule>

			<rule>
                                <treechildren>
				<treeitem uri="rdf:*">
					<treerow>
						<treecell align="left" crop="right" indent="true" value="rdf:http://home.netscape.com/NC-rdf#Name" src="rdf:http://home.netscape.com/NC-rdf#Icon" />
						<treecell align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#URL"/>
						<treecell align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#ShortcutURL"/>
						<treecell align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Description"/>
					</treerow>
				</treeitem>
                                </treechildren>
			</rule>
		</template>

		<treehead>
			<treerow id="headRow">
				<treecell class="treecell-header sortDirectionIndicator" observes="NameColumn"
					value="&name.label;" resource="http://home.netscape.com/NC-rdf#Name"
					onclick="return doSort('NameColumn', null);" sortActive="true" sortDirection="ascending" />
				<treecell class="treecell-header sortDirectionIndicator" observes="URLColumn"
					value="&url.label;" resource="http://home.netscape.com/NC-rdf#URL"
					onclick="return doSort('URLColumn', null);" />
				<treecell class="treecell-header sortDirectionIndicator" observes="ShortcutURLColumn"
					value="&shortcut.label;" resource="http://home.netscape.com/NC-rdf#ShortcutURL"
					onclick="return doSort('ShortcutURLColumn', null);" />
				<treecell class="treecell-header sortDirectionIndicator" observes="DescriptionColumn"
					value="&description.label;" resource="http://home.netscape.com/NC-rdf#Description"
					onclick="return doSort('DescriptionColumn', null);" />

				<treecell allowevents="true" id="popupCell">
					<menu>
						<titledbutton src="chrome://global/skin/opentwisty.gif"/>
						<menupopup popupanchor="bottomright" 
							popupalign="topright"
							oncreate="BuildTreePopup(document.getElementById('theColumns'), document.getElementById('headRow'), this,
							document.getElementById('popupCell'))" />
					</menu>
				</treecell>
			</treerow>
		</treehead>
	</tree>

	<box align="horizontal">
		<spring flex="1" />
		<button id="SaveSearch" disabled="true" value="&save.button.label;" onclick="return saveFind();" class="dialog toolbar-non-iconic"/>
		<spring flex="1" />
	</box>

<!--
This extra "status" bar is necessary because the bottom right corner of
the window on MacOS is taken up by the growBox. If this window had a
horizontal scrollbar, we'd be alright, but since it doesn't the bottom
arrow on the vertical scrollbar was being hidden by this growBox. To
combat this, we can just stick in a 16px high bar to bump up the bottom
of the tree so that the scrollbar is visible. Yes, I know this is not
necessary for win32 or gtk, but we can use this area for information
(maybe full URL of selected item or the like) in the future.
-->
	<box id="status-bar" style="min-height:16px; max-height:16px;">
		<titledbutton class="status-bar" align="left" value=""/>
	</box>

</window>
