-// in case we're compiling in non-GUI mode
-class WXDLLEXPORT wxIcon;
-
-// ----------------------------------------------------------------------------
-// constants
-// ----------------------------------------------------------------------------
-
-// MIME code tracing mask
-#define TRACE_MIME _T("mime")
-
-// ----------------------------------------------------------------------------
-// private functions
-// ----------------------------------------------------------------------------
-
-// there are some fields which we don't understand but for which we don't give
-// warnings as we know that they're not important - this function is used to
-// test for them
-static bool IsKnownUnimportantField(const wxString& field);
-
-// ----------------------------------------------------------------------------
-// private classes
-// ----------------------------------------------------------------------------
-
-// This class uses both mailcap and mime.types to gather information about file
-// types.
-//
-// The information about mailcap file was extracted from metamail(1) sources
-// and documentation and subsequently revised when I found the RFC 1524
-// describing it.
-//
-// Format of mailcap file: spaces are ignored, each line is either a comment
-// (starts with '#') or a line of the form <field1>;<field2>;...;<fieldN>.
-// A backslash can be used to quote semicolons and newlines (and, in fact,
-// anything else including itself).
-//
-// The first field is always the MIME type in the form of type/subtype (see RFC
-// 822) where subtype may be '*' meaning "any". Following metamail, we accept
-// "type" which means the same as "type/*", although I'm not sure whether this
-// is standard.
-//
-// The second field is always the command to run. It is subject to
-// parameter/filename expansion described below.
-//
-// All the following fields are optional and may not be present at all. If
-// they're present they may appear in any order, although each of them should
-// appear only once. The optional fields are the following:
-//  * notes=xxx is an uninterpreted string which is silently ignored
-//  * test=xxx is the command to be used to determine whether this mailcap line
-//    applies to our data or not. The RHS of this field goes through the
-//    parameter/filename expansion (as the 2nd field) and the resulting string
-//    is executed. The line applies only if the command succeeds, i.e. returns 0
-//    exit code.
-//  * print=xxx is the command to be used to print (and not view) the data of
-//    this type (parameter/filename expansion is done here too)
-//  * edit=xxx is the command to open/edit the data of this type
-//  * needsterminal means that a new interactive console must be created for
-//    the viewer
-//  * copiousoutput means that the viewer doesn't interact with the user but
-//    produces (possibly) a lof of lines of output on stdout (i.e. "cat" is a
-//    good example), thus it might be a good idea to use some kind of paging
-//    mechanism.
-//  * textualnewlines means not to perform CR/LF translation (not honored)
-//  * compose and composetyped fields are used to determine the program to be
-//    called to create a new message pert in the specified format (unused).
-//
-// Parameter/filename expansion:
-//  * %s is replaced with the (full) file name
-//  * %t is replaced with MIME type/subtype of the entry
-//  * for multipart type only %n is replaced with the nnumber of parts and %F is
-//    replaced by an array of (content-type, temporary file name) pairs for all
-//    message parts (TODO)
-//  * %{parameter} is replaced with the value of parameter taken from
-//    Content-type header line of the message.
-//
-//
-// There are 2 possible formats for mime.types file, one entry per line (used
-// for global mime.types and called Mosaic format) and "expanded" format where
-// an entry takes multiple lines (used for users mime.types and called
-// Netscape format).
-//
-// For both formats spaces are ignored and lines starting with a '#' are
-// comments. Each record has one of two following forms:
-//  a) for "brief" format:
-//      <mime type>  <space separated list of extensions>
-//  b) for "expanded" format:
-//      type=<mime type> \ 
-//      desc="<description>" \ 
-//      exts="<comma separated list of extensions>"
-//
-// We try to autodetect the format of mime.types: if a non-comment line starts
-// with "type=" we assume the second format, otherwise the first one.
-
-// there may be more than one entry for one and the same mime type, to
-// choose the right one we have to run the command specified in the test
-// field on our data.
-class MailCapEntry