src/include/common/spds/BodyPart.h

00001 /*
00002  * Copyright (C) 2003-2007 Funambol
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 as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  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 Apr 27 12:29:18 2007 for Funambol C++ Client Library by  doxygen 1.5.2