src/include/common/spds/BodyPart.h

00001 /*
00002  * Copyright (C) 2003-2007 Funambol, Inc
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 2 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00016  * 02111-1307  USA
00017  */
00018 #ifndef INCL_BODY_PART
00019 #define INCL_BODY_PART
00020 
00022 #include "base/util/ArrayElement.h"
00023 #include "base/util/StringBuffer.h"
00024 
00025 class BodyPart : public ArrayElement {
00026     private:
00027         StringBuffer mimeType;
00028         StringBuffer encoding;
00029         StringBuffer charset;
00030         StringBuffer content;
00031         StringBuffer disposition;
00032         StringBuffer name;
00033         StringBuffer filename;
00034 
00035     public:
00036 
00037         BodyPart();
00038 
00039         // The mime type as specified by MIME standard
00040         const char *getMimeType() const ;
00041         void setMimeType(const char *type) ;
00042 
00043         // The character set: UTF-8
00044         const char *getCharset() const ;
00045         void setCharset(const char *cs) ;
00046 
00047         // The content encoding: 7bit, 8bit, base64, quoted-printable
00048         const char *getEncoding() const ;
00049         void setEncoding(const char *type) ;
00050 
00051         // The content is the real content for the body
00052         // or a path name to a temp file for the attachment
00053         const char *getContent() const ;
00054         void setContent(const char *cont) ;
00055 
00056         void appendContent(const char *text);
00057 
00058         // For multipart message.
00059         // Values: inline, attachment
00060         const char *getDisposition() const ;
00061         void setDisposition(const char *type) ;
00062 
00063         // For multipart message.
00064         // It is the name of the file attached (without path)
00065         const char *getFilename() const ;
00066         void setFilename(const char *type) ;
00067 
00068         // For multipart message.
00069         // It is the visible name of the attachement (can be the subject
00070         // of an attached mail, for instance)
00071         const char *getName() const ;
00072         void setName(const char *type) ;
00073 
00074                 ArrayElement* clone() ;
00075 };
00076 
00078 #endif
00079 

Generated on Fri Jun 15 11:38:29 2007 for Funambol C++ Client Library by  doxygen 1.5.2