<?xml version="1.0"?>

<!--
   The contents of this file are subject to the Mozilla Public
   License Version 1.1 (the "MPL"); you may not use this file
   except in compliance with the MPL. You may obtain a copy of
   the MPL at http://www.mozilla.org/MPL/

   Software distributed under the MPL is distributed on an "AS
   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
   implied. See the MPL for the specific language governing
   rights and limitations under the MPL.

   The Original Code is Enigmail.

   The Initial Developer of the Original Code is Ramalingam Saravanan.
   Portions created by Ramalingam Saravanan <svn@xmlterm.org> are
   Copyright (C) 2001 Ramalingam Saravanan. All Rights Reserved.

   Contributor(s):
   Patrick Brunschwig <patrick.brunschwig@gmx.net>

   Alternatively, the contents of this file may be used under the
   terms of the GNU General Public License (the "GPL"), in which case
   the provisions of the GPL are applicable instead of
   those above. If you wish to allow use of your version of this
   file only under the terms of the GPL and not to allow
   others to use your version of this file under the MPL, indicate
   your decision by deleting the provisions above and replace them
   with the notice and other provisions required by the GPL.
   If you do not delete the provisions above, a recipient
   may use your version of this file under either the MPL or the
   GPL.
-->

<!--
  This is the overlay that adds a menu and some PGP buttons
  to messenger mail reading 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"/>

  <commandset id="mailToolbarItems">
    <command id="button_enigmail_decrypt"/>
  </commandset>

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

      <menupopup id="menu_EnigmailPopup"
        onpopupshowing="enigUpdateOptionsDisplay();">
             
        <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(true,'seamonkey');" />

        <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_reload_msg"
             label="&enigmail.reload.label;"
             accesskey="&enigmail.reload.accesskey;"
             oncommand="ReloadWithAllParts();" />

        <menuseparator/>

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

        <menuitem id="enigmail_RulesEditor"
            label="&enigmail.editRules.label;"
            accesskey="&enigmail.editRules.accesskey;"
            oncommand="EnigRulesEditor();"/>

        <menuseparator/>

        <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>


<!-- Thunderbird -->
  <menubar id="mail-menubar">
    <menu id="menu_Enigmail"
          label="Enigmail"
          accesskey="&enigmail.messengermenu.accesskey;"
          insertbefore="tasksMenu">

      <menupopup id="menu_EnigmailPopup"
        onpopupshowing="enigUpdateOptionsDisplay();">

        <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(true,'thunderbird');" />

        <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_reload_msg"
             label="&enigmail.reload.label;"
             accesskey="&enigmail.reload.accesskey;"
             oncommand="ReloadWithAllParts();" />

        <menuseparator/>

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

        <menuitem id="enigmail_RulesEditor"
            label="&enigmail.editRules.label;"
            accesskey="&enigmail.editRules.accesskey;"
            oncommand="EnigRulesEditor();"/>

        <menuseparator/>

<!--
        <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>

<!-- Seamonkey part -->
 <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();"
                buttontype="seamonkey"
                insertafter="button-newmsg"
                />

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

<!-- Thunderbird part -->
   <toolbarpalette id="MailToolbarPalette">
      <toolbarbutton class="toolbarbutton-1"
              id="button-enigmail-decrypt"
              label="&enigmail.decryptbutton.label;"
              tooltiptext="&enigmail.decryptbutton.tip;"
              oncommand="enigMessageDecrypt();"
              buttontype="thunderbird"
              insertafter="button-newmsg"
              />
  </toolbarpalette>

  <!-- override default set to include enigmail decrypt icon -->
  <toolbar id="mail-bar"
           defaultset="button-getmsg,button-newmsg,button-address,spacer,button-enigmail-decrypt,spacer,spacer,button-reply,button-replyall,button-forward,spacer,spacer,spacer,button-delete,button-junk,button-print,button-stop,spring,throbber-box">
  </toolbar>

  <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="enigmailHeaderBoxLabelSignatureOk" 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>


  <statusbar id="status-bar">
    <hbox id="enigmail-status-bar"
          insertafter="totalMessageCount">
      <statusbarpanel id="enigmail-signed-status"
        class="statusbarpanel-iconic"
        collapsed="true" oncommand="enigViewSecurityInfo();"/>
      <statusbarpanel id="enigmail-encrypted-status"
        class="statusbarpanel-iconic"
        collapsed="true" oncommand="enigViewSecurityInfo();"/>
    </hbox>
  </statusbar>
</overlay>
