<?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 PGP buttons to the
  messenger compose window
-->

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

<!DOCTYPE window [
<!ENTITY % enigmailDTD SYSTEM "chrome://enigmail/locale/enigmail.dtd" >
%enigmailDTD;
<!ENTITY % messengercomposeDTD SYSTEM "chrome://messenger/locale/messengercompose/messengercompose.dtd" >
%messengercomposeDTD;
]>

<overlay id="enigMsgComposeOverlay"
    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/enigmailMsgComposeHelper.js"/>
  <script type="application/x-javascript" src="chrome://enigmail/content/enigmailMsgComposeOverlay.js"/>

  <popupset id="aTooltipSet"/>

  <keyset id="tasksKeys">
    <key id="key_enigSign" key="&enigmail.signedsend.key;"
         oncommand="enigSetSendMode('toggle-sign')" modifiers="accel, shift"/>
    <key id="key_enigEncrypt" key="&enigmail.encryptedsend.key;"
         oncommand="enigSetSendMode('toggle-encrypt')" modifiers="accel, shift"/>
  </keyset>

<!-- Seamonkey -->
  <menubar id="compose-menubar">

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

        <menupopup id="menu_EnigmailPopup"
                   onpopupshowing="enigSetMenuSettings('')">

          <menuitem id="enigmail_signed_send"
              type="checkbox"
              label="&enigmail.signedsend.label;"
              accesskey="&enigmail.signedsend.accesskey;"
              key="key_enigSign"
              oncommand="enigDoPgpButton('toggle-sign');" />

          <menuitem id="enigmail_encrypted_send"
              type="checkbox"
              label="&enigmail.encryptedsend.label;"
              accesskey="&enigmail.encryptedsend.accesskey;"
              key="key_enigEncrypt"
              oncommand="enigDoPgpButton('toggle-encrypt');" />

          <menuseparator/>

          <menuitem id="enigmail_sendPGPMime"
              type="checkbox"
              checked="false"
              label="&enigmail.sendPGPMime.label;"
              accesskey="&enigmail.sendPGPMime.accesskey;"
              oncommand="enigDoPgpButton('togglePGPMime');" />

          <menuseparator/>

          <menu id="enigmail_compose_options_menu"
                label="&enigmail.composeOptionsMenu.label;"
                accesskey="&enigmail.composeOptionsMenu.accesskey;">

            <menupopup>

              <menuitem id="enigmail_accountSettings"
                label="&enigmail.pgpAccountSettings.label;"
                accesskey="&enigmail.pgpAccountSettings.accesskey;"
                oncommand="enigGoAccountManager();" />

              <menuseparator/>

              <menuitem id="enigmail_defaultSendOpts"
                label="&enigmail.sendOptionsMenu.label;"
                accesskey="&enigmail.sendOptionsMenu.accesskey;"
                oncommand="EnigPrefWindow(true, 'seamonkey', 'sendTab');" />

              <menuitem id="enigmail_defaultKeySelOpts"
                label="&enigmail.defaultKeySelOpts.label;"
                accesskey="&enigmail.defaultKeySelOpts.accesskey;"
                oncommand="EnigPrefWindow(true, 'seamonkey', 'keySelTab');" />

            <menuitem id="enigmail_mime_options_menu"
                  label="&enigmail.mimeOptionsMenu.label;"
                  accesskey="&enigmail.mimeOptionsMenu.accesskey;"
                  oncommand="EnigPrefWindow(true, 'seamonkey', 'pgpMimeTab');"/>
            </menupopup>
          </menu>

          <menuseparator/>

          <menuitem id="enigmail_undo_encryption"
              label="&enigmail.undoencryption.label;"
              accesskey="&enigmail.undoencryption.accesskey;"
              oncommand="enigUndoEncryption();" />

          <menuitem id="enigmail_insert_key"
              label="&enigmail.insertkey.label;"
              accesskey="&enigmail.insertkey.accesskey;"
              oncommand="enigInsertKey();" />

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

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

          <menuseparator/>

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

        </menupopup>
      </menu>

  </menubar>



<!-- Thunderbird -->

  <menubar id="mail-menubar">

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

        <menupopup id="menu_EnigmailPopup"
                   onpopupshowing="enigSetMenuSettings('')">

          <menuitem id="enigmail_signed_send"
              type="checkbox"
              label="&enigmail.signedsend.label;"
              accesskey="&enigmail.signedsend.accesskey;"
              key="key_enigSign"
              oncommand="enigDoPgpButton('toggle-sign');" />

          <menuitem id="enigmail_encrypted_send"
              type="checkbox"
              label="&enigmail.encryptedsend.label;"
              accesskey="&enigmail.encryptedsend.accesskey;"
              key="key_enigEncrypt"
              oncommand="enigDoPgpButton('toggle-encrypt');" />

          <menuseparator/>

          <menuitem id="enigmail_sendPGPMime"
              type="checkbox"
              checked="false"
              label="&enigmail.sendPGPMime.label;"
              accesskey="&enigmail.sendPGPMime.accesskey;"
              oncommand="enigDoPgpButton('togglePGPMime');" />

          <menuseparator/>

          <menu id="enigmail_compose_options_menu"
                label="&enigmail.composeOptionsMenu.label;"
                accesskey="&enigmail.composeOptionsMenu.accesskey;">

            <menupopup>

              <menuitem id="enigmail_accountSettings"
                label="&enigmail.pgpAccountSettings.label;"
                accesskey="&enigmail.pgpAccountSettings.accesskey;"
                oncommand="enigGoAccountManager();" />

              <menuseparator/>

              <menuitem id="enigmail_defaultSendOpts"
                label="&enigmail.sendOptionsMenu.label;"
                accesskey="&enigmail.sendOptionsMenu.accesskey;"
                oncommand="EnigPrefWindow(true, 'thunderbird', 'sendTab');" />

              <menuitem id="enigmail_defaultKeySelOpts"
                label="&enigmail.defaultKeySelOpts.label;"
                accesskey="&enigmail.defaultKeySelOpts.accesskey;"
                oncommand="EnigPrefWindow(true, 'thunderbird', 'keySelTab');" />

            <menuitem id="enigmail_mime_options_menu"
                  label="&enigmail.mimeOptionsMenu.label;"
                  accesskey="&enigmail.mimeOptionsMenu.accesskey;"
                  oncommand="EnigPrefWindow(true, 'thunderbird', 'pgpMimeTab');"/>
            </menupopup>
          </menu>

          <menuseparator/>

          <menuitem id="enigmail_undo_encryption"
              label="&enigmail.undoencryption.label;"
              accesskey="&enigmail.undoencryption.accesskey;"
              oncommand="enigUndoEncryption();" />

          <menuitem id="enigmail_insert_key"
              label="&enigmail.insertkey.label;"
              accesskey="&enigmail.insertkey.accesskey;"
              oncommand="enigInsertKey();" />

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

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

          <menuseparator/>

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

        </menupopup>
      </menu>

  </menubar>

<!-- Seamonkey -->
    <hbox id="toolbar_button_box">
   <!-- for compatibility reasons (themes) the button name is unchanged
          and doesn't match the action anymore ... -->
       <toolbarbutton class="toolbarbutton-1"
               id="button-enigmail-send"
               label="&enigmail.securitybutton.label;"
               tooltiptext="&enigmail.securitybutton.tip;"
               insertbefore="saveSeparator"
               buttontype="seamonkey"
               type="menu-button"
               oncommand="enigDoPgpButton();">

          <menupopup onpopupshowing="enigSetMenuSettings('2')">
            <menuitem id="enigmail_signed_send2"
                type="checkbox"
                label="&enigmail.signedsend.label;"
                accesskey="&enigmail.signedsend.accesskey;"
                key="key_enigSign"
                oncommand="enigNextCommand('toggle-sign');" />

            <menuitem id="enigmail_encrypted_send2"
                type="checkbox"
                label="&enigmail.encryptedsend.label;"
                accesskey="&enigmail.encryptedsend.accesskey;"
                key="key_enigEncrypt"
                oncommand="enigNextCommand('toggle-encrypt');" />

            <menuseparator/>

            <menuitem id="enigmail_sendPGPMime2"
                type="checkbox"
                checked="false"
                label="&enigmail.sendPGPMime.label;"
                accesskey="&enigmail.sendPGPMime.accesskey;"
                oncommand="enigNextCommand('togglePGPMime');" />

          </menupopup>
       </toolbarbutton>
    </hbox>

<!-- Thunderbird -->
  <toolbarpalette id="MsgComposeToolbarPalette">
    <!-- for compatibility reasons (themes) the button name is unchanged
          and doesn't match the action anymore ... -->
    <toolbarbutton class="toolbarbutton-1"
            id="button-enigmail-send"
            type="menu-button"
            label="&enigmail.securitybutton.label;"
            buttontype="thunderbird"
            tooltip="aTooltipSet"
            tooltiptext="&enigmail.securitybutton.tip;"
            oncommand="enigDoPgpButton();">

        <menupopup onpopupshowing="enigSetMenuSettings('3')">
          <menuitem id="enigmail_signed_send3"
              type="checkbox"
              label="&enigmail.signedsend.label;"
              accesskey="&enigmail.signedsend.accesskey;"
              key="key_enigSign"
              oncommand="enigNextCommand('toggle-sign');" />

          <menuitem id="enigmail_encrypted_send3"
              type="checkbox"
              label="&enigmail.encryptedsend.label;"
              accesskey="&enigmail.encryptedsend.accesskey;"
              key="key_enigEncrypt"
              oncommand="enigNextCommand('toggle-encrypt');" />

          <menuseparator/>

          <menuitem id="enigmail_sendPGPMime3"
              type="checkbox"
              checked="false"
              label="&enigmail.sendPGPMime.label;"
              accesskey="&enigmail.sendPGPMime.accesskey;"
              oncommand="enigNextCommand('togglePGPMime');" />

        </menupopup>
    </toolbarbutton>
  </toolbarpalette>

  <toolbar id="composeToolbar"
          defaultset="button-send,spacer,button-address,spacer,spellingButton,spacer,button-attach,button-enigmail-send,spacer,button-security,spacer,button-save,spring,throbber-box">
  </toolbar>

  <statusbar id="status-bar">
    <hbox id="enigmail-status-bar"
          insertafter="totalMessageCount">
      <statusbarpanel id="enigmail-signed-status"
        class="statusbarpanel-iconic"
        collapsed="true" onclick="enigHandleClick(event,'toggle-sign');"/>
      <statusbarpanel id="enigmail-encrypted-status"
        class="statusbarpanel-iconic"
        collapsed="true" onclick="enigHandleClick(event, 'toggle-encrypt');"/>
    </hbox>
  </statusbar>

</overlay>
