package AutodocSupport::GenerateRTF;

###############################################################################
###############################################################################
##
##    Written by Adam Swift (c) 1995 by Information Technology Solutions
##                           All rights reserved.
##
##	  This notice may not be removed from this source code.
##
##    This program is included in the MiscKit by permission from the author
##    and its use is governed by the MiscKit license, found in the file
##    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
##    for a list of all applicable permissions and restrictions.
##
##    Because the AutoDoc is licensed free of charge, there is no warranty 
##    for the program.  Copyright holder, Information Technology Solutions, 
##    is providing this program "as is" and 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.
##
###############################################################################
###############################################################################

require 5.000;
require Exporter;

@ISA      = qw(Exporter);
@EXPORT   = qw(rtf_fileheader
	       rtf_filefooter
	       rtf_fonttable
	       rtf_stylesheet
	       generatertf_version);

$module_version = '$Revision: 1.0 $';
$module_version =~ s!(\$\w+: | \$)!!g;
$module_id	= '$Id: GenerateRTF.pm,v 1.0 1995/07/28 16:01:59 aswift Exp $';
$module_id      =~ s!(\$\w+: | \$)!!g;
$module_name	= $module_id;
$module_name	=~ s!^([^\,]+).*$!$1!;

#############################################################################
#
# NAME:       module_version
#
# ACTION:     returns the version number of this module
#
# RETURN:     the module version
#
#############################################################################
sub module_version
{
    return "$module_name (rev-$module_version)";
}

##
# Stupid hack!
##
sub generatertf_version
{
    return module_version();
}

#############################################################################
#
# NAME:       rtf_fileheader
#
# ACTION:     Returns the text group that defines a rtf file header suitible
#             for the documentation format specified by autodoc
#
# RETURN:     The string containing the RTF group defining the file header
#
#############################################################################
sub rtf_fileheader
{
    local ($header);

    $header = '{\rtf0\ansi';
    $header .= '\paperw16228 \paperh18648 \margl-907 \margr0 \margt0 \margb0';

    return $header;
}


#############################################################################
#
# NAME:       rtf_filefooter
#
# ACTION:     Returns the text group that defines a rtf file footer suitible
#             for the documentation format specified by autodoc
#
# RETURN:     The string containing the RTF group defining the file footer
#
#############################################################################
sub rtf_filefooter
{
    local ($footer);

    $footer = '}';

    return $footer;
}


#############################################################################
#
# NAME:       rtf_fonttable
#
# ACTION:     Returns the text group that defines a font table suitible for
#             documentation in Rich Text Format
#
# RETURN:     The string containing the RTF group defining the font table
#
#############################################################################
sub rtf_fonttable
{
    local ($fonttbl);
    
    $fonttbl = '{\fonttbl';
    $fonttbl .= '\f0\fswiss Helvetica;';
    $fonttbl .= '\f1\froman Times;';
    $fonttbl .= '\f2\fmodern Courier;';
    $fonttbl .= '\f3\ftech Symbol;';
    $fonttbl .= '\f4\froman Palantino;}';
    
    return $fonttbl;
}


#############################################################################
#
# NAME:       rtf_stylesheet
#
# ACTION:     Returns the text group that defines a style sheet suitible for
#             documentation in Rich Text Format
#
# RETURN:     The string containing the RTF group defining the style sheet
#
#############################################################################
sub rtf_stylesheet
{
    local ($ss);

    $ss = '{\stylesheet';
    $ss .= '{\s0 \li2116 \fi0 \ri1007 \ql \tx2494 \tx2872 \tx3250   ';
    $ss .= 'Body;}';
    $ss .= '{\s1 \li2493 \fi0 \ri1007 \ql \tx2872 \tx3250 \tx3642   ';
    $ss .= 'BodyIndented;}';
    $ss .= '{\s2 \li2493 \fi-376 \ri1007 \ql \tx2494 \tx2872 \tx3250   ';
    $ss .= 'BulletLong;}';
    $ss .= '{\s3 \li2494 \fi-378 \ri1007 \ql   ';
    $ss .= 'BulletShort;}';
    $ss .= '{\s4 \li4888 \fi-2771 \ri1007 \ql \tx4888   ';
    $ss .= 'CategoryOf;}';
    $ss .= '{\s5 \li2116 \fi0 \ri1007 \ql   ';
    $ss .= 'ClassName;}';
    $ss .= '{\s6 \li2494 \fi0 \ri1007 \ql   ';
    $ss .= 'CodeExamp;}';
    $ss .= '{\s7 \li2872 \fi0 \ri1007 \ql   ';
    $ss .= 'CodeExamp2;}';
    $ss .= '{\s8 \li2116 \fi0 \ri1007 \ql   ';
    $ss .= 'CodeExampNoInd;}';
    $ss .= '{\s9 \li4888 \fi-2771 \ri1007 \ql \tx4888   ';
    $ss .= 'ConformsTo;}';
    $ss .= '{\s10 \li4888 \fi-2771 \ri1007 \ql   ';
    $ss .= 'DeclaredIn;}';
    $ss .= '{\s11 \li6148 \fi-4031 \ri1007 \ql \tx6148 \tx9676 \tx10180   ';
    $ss .= 'FirstVar/TypeLine1;}';
    $ss .= '{\s12 \li0 \fi0 \ri0 \ql \tx-25 \tx8290 \tx9172   ';
    $ss .= 'Footer;}';
    $ss .= '{\s13 \li1360 \fi0 \ri1007 \ql   ';
    $ss .= 'Heading;}';
    $ss .= '{\s14 \li4888 \fi-2771 \ri1007 \ql \tx4888   ';
    $ss .= 'ImplementedBy;}';
    $ss .= '{\s15 \li2116 \fi0 \ri1007 \ql   ';
    $ss .= 'Important;}';
    $ss .= '{\s16 \li4888 \fi-2771 \ri1007 \ql \tx4888   ';
    $ss .= 'Incorporates;}';
    $ss .= '{\s17 \li4888 \fi-2771 \ri1007 \ql   ';
    $ss .= 'InheritsFrom;}';
    $ss .= '{\s18 \li2116 \fi0 \ri1007 \ql \tx2872   ';
    $ss .= 'InstanceVar;}';
    $ss .= '{\s19 \li2493 \fi-376 \ri1007 \ql   ';
    $ss .= 'Method;}';
    $ss .= '{\s20 \li3249 \fi-756 \ri1007 \ql   ';
    $ss .= 'MethodDesc;}';
    $ss .= '{\s21 \li2493 \fi-376 \ri1007 \ql   ';
    $ss .= 'MethodFirst;}';
    $ss .= '{\s22 \li2116 \fi0 \ri1007 \ql   ';
    $ss .= 'Note;}';
    $ss .= '{\s23 \li2493 \fi-376 \ri1007 \ql \tx2494 \tx2872 \tx3250   ';
    $ss .= 'Num1Long;}';
    $ss .= '{\s24 \li2494 \fi-378 \ri1007 \ql   ';
    $ss .= 'Num1Short;}';
    $ss .= '{\s25 \li2493 \fi-376 \ri1007 \ql   ';
    $ss .= 'NumLong;}';
    $ss .= '{\s26 \li2494 \fi-378 \ri1007 \ql   ';
    $ss .= 'NumShort;}';
    $ss .= '{\s27 \li2116 \fi0 \ri1007 \ql   ';
    $ss .= 'SeeAlso;}';
    $ss .= '{\s28 \li2493 \fi-376 \ri1007 \ql   ';
    $ss .= 'Step;}';
    $ss .= '{\s29 \li2493 \fi-376 \ri1007 \ql   ';
    $ss .= 'Step1;}';
    $ss .= '{\s30 \li2116 \fi0 \ri1007 \ql   ';
    $ss .= 'SubHeading;}';
    $ss .= '{\s31 \li2494 \fi0 \ri1007 \ql \tx6148 \tx10180   ';
    $ss .= 'TableBody1;}';
    $ss .= '{\s32 \li6148 \fi-3654 \ri1007 \ql \tx6148 \tx10432   ';
    $ss .= 'TableBody2;}';
    $ss .= '{\s33 \li2493 \fi0 \ri1007 \ql \tx6148 \tx10180   ';
    $ss .= 'TableHead;}';
    $ss .= '{\s34 \li6652 \fi-503 \ri1007 \ql \tx9676 \tx10180   ';
    $ss .= 'Var/Type;}';
    $ss .= '{\s35 \li6148 \fi-4031 \ri1007 \ql \tx6148 \tx9676 \tx10180   ';
    $ss .= 'Var/TypeLine1;}';
    $ss .= '{\s36 \li2116 \fi-2015 \ri1007 \ql \tx806 \tx2116   ';
    $ss .= 'Warning;}';
    $ss .= '}';
    return $ss;
}


1;
