<?xml version="1.0"?>


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

<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/editContactOverlay.xul"?>

<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
%messengerDTD;
<!ENTITY % customizeToolbarDTD SYSTEM "chrome://global/locale/customizeToolbar.dtd">
%customizeToolbarDTD;
]>

<!--
  - This window displays a single message.
  -->
<window id="messengerWindow"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        title="&titledefault.label;"
        titlemodifier="&titledefault.label;"
        titlemenuseparator="&titleSeparator.label;"
        onload="OnLoadMessageWindow()"
        onunload="OnUnloadMessageWindow()"
        persist="width height screenX screenY sizemode"
        toggletoolbar="true"
        windowtype="mail:messageWindow"
        macanimationtype="document"
        lightweightthemes="true"
        fullscreenbutton="true"
        lightweightthemesfooter="status-bar">

  <stringbundleset id="stringbundleset">
    <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
    <stringbundle id="bundle_offlinePrompts" src="chrome://messenger/locale/offline.properties"/>
  </stringbundleset>

  <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
  <script type="application/javascript" src="chrome://messenger/content/shareglue.js"/>
  <script type="application/javascript" src="chrome://messenger/content/commandglue.js"/>
  <script type="application/javascript" src="chrome://messenger/content/folderDisplay.js"/>
  <script type="application/javascript" src="chrome://messenger/content/messageDisplay.js"/>
  <script type="application/javascript" src="chrome://messenger/content/mailWindow.js"/>
  <script type="application/javascript" src="chrome://messenger/content/messageWindow.js"/>
  <script type="application/javascript" src="chrome://messenger/content/accountUtils.js"/>
  <script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
  <script type="application/javascript" src="chrome://messenger/content/nsContextMenu.js"/>
  <script type="application/javascript" src="chrome://messenger/content/mailContextMenus.js"/>
  <script type="application/javascript" src="chrome://messenger/content/phishingDetector.js"/>
  <script type="application/javascript" src="chrome://communicator/content/contentAreaClick.js"/>
  <script type="application/javascript" src="chrome://global/content/nsDragAndDrop.js"/>
  <script type="application/javascript" src="chrome://messenger/content/msgViewNavigation.js"/>
  <script type="application/javascript" src="chrome://messenger/content/editContactOverlay.js"/>
  <script type="application/javascript" src="chrome://messenger/content/toolbarIconColor.js"/>

  <commandset id="mailCommands">
    <commandset id="mailFileMenuItems"/>
    <commandset id="mailViewMenuItems"/>
    <commandset id="mailEditMenuItems"/>
    <commandset id="mailSearchMenuItems"/>
    <commandset id="mailGoMenuItems"/>
    <commandset id="mailMessageMenuItems"/>
    <commandset id="mailToolbarItems"/>
    <commandset id="mailGetMsgMenuItems"/>
    <commandset id="mailTagMenuItems"/>
    <commandset id="mailMarkMenuItems"/>
    <commandset id="mailToolsMenuItems"/>
    <commandset id="mailEditContextMenuItems"/>
    <commandset id="tasksCommands"/>
    <commandset id="commandKeys"/>
    <commandset id="macWindowMenuItems"/>
    <command id="cmd_close" oncommand="window.close();"/>
  </commandset>

  <broadcasterset id="otherActionsButtonBroadcasters">
     <broadcaster id="otherActionsOpenIn"/>
  </broadcasterset>

  <keyset id="mailKeys">
    <keyset id="tasksKeys"/>
    <key keycode="VK_ESCAPE" oncommand="window.close();"/>
  </keyset>

  <popupset id="mainPopupSet">
    <panel id="editContactPanel"/>
    <menupopup id="emailAddressPopup" class="emailAddressPopup" position="after_start"
               onpopupshowing="setupEmailAddressPopup(findEmailNodeFromPopupNode(document.popupNode, 'emailAddressPopup')); goUpdateCommand('cmd_createFilterFromPopup')"
               onpopuphiding="hideEmailNewsPopup(findEmailNodeFromPopupNode(document.popupNode, 'emailAddressPopup'))">
      <menuitem id="emailAddressPlaceHolder" label=""
                disabled="true"/>
      <menuseparator/>
      <menuitem id="addToAddressBookItem"
                label="&AddDirectlyToAddressBook.label;"
                accesskey="&AddDirectlyToAddressBook.accesskey;"
                oncommand="AddContact(findEmailNodeFromPopupNode(document.popupNode, 'emailAddressPopup'))"/>
      <menuitem id="editContactItem" label="&EditContact1.label;" hidden="true"
                accesskey="&EditContact1.accesskey;"
                oncommand="EditContact(findEmailNodeFromPopupNode(document.popupNode, 'emailAddressPopup'))"/>
      <menuitem id="viewContactItem" label="&ViewContact.label;" hidden="true"
                accesskey="&ViewContact.accesskey;"
                oncommand="EditContact(findEmailNodeFromPopupNode(document.popupNode, 'emailAddressPopup'))"/>
      <menuitem id="sendMailToItem" label="&SendMessageTo.label;"
                accesskey="&SendMessageTo.accesskey;"
                oncommand="SendMailToNode(findEmailNodeFromPopupNode(document.popupNode, 'emailAddressPopup'), event)"/>
      <menuitem id="copyEmailAddressItem" label="&CopyEmailAddress.label;"
                accesskey="&CopyEmailAddress.accesskey;"
                oncommand="CopyEmailNewsAddress(findEmailNodeFromPopupNode(document.popupNode, 'emailAddressPopup'))"/>
      <menuseparator/>
      <menuitem id="createFilterFromItem" label="&CreateFilterFrom.label;"
                accesskey="&CreateFilterFrom.accesskey;"
                oncommand="CreateFilter(findEmailNodeFromPopupNode(document.popupNode, 'emailAddressPopup'))"
                observes="cmd_createFilterFromPopup"/>
    </menupopup>

    <menupopup id="messageIdContext"/>

    <menupopup id="mailContext"/>
  </popupset>

  <menupopup id="attachmentListContext"/>
  <menupopup id="attachmentItemContext"/>
  <menupopup id="header-toolbar-context-menu"/>
  <menupopup id="attachment-toolbar-context-menu"/>
  <menupopup id="copyUrlPopup"/>
  <menupopup id="toolbar-context-menu"/>
  <menupopup id="remoteContentOptions"/>
  <menupopup id="phishingOptions"/>

  <vbox id="titlebar">
    <hbox id="titlebar-content">
      <spacer id="titlebar-spacer" flex="1"/>
      <hbox id="titlebar-buttonbox-container" align="start">
        <hbox id="titlebar-buttonbox">
          <toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
          <toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/>
          <toolbarbutton class="titlebar-button" id="titlebar-close" oncommand="window.close()"/>
        </hbox>
      </hbox>
      <hbox id="titlebar-fullscreen-button"/>
    </hbox>
  </vbox>

  <!-- navigation-toolbox is provided by mailWindowOverlay.xul -->
  <toolbox id="navigation-toolbox" class="toolbox-top" />

  <!-- mail-toolbox is provided by mailWindowOverlay.xul -->
  <toolbox id="mail-toolbox" />

  <tooltip id="aHTMLTooltip" page="true"/>

 <!-- msg header view -->
  <!-- a convenience box for ease of extension overlaying -->
  <hbox id="messagepaneboxwrapper" flex="1">
    <vbox id="messagepanebox" flex="3"
          ondragover="nsDragAndDrop.dragOver(event, messagepaneObserver);"
          ondragdrop="nsDragAndDrop.drop(event, messagepaneObserver);"
          ondragexit="nsDragAndDrop.dragExit(event, messagepaneObserver);">

      <hbox id="msgHeaderView"/>
      <!-- The msgNotificationBar appears on top of the message and displays
           information like: junk, mdn, remote content and phishing warnings -->
      <notificationbox id="msgNotificationBar"/>

      <!-- message view -->
      <browser id="messagepane" context="mailContext" tooltip="aHTMLTooltip"
               style="height: 0px; min-height: 1px" flex="1" name="messagepane"
               disablesecurity="true" disablehistory="true" type="content-primary"
               onresize="return messagePaneOnResize(event);" autofind="false"
               src="about:blank" onclick="return contentAreaClick(event);" />
      <splitter id="attachment-splitter" collapse="after" resizebefore="closest" resizeafter="closest" collapsed="true"/>
      <vbox id="attachmentView"/>
      <findbar id="FindToolbar" browserid="messagepane"/>
    </vbox>
  </hbox>
  <panel id="customizeToolbarSheetPopup" noautohide="true">
    <iframe id="customizeToolbarSheetIFrame"
            style="&dialog.dimensions;"
            hidden="true"/>
  </panel>

  <statusbar class="chromeclass-status" id="status-bar"/>
</window>
