### Copyright (C) 1996 Rasmus Ingemann Hansen
### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.
###
### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


proc textencoding {} {
    # Editing / Textencoding
    Desc "Encoding to Content-Transfer-Encoding header"
    ShortDesc "Textencoding"

### textencoding ###
    Header head1 \
	-text "Textencoding for your outgoing messages" \
	-background gray

    Radio textencodeRadio1 \
	-text "How MIME capable readers should decode your mail:" \
	-entryhelp {
		"7bit" "Implies no encoding" \
		"8bit" "Implies no encoding" \
		"base64" "Metamail has a program called \"mimeencode\" that you can use to turn your message into a base64/quoted-printable encoded message." \
		"quoted-printable" "Metamail has a program called \"mimeencode\" that you can use to turn your message into a base64/quoted-printable encoded message." \
	} \
	-packFrame:fill x

    foreach widget { head1 textencodeRadio1 } {
	Help $widget "(Option available in Elm Ver2.4 PL23 & PL24 only.) MIME, Multipurpose Internet Mail Extension (RFC 1341), provides a way to attach postscript(.ps), graphics(.jpeg), video(.mpeg), ..., and binary. This enables (non US citizens) to use their local characters above the 128 charcters (8bit). Notice that Elm doesn't look at this value; it is just placed in your outgoing mail headers."
    }

  ############################### ShowPage ################################
    ShowPage {
	if {[set version@versionRadio2(index)]==2} {
		Disable textencodeRadio1
	} else {
		Enable textencodeRadio1
	}
    }

  ################################ Change #################################
    Change {

    }

  ############################## Init / Save ##############################

    Init {
    }

    Save {
	print "\n# Type of encoding to be put into the MIME Content-Transfer-Encoding header.\n# Usual values are 7bit or 8bit."
	if {$textencodeRadio1(index)==0} {
		print "textencoding = 7bit"
	} elseif {$textencodeRadio1(index)==1} {
		print "###textencoding = 8bit"
	} elseif {$textencodeRadio1(index)==2} {
		print "textencoding = base64"
	} else {
		print "textencoding = quoted-printable"
	}
    }
}



