<?xml version="1.0"?>

<!-- This is the overlay that adds a menu to messenger compose window -->

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

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

<overlay id="enigmailMessengerOverlay"
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/x-javascript" src="chrome://enigmail/content/enigmailCommon.js"/>
  <script type="application/x-javascript"  src="chrome://enigmail/content/enigmailMessengerOverlay.js"/>

  <menubar id="mailMenubar">
    <menu id="menu_Enigmail"
          label="Enigmail"
          accesskey="&enigmail.messengermenu.accesskey;"
          insertbefore="tasksMenu">

      <menupopup id="menu_EnigmailPopup">

        <menuitem id="enigmail_decryptverify"
             label="&enigmail.decryptverify.label;"
             accesskey="&enigmail.decryptverify.accesskey;"
             oncommand="enigMessageDecrypt();" />

        <menuitem id="enigmail_importpublickey"
             label="&enigmail.importpublickey.label;"
             accesskey="&enigmail.importpublickey.accesskey;"
             oncommand="enigMessageImport();" />

        <menuitem id="enigmail_savedecrypted"
             label="&enigmail.savedecrypted.label;"
             accesskey="&enigmail.savedecrypted.accesskey;"
             oncommand="enigMessageSave();" />

        <menuseparator/>

        <menuitem id="enigmail_autoDecrypt"
             type="checkbox"
             checked="false"
             label="&enigmail.autoDecrypt.label;"
             accesskey="&enigmail.autoDecrypt.accesskey;"
             oncommand="enigToggleAttribute('autoDecrypt');" />

        <menuseparator/>

        <menuitem id="enigmail_clearPassphrase"
             label="&enigmail.clearPassphrase.label;"
             accesskey="&enigmail.clearPassphrase.accesskey;"
             oncommand="EnigClearPassphrase();" />

        <menuseparator/>

        <menuitem id="enigmail_prefs"
             label="&enigmail.prefs.label;"
             accesskey="&enigmail.prefs.accesskey;"
             oncommand="EnigPrefWindow();" />

        <menuitem id="enigmail_advprefs"
             label="&enigmail.advprefs.label;"
             accesskey="&enigmail.advprefs.accesskey;"
             oncommand="EnigAdvPrefWindow();" />

        <menuitem id="enigmail_console"
             label="&enigmail.viewconsole.label;"
             accesskey="&enigmail.viewconsole.accesskey;"
             oncommand="EnigViewConsole();" />

        <menuitem id="enigmail_debug_log"
             label="&enigmail.viewdebuglog.label;"
             accesskey="&enigmail.viewdebuglog.accesskey;"
             oncommand="EnigViewDebugLog();" />

        <menuseparator/>

        <menuitem id="enigmail_keygen"
             label="&enigmail.generatekey.label;"
             accesskey="&enigmail.generatekey.accesskey;"
             oncommand="EnigKeygen();" />

        <menuitem id="enigmail_upgrade"
             label="&enigmail.upgrade.label;"
             accesskey="&enigmail.upgrade.accesskey;"
             oncommand="EnigUpgrade();" />

        <menuitem id="enigmail_help"
             label="&enigmail.help.label;"
             accesskey="&enigmail.help.accesskey;"
             oncommand="EnigHelpWindow('messenger');" />

        <menuitem id="enigmail_about"
             label="&enigmail.about.label;"
             accesskey="&enigmail.about.accesskey;"
             oncommand="EnigViewAbout();" />

      </menupopup>
    </menu>

  </menubar>

  <toolbox id="mailToolbarToolbox">
    <toolbar id="msgToolbar" persist="collapsed">
      <hbox id="toolbar_button_box">

         <toolbarbutton class="toolbarbutton-1"
                 id="button-enigmail-decrypt"
                 label="&enigmail.decryptbutton.label;"
                 tooltip="aTooltip" tooltiptext="&enigmail.decryptbutton.tip;" 
                 oncommand="enigMessageDecrypt();"
                 insertafter="button-newmsg"
                 />

         <toolbarseparator class="toolbarseparator-primary"
                 insertafter="button-newmsg"
                 />

       </hbox>
    </toolbar>
  </toolbox>

  <vbox id="messagepanebox">
    <box id="expandedEnigmailBox" class="headerBox"
          position="1"
          collapsed="true">
       <hbox id="expandedEnigmailStatusBox" class="headerNameBox" align="start">
         <label class="headerName" value="Enigmail: " flex="1"/>
       </hbox>
       <label id="expandedEnigmailStatusText" class="headerValue" flex="1">*</label>
    </box>
  </vbox>

  <popup id="attachmentListContext" onpopupshowing="return enigOnShowAttachmentContextMenu();">
    <menuseparator/>
    <menuitem id="enigmail_ctxDecryptOpen"
      label="&enigmail.ctxDecryptOpen.label;"
      accesskey="&enigmail.ctxDecryptOpen.accesskey;"
      oncommand="enigHandleAttachmentSel('openAttachment');"/>
    <menuitem id="enigmail_ctxDecryptSave"
      label="&enigmail.ctxDecryptSave.label;"
      accesskey="&enigmail.ctxDecryptSave.accesskey;"
      oncommand="enigHandleAttachmentSel('saveAttachment');"/>
  </popup>

</overlay>
