• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KMIME Library

kmime_codec_qp.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-
00002     kmime_codec_qp.h
00003 
00004     KMime, the KDE internet mail/usenet news message library.
00005     Copyright (c) 2001-2002 Marc Mutz <mutz@kde.org>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, USA.
00021 */
00046 #ifndef __KMIME_CODEC_QP__
00047 #define __KMIME_CODEC_QP__
00048 
00049 #include "kmime_codecs.h"
00050 
00051 namespace KMime {
00052 
00058 class KMIME_EXPORT QuotedPrintableCodec : public Codec
00059 {
00060   protected:
00061     friend class Codec;
00065     QuotedPrintableCodec() : Codec() {}
00066 
00067   public:
00071     virtual ~QuotedPrintableCodec() {}
00072 
00077     const char *name() const
00078       { return "quoted-printable"; }
00079 
00084     int maxEncodedSizeFor( int insize, bool withCRLF=false ) const
00085       { // all chars encoded:
00086         int result = 3*insize;
00087         // then after 25 hexchars comes a soft linebreak: =(\r)\n
00088         result += (withCRLF ? 3 : 2) * (insize / 25);
00089 
00090         return result;
00091       }
00092 
00097     int maxDecodedSizeFor( int insize, bool withCRLF=false ) const;
00098 
00103     Encoder *makeEncoder( bool withCRLF=false ) const;
00104 
00109     Decoder *makeDecoder( bool withCRLF=false ) const;
00110 };
00111 
00117 class KMIME_EXPORT Rfc2047QEncodingCodec : public Codec
00118 {
00119   protected:
00120     friend class Codec;
00124     Rfc2047QEncodingCodec() : Codec() {}
00125 
00126   public:
00130     virtual ~Rfc2047QEncodingCodec() {}
00131 
00136     const char *name() const
00137       { return "q"; }
00138 
00143     int maxEncodedSizeFor( int insize, bool withCRLF=false ) const
00144       {
00145         Q_UNUSED( withCRLF );
00146         // this one is simple: We don't do linebreaking, so all that can
00147         // happen is that every char needs encoding, so:
00148         return 3 * insize;
00149       }
00150 
00155     int maxDecodedSizeFor( int insize, bool withCRLF=false ) const;
00156 
00161     Encoder *makeEncoder( bool withCRLF=false ) const;
00162 
00167     Decoder *makeDecoder( bool withCRLF=false ) const;
00168 };
00169 
00174 class KMIME_EXPORT Rfc2231EncodingCodec : public Codec
00175 {
00176   protected:
00177     friend class Codec;
00181     Rfc2231EncodingCodec() : Codec() {}
00182 
00183   public:
00187     virtual ~Rfc2231EncodingCodec() {}
00188 
00193     const char *name() const
00194       { return "x-kmime-rfc2231"; }
00195 
00200     int maxEncodedSizeFor( int insize, bool withCRLF=false ) const
00201       {
00202         Q_UNUSED( withCRLF );
00203         // same as for "q" encoding:
00204         return 3 * insize;
00205       }
00206 
00211     int maxDecodedSizeFor( int insize, bool withCRLF=false ) const;
00212 
00217     Encoder *makeEncoder( bool withCRLF=false ) const;
00218 
00223     Decoder *makeDecoder( bool withCRLF=false ) const;
00224 };
00225 
00226 } // namespace KMime
00227 
00228 #endif // __KMIME_CODEC_QP__

KMIME Library

Skip menu "KMIME Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.8
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal