2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
27 * $XConsortium: RFCFormat.hh /main/4 1996/04/02 16:20:29 mgreess $
29 * RESTRICTED CONFIDENTIAL INFORMATION:
31 * The information in this document is subject to special
32 * restrictions in a confidential disclosure agreement bertween
33 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
34 * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
35 * Sun's specific written approval. This documment and all copies
36 * and derivative works thereof must be returned or destroyed at
39 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
44 #ifndef I_HAVE_NO_IDENT
50 #include <DtMail/DtMail.hh>
51 #include <DtMail/Buffer.hh>
53 class RFCFormat : public DtCPlusPlusAllocator {
55 RFCFormat(DtMail::Session * session);
58 virtual void msgToBuffer(DtMailEnv & error,
59 DtMail::Message & msg,
60 DtMailBoolean include_content_length,
61 DtMailBoolean include_unix_from,
62 DtMailBoolean process_ignores,
65 //call setIsWriteBcc when log message to files so that the BCC
66 // field will log to those files.
67 void setIsWriteBcc() { _is_write_bcc = DTM_TRUE;}
68 void unsetIsWriteBcc() { _is_write_bcc = DTM_FALSE;}
69 DtMailBoolean getIsWriteBcc() { return _is_write_bcc;}
72 DtMail::Session *_session;
73 DtMailBoolean _use_cr;
74 DtMailBoolean _is_write_bcc; // if log to file: Yes
75 // send out: No (RFC 822)
78 virtual void formatBodies(DtMailEnv & error,
79 DtMail::Message & msg,
80 DtMailBoolean include_content_length,
81 char ** extra_headers,
84 virtual void formatHeaders(DtMailEnv & error,
85 DtMail::Message & msg,
86 DtMailBoolean include_unix_from,
87 const char * extra_headers,
90 void writeHeaders(DtMailEnv & error,
91 DtMail::Message & msg,
92 DtMailBoolean include_unix_from,
93 const char * extra_headers,
94 const char ** suppress_headers,
97 virtual void rfc1522cpy(Buffer & buf, const char * value);
98 void getCharSet(char * charset);
99 void getCharSet(char * charset, char *special);
101 void DtXlateStdToOpLocale(char *op, char *std, char *dflt, char **ret);
102 void DtXlateOpToStdLocale(char *op, char *opLoc, char **retLoc, char **ret_retLang, char **retSet);
103 char *targetTagName();
105 void crlf(Buffer & buf)
107 const char * term = (_use_cr ? "\r\n" : "\n");
108 int len = (_use_cr ? 2 : 1);
109 buf.appendData(term, len);
115 appendString(Buffer & buf, const char * str)
117 buf.appendData(str, strlen(str));