home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / mime.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.0 KB  |  116 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef MIME_H
  20. #define MIME_H
  21.  
  22. #include "ntypes.h"
  23. #include "mimeenc.h"
  24.  
  25. XP_BEGIN_PROTOS
  26.  
  27. extern PUBLIC const char *FE_UsersOrganization(void);
  28.  
  29.  
  30. /* Returns the appropriate contents of a From: field of a mail message
  31.    originating from the current user.  This calls FE_UsersFullName()
  32.    and FE_UsersMailAddress() and correctly munges the values, using
  33.    MSG_MakeFullAddress()
  34.  
  35.    A new string is returned, which you must free when you're done with it.
  36.    */
  37. extern PUBLIC char *MIME_MakeFromField (void);
  38.  
  39. extern PUBLIC void MISC_ValidateSignature (MWContext *context,
  40.                                            const char *sig);
  41.  
  42. /* This does a very rough sanity-check on the return email address specified
  43.    in preferences, and pops up a dialog and returns negative if there is
  44.    something obviously wrong.  MSG_ComposeMessage() calls this, and won't
  45.    let messages be composed until the problem is corrected.  The FEs should
  46.    call this after preferences have been edited as well.
  47.  
  48.    The address should be just the email address, not including the real name.
  49.  */
  50. extern PUBLIC int MISC_ValidateReturnAddress (MWContext *context,
  51.                                               const char *addr);
  52.  
  53.  
  54. /* Convert a block of text to the MIME quoted-printable encoding.
  55.    Returns a new string and its size, or NULL if it couldn't allocate.
  56.  */
  57. extern PUBLIC void MIME_EncodeQuotedPrintableString(const unsigned char *input,
  58.                                                     uint32 input_size,
  59.                                                     unsigned char **output,
  60.                                                     uint32 *output_size);
  61.  
  62. /* Convert a block of text to the MIME base64 encoding.
  63.    Returns a new string and its size, or NULL if it couldn't allocate.
  64.  */
  65. extern PUBLIC void MIME_EncodeBase64String(const unsigned char *input,
  66.                                            uint32 input_size,
  67.                                            unsigned char **output,
  68.                                            uint32 *output_size);
  69.  
  70. /* build a mailto: url address given a to field
  71.  *
  72.  * returns a malloc'd string
  73.  */
  74. extern char *
  75. MIME_BuildMailtoURLAddress(const char * to);
  76.  
  77. /* build a news: url address to post to, given a partial news-post
  78.  * URL and the newsgroups line
  79.  *
  80.  * returns a malloc'd string
  81.  */
  82. extern char *
  83. MIME_BuildNewspostURLAddress(const char *partial_newspost_url,
  84.                              const char *newsgroups);
  85.  
  86. /* If the argument is true, we use quoted-printable encoding on mail and
  87.    news messages which have 8bit characters in them.  Otherwise, we assume
  88.    that the mail and news transport will not strip the eighth bit (a bad
  89.    assumption.) */
  90. extern void MIME_ConformToStandard (XP_Bool conform_p);
  91.  
  92.  
  93. /* Generate headers for a form post to a mailto: URL.
  94.    This lets the URL specify additional headers, but is careful to
  95.    ignore headers which would be dangerous.  It may modify the URL
  96.    (because of CC) so a new URL to actually post to is returned.
  97.  */
  98. extern int MIME_GenerateMailtoFormPostHeaders (const char *old_post_url,
  99.                                                const char *referer,
  100.                                                char **new_post_url_return,
  101.                                                char **headers_return);
  102.  
  103.  
  104. extern NET_StreamClass * 
  105. NET_MimeMakePartialEncodingConverterStream (int          format_out,
  106.                                             void        *data_obj,
  107.                                             URL_Struct  *URL_s,
  108.                                             MWContext   *window_id,
  109.                                             NET_StreamClass *next_stream);
  110.  
  111. extern int MIME_HasAttachments(MWContext *context);
  112.  
  113. XP_END_PROTOS
  114.  
  115. #endif /* mime.h */
  116.