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

KMIME Library

kmime_headers.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-
00002     kmime_headers.h
00003 
00004     KMime, the KDE internet mail/usenet news message library.
00005     Copyright (c) 2001-2002 the KMime authors.
00006     See file AUTHORS for details
00007     Copyright (c) 2006 Volker Krause <vkrause@kde.org>
00008 
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Library General Public
00011     License as published by the Free Software Foundation; either
00012     version 2 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Library General Public License for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with this library; see the file COPYING.LIB.  If not, write to
00021     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022     Boston, MA 02110-1301, USA.
00023 */
00040 #ifndef __KMIME_HEADERS_H__
00041 #define __KMIME_HEADERS_H__
00042 
00043 #include "kmime_export.h"
00044 #include "kmime_header_parsing.h"
00045 
00046 #include <QtCore/QString>
00047 #include <QtCore/QStringList>
00048 #include <QtCore/QRegExp>
00049 #include <QtCore/QDateTime>
00050 #include <QtCore/QMap>
00051 #include <QtCore/QList>
00052 #include <QtCore/QByteArray>
00053 
00054 #include <kdatetime.h>
00055 
00056 namespace KMime {
00057 
00058 class Content;
00059 
00060 namespace Headers {
00061 
00062 class BasePrivate;
00063 
00064 enum contentCategory {
00065   CCsingle,
00066   CCcontainer,
00067   CCmixedPart,
00068   CCalternativePart
00069 };
00070 
00071 enum contentEncoding {
00072   CE7Bit,
00073   CE8Bit,
00074   CEquPr,
00075   CEbase64,
00076   CEuuenc,
00077   CEbinary
00078 };
00079 
00080 enum contentDisposition {
00081   CDInvalid,
00082   CDinline,
00083   CDattachment,
00084   CDparallel
00085 };
00086 
00087 //often used charset
00088 // TODO: get rid of this!
00089 static const QByteArray Latin1( "ISO-8859-1" );
00090 
00091 //@cond PRIVATE
00092 // internal macro to generate default constructors
00093 #define kmime_mk_trivial_ctor( subclass )                               \
00094   public:                                                               \
00095     explicit subclass( Content *parent = 0 );                           \
00096     subclass( Content *parent, const QByteArray &s );                   \
00097     subclass( Content *parent, const QString &s, const QByteArray &charset ); \
00098     ~subclass();
00099 
00100 #define kmime_mk_dptr_ctor( subclass ) \
00101   protected: \
00102     explicit subclass( subclass##Private *d, KMime::Content *parent = 0 );
00103 
00104 #define kmime_mk_trivial_ctor_with_name( subclass )     \
00105   kmime_mk_trivial_ctor( subclass )                     \
00106     const char *type() const;
00107 //@endcond
00108 
00109 //
00110 //
00111 // HEADER'S BASE CLASS. DEFINES THE COMMON INTERFACE
00112 //
00113 //
00114 
00117 class KMIME_EXPORT Base
00118 {
00119   public:
00123     typedef QList<KMime::Headers::Base*> List;
00124 
00128     explicit Base( KMime::Content *parent = 0 );
00129 
00133     virtual ~Base();
00134 
00138     KMime::Content *parent() const;
00139 
00143     void setParent( KMime::Content *parent );
00144 
00149     virtual void from7BitString( const QByteArray &s ) = 0;
00150 
00155     virtual QByteArray as7BitString( bool withHeaderType = true ) const = 0;
00156 
00160     QByteArray rfc2047Charset() const;
00161 
00166     void setRFC2047Charset( const QByteArray &cs );
00167 
00171     QByteArray defaultCharset() const;
00172 
00176     bool forceDefaultCharset() const;
00177 
00183     virtual void fromUnicodeString( const QString &s, const QByteArray &b ) = 0;
00184 
00188     virtual QString asUnicodeString() const = 0;
00189 
00193     virtual void clear() = 0;
00194 
00198     virtual bool isEmpty() const = 0;
00199 
00203     virtual const char *type() const;
00204 
00208     bool is( const char *t ) const;
00209 
00213     bool isMimeHeader() const;
00214 
00218     bool isXHeader() const;
00219 
00220   protected:
00224     QByteArray typeIntro() const;
00225 
00226     //@cond PRIVATE
00227     BasePrivate *d_ptr;
00228     kmime_mk_dptr_ctor( Base )
00229     //@endcond
00230 
00231   private:
00232     Q_DECLARE_PRIVATE(Base)
00233     Q_DISABLE_COPY(Base)
00234 };
00235 
00236 //
00237 //
00238 // GENERIC BASE CLASSES FOR DIFFERENT TYPES OF FIELDS
00239 //
00240 //
00241 
00242 namespace Generics {
00243 
00244 class UnstructuredPrivate;
00245 
00256 // known issues:
00257 // - uses old decodeRFC2047String function, instead of our own...
00258 
00259 class KMIME_EXPORT Unstructured : public Base
00260 {
00261   //@cond PRIVATE
00262   kmime_mk_dptr_ctor( Unstructured )
00263   //@endcond
00264   public:
00265     explicit Unstructured( Content *p = 0 );
00266     Unstructured( Content *p, const QByteArray &s );
00267     Unstructured( Content *p, const QString &s, const QByteArray &cs );
00268     ~Unstructured();
00269 
00270     virtual void from7BitString( const QByteArray &s );
00271     virtual QByteArray as7BitString( bool withHeaderType=true ) const;
00272 
00273     virtual void fromUnicodeString( const QString &s,
00274                                   const QByteArray &b );
00275     virtual QString asUnicodeString() const;
00276 
00277     virtual void clear();
00278 
00279     virtual bool isEmpty() const;
00280 
00281   private:
00282     Q_DECLARE_PRIVATE(Unstructured)
00283 };
00284 
00285 
00286 class StructuredPrivate;
00287 
00318 class KMIME_EXPORT Structured : public Base
00319 {
00320   public:
00321     explicit Structured( Content *p = 0 );
00322     Structured( Content *p, const QByteArray &s );
00323     Structured( Content *p, const QString &s, const QByteArray &cs );
00324     ~Structured();
00325 
00326     virtual void from7BitString( const QByteArray &s );
00327     virtual QString asUnicodeString() const;
00328     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00329 
00330   protected:
00339     virtual bool parse( const char* &scursor, const char *const send,
00340                         bool isCRLF = false ) = 0;
00341 
00342     //@cond PRIVATE
00343     kmime_mk_dptr_ctor( Structured )
00344     //@endcond
00345 
00346   private:
00347     Q_DECLARE_PRIVATE(Structured)
00348 };
00349 
00350 
00351 class AddressPrivate;
00352 
00356 class KMIME_EXPORT Address : public Structured
00357 {
00358   public:
00359     explicit Address( Content *p = 0 );
00360     Address( Content *p, const QByteArray &s );
00361     Address( Content *p, const QString &s, const QByteArray &cs );
00362     ~Address();
00363   protected:
00364     //@cond PRIVATE
00365     kmime_mk_dptr_ctor( Address )
00366     //@endcond
00367   private:
00368     Q_DECLARE_PRIVATE(Address)
00369 };
00370 
00371 
00372 class MailboxListPrivate;
00373 
00380 class KMIME_EXPORT MailboxList : public Address
00381 {
00382   //@cond PRIVATE
00383   kmime_mk_trivial_ctor( MailboxList )
00384   kmime_mk_dptr_ctor( MailboxList )
00385   //@endcond
00386   public:
00387     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00388     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00389     virtual QString asUnicodeString() const;
00390 
00391     virtual void clear();
00392     virtual bool isEmpty() const;
00393 
00399     void addAddress( const Types::Mailbox &mbox );
00400 
00406     void addAddress( const QByteArray &address,
00407                      const QString &displayName = QString() );
00408 
00412     QList<QByteArray> addresses() const;
00413 
00419     QStringList displayNames() const;
00420 
00427     QStringList prettyAddresses() const;
00428 
00432     Types::Mailbox::List mailboxes() const;
00433 
00434   protected:
00435     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00436 
00437   private:
00438     Q_DECLARE_PRIVATE(MailboxList)
00439 };
00440 
00441 
00442 class SingleMailboxPrivate;
00443 
00448 class KMIME_EXPORT SingleMailbox : public MailboxList
00449 {
00450   //@cond PRIVATE
00451   kmime_mk_trivial_ctor( SingleMailbox )
00452   //@endcond
00453   protected:
00454     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00455   private:
00456     Q_DECLARE_PRIVATE(SingleMailbox)
00457 };
00458 
00459 
00460 class AddressListPrivate;
00461 
00473 class KMIME_EXPORT AddressList : public Address
00474 {
00475   //@cond PRIVATE
00476   kmime_mk_trivial_ctor( AddressList )
00477   kmime_mk_dptr_ctor( AddressList )
00478   //@endcond
00479   public:
00480     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00481     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00482     virtual QString asUnicodeString() const;
00483 
00484     virtual void clear();
00485     virtual bool isEmpty() const;
00486 
00492     void addAddress( const Types::Mailbox &mbox );
00493 
00499     void addAddress( const QByteArray &address, const QString &displayName = QString() );
00500 
00504     QList<QByteArray> addresses() const;
00505 
00510     QStringList displayNames() const;
00511 
00517     QStringList prettyAddresses() const;
00518 
00522     Types::Mailbox::List mailboxes() const;
00523 
00524   protected:
00525     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00526 
00527   private:
00528     Q_DECLARE_PRIVATE(AddressList)
00529 };
00530 
00531 
00532 class IdentPrivate;
00533 
00539 class KMIME_EXPORT Ident : public Address
00540 {
00541   //@cond PRIVATE
00542   kmime_mk_trivial_ctor( Ident )
00543   kmime_mk_dptr_ctor( Ident )
00544   //@endcond
00545   public:
00546     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00547     virtual void clear();
00548     virtual bool isEmpty() const;
00549 
00556     QList<QByteArray> identifiers() const;
00557 
00562     void appendIdentifier( const QByteArray &id );
00563 
00564   protected:
00565     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00566 
00567   private:
00568     Q_DECLARE_PRIVATE(Ident)
00569 };
00570 
00571 
00572 class SingleIdentPrivate;
00573 
00579 class KMIME_EXPORT SingleIdent : public Ident
00580 {
00581   //@cond PRIVATE
00582   kmime_mk_trivial_ctor( SingleIdent )
00583   //@endcond
00584   public:
00589     QByteArray identifier() const;
00590 
00595     void setIdentifier( const QByteArray &id );
00596 
00597   protected:
00598     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00599 
00600   private:
00601     Q_DECLARE_PRIVATE(SingleIdent)
00602 };
00603 
00604 
00605 class TokenPrivate;
00606 
00610 class KMIME_EXPORT Token : public Structured
00611 {
00612   //@cond PRIVATE
00613   kmime_mk_trivial_ctor( Token )
00614   kmime_mk_dptr_ctor( Token )
00615   //@endcond
00616   public:
00617     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00618     virtual void clear();
00619     virtual bool isEmpty() const;
00620 
00624     QByteArray token() const;
00625 
00629     void setToken( const QByteArray &t );
00630 
00631   protected:
00632     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00633 
00634   private:
00635     Q_DECLARE_PRIVATE(Token)
00636 };
00637 
00638 
00639 class PhraseListPrivate;
00640 
00644 class KMIME_EXPORT PhraseList : public Structured
00645 {
00646   //@cond PRIVATE
00647   kmime_mk_trivial_ctor( PhraseList )
00648   //@endcond
00649   public:
00650     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00651     virtual QString asUnicodeString() const;
00652     virtual void clear();
00653     virtual bool isEmpty() const;
00654 
00658     QStringList phrases() const;
00659 
00660   protected:
00661     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00662 
00663   private:
00664     Q_DECLARE_PRIVATE(PhraseList)
00665 };
00666 
00667 
00668 class DotAtomPrivate;
00669 
00673 class KMIME_EXPORT DotAtom : public Structured
00674 {
00675   //@cond PRIVATE
00676   kmime_mk_trivial_ctor( DotAtom )
00677   //@endcond
00678   public:
00679     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00680     virtual QString asUnicodeString() const;
00681     virtual void clear();
00682     virtual bool isEmpty() const;
00683 
00684   protected:
00685     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00686 
00687   private:
00688     Q_DECLARE_PRIVATE(DotAtom)
00689 };
00690 
00691 
00692 class ParametrizedPrivate;
00693 
00697 class KMIME_EXPORT Parametrized : public Structured
00698 {
00699   //@cond PRIVATE
00700   kmime_mk_trivial_ctor( Parametrized )
00701   kmime_mk_dptr_ctor( Parametrized )
00702   //@endcond
00703   public:
00704     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00705 
00706     virtual bool isEmpty() const;
00707     virtual void clear();
00708 
00713     QString parameter( const QString &key ) const;
00714 
00720     void setParameter( const QString &key, const QString &value );
00721 
00722   protected:
00723     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00724 
00725   private:
00726     Q_DECLARE_PRIVATE(Parametrized)
00727 };
00728 
00729 } // namespace Generics
00730 
00731 //
00732 //
00733 // INCOMPATIBLE, GSTRUCTURED-BASED FIELDS:
00734 //
00735 //
00736 
00737 class ReturnPathPrivate;
00738 
00744 class KMIME_EXPORT ReturnPath : public Generics::Address
00745 {
00746   //@cond PRIVATE
00747   kmime_mk_trivial_ctor_with_name( ReturnPath )
00748   //@endcond
00749   public:
00750     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00751     virtual void clear();
00752     virtual bool isEmpty() const;
00753 
00754   protected:
00755     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00756 
00757   private:
00758     Q_DECLARE_PRIVATE(ReturnPath)
00759 };
00760 
00761 // Address et al.:
00762 
00763 // rfc(2)822 headers:
00769 class KMIME_EXPORT From : public Generics::MailboxList
00770 {
00771   kmime_mk_trivial_ctor_with_name( From )
00772 };
00773 
00779 class KMIME_EXPORT Sender : public Generics::SingleMailbox
00780 {
00781   kmime_mk_trivial_ctor_with_name( Sender )
00782 };
00783 
00789 class KMIME_EXPORT To : public Generics::AddressList
00790 {
00791   kmime_mk_trivial_ctor_with_name( To )
00792 };
00793 
00799 class KMIME_EXPORT Cc : public Generics::AddressList
00800 {
00801   kmime_mk_trivial_ctor_with_name( Cc )
00802 };
00803 
00809 class KMIME_EXPORT Bcc : public Generics::AddressList
00810 {
00811   kmime_mk_trivial_ctor_with_name( Bcc )
00812 };
00813 
00819 class KMIME_EXPORT ReplyTo : public Generics::AddressList
00820 {
00821   kmime_mk_trivial_ctor_with_name( ReplyTo )
00822 };
00823 
00824 
00825 class MailCopiesToPrivate;
00826 
00832 class KMIME_EXPORT MailCopiesTo : public Generics::AddressList
00833 {
00834   //@cond PRIVATE
00835   kmime_mk_trivial_ctor_with_name( MailCopiesTo )
00836   //@endcond
00837   public:
00838     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00839     virtual QString asUnicodeString() const;
00840 
00841     virtual void clear();
00842     virtual bool isEmpty() const;
00843 
00847     bool alwaysCopy() const;
00848 
00852     void setAlwaysCopy();
00853 
00857     bool neverCopy() const;
00858 
00862     void setNeverCopy();
00863 
00864   protected:
00865     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00866 
00867   private:
00868     Q_DECLARE_PRIVATE(MailCopiesTo)
00869 };
00870 
00871 
00872 class ContentTransferEncodingPrivate;
00873 
00879 class KMIME_EXPORT ContentTransferEncoding : public Generics::Token
00880 {
00881   //@cond PRIVATE
00882   kmime_mk_trivial_ctor_with_name( ContentTransferEncoding )
00883   //@endcond
00884   public:
00885     virtual void clear();
00886 
00890     contentEncoding encoding() const;
00891 
00895     void setEncoding( contentEncoding e );
00896 
00897     bool decoded() const;
00898 
00899     void setDecoded( bool decoded = true );
00900 
00901     bool needToEncode() const;
00902 
00903   protected:
00904     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00905 
00906   private:
00907     Q_DECLARE_PRIVATE(ContentTransferEncoding)
00908 };
00909 
00915 class KMIME_EXPORT Keywords : public Generics::PhraseList
00916 {
00917   kmime_mk_trivial_ctor_with_name( Keywords )
00918 };
00919 
00920 // DotAtom:
00921 
00927 class KMIME_EXPORT MIMEVersion : public Generics::DotAtom
00928 {
00929   kmime_mk_trivial_ctor_with_name( MIMEVersion )
00930 };
00931 
00932 // Ident:
00933 
00939 class KMIME_EXPORT MessageID : public Generics::SingleIdent
00940 {
00941   //@cond PRIVATE
00942   kmime_mk_trivial_ctor_with_name( MessageID )
00943   //@endcond
00944   public:
00949     void generate( const QByteArray &fqdn );
00950 };
00951 
00955 class KMIME_EXPORT ContentID : public Generics::SingleIdent
00956 {
00957   kmime_mk_trivial_ctor_with_name( ContentID )
00958 };
00959 
00963 class KMIME_EXPORT Supersedes : public Generics::SingleIdent
00964 {
00965   kmime_mk_trivial_ctor_with_name( Supersedes )
00966 };
00967 
00973 class KMIME_EXPORT InReplyTo : public Generics::Ident
00974 {
00975   kmime_mk_trivial_ctor_with_name( InReplyTo )
00976 };
00977 
00983 class KMIME_EXPORT References : public Generics::Ident
00984 {
00985   kmime_mk_trivial_ctor_with_name( References )
00986 };
00987 
00988 
00989 class ContentTypePrivate;
00990 
00996 class KMIME_EXPORT ContentType : public Generics::Parametrized
00997 {
00998   //@cond PRIVATE
00999   kmime_mk_trivial_ctor_with_name( ContentType )
01000   //@endcond
01001   public:
01002     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01003     virtual void clear();
01004     virtual bool isEmpty() const;
01005 
01009     QByteArray mimeType() const;
01010 
01015     QByteArray mediaType() const;
01016 
01020     QByteArray subType() const;
01021 
01026     void setMimeType( const QByteArray &mimeType );
01027 
01031     bool isMediatype( const char *mediatype ) const;
01032 
01036     bool isSubtype( const char *subtype ) const;
01037 
01041     bool isText() const;
01042 
01046     bool isPlainText() const;
01047 
01051     bool isHTMLText() const;
01052 
01056     bool isImage() const;
01057 
01061     bool isMultipart() const;
01062 
01067     bool isPartial() const;
01068 
01072     QByteArray charset() const;
01073 
01077     void setCharset( const QByteArray &s );
01078 
01082     QByteArray boundary() const;
01083 
01087     void setBoundary( const QByteArray &s );
01088 
01092     QString name() const;
01093 
01097     void setName( const QString &s, const QByteArray &cs );
01098 
01102     QByteArray id() const;
01103 
01107     void setId( const QByteArray &s );
01108 
01113     int partialNumber() const;
01114 
01119     int partialCount() const;
01120 
01126     void setPartialParams( int total, int number );
01127 
01128     // TODO: document
01129     contentCategory category() const;
01130 
01131     void setCategory( contentCategory c );
01132 
01133   protected:
01134     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01135 
01136   private:
01137     Q_DECLARE_PRIVATE(ContentType)
01138 };
01139 
01140 
01141 class ContentDispositionPrivate;
01142 
01148 class KMIME_EXPORT ContentDisposition : public Generics::Parametrized
01149 {
01150   //@cond PRIVATE
01151   kmime_mk_trivial_ctor_with_name( ContentDisposition )
01152   //@endcond
01153   public:
01154     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01155     virtual bool isEmpty() const;
01156     virtual void clear();
01157 
01161     contentDisposition disposition() const;
01162 
01167     void setDisposition( contentDisposition disp );
01168 
01174     QString filename() const;
01175 
01182     void setFilename( const QString &filename );
01183 
01184   protected:
01185     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01186 
01187   private:
01188     Q_DECLARE_PRIVATE( ContentDisposition )
01189 };
01190 
01191 //
01192 //
01193 // COMPATIBLE GUNSTRUCTURED-BASED FIELDS:
01194 //
01195 //
01196 
01197 
01198 class GenericPrivate;
01199 
01205 class KMIME_EXPORT Generic : public Generics::Unstructured
01206 {
01207   public:
01208     Generic();
01209     Generic( const char *t );
01210     Generic( const char *t, Content *p );
01211     Generic( const char *t, Content *p, const QByteArray &s );
01212     Generic( const char *t, Content *p, const QString &s, const QByteArray &cs );
01213     ~Generic();
01214 
01215     virtual void clear();
01216 
01217     virtual bool isEmpty() const;
01218 
01219     virtual const char *type() const;
01220 
01221     void setType( const char *type );
01222 
01223   private:
01224     Q_DECLARE_PRIVATE( Generic )
01225 };
01226 
01232 class KMIME_EXPORT Subject : public Generics::Unstructured
01233 {
01234   //@cond PRIVATE
01235   kmime_mk_trivial_ctor_with_name( Subject )
01236   //@endcond
01237   public:
01238     bool isReply() const;
01239 };
01240 
01244 class KMIME_EXPORT Organization : public Generics::Unstructured
01245 {
01246   kmime_mk_trivial_ctor_with_name( Organization )
01247 };
01248 
01252 class KMIME_EXPORT ContentDescription : public Generics::Unstructured
01253 {
01254   kmime_mk_trivial_ctor_with_name( ContentDescription )
01255 };
01256 
01261 class KMIME_EXPORT ContentLocation : public Generics::Unstructured
01262 {
01263   kmime_mk_trivial_ctor_with_name( ContentLocation )
01264 };
01265 
01266 class ControlPrivate;
01267 
01273 class KMIME_EXPORT Control : public Generics::Structured
01274 {
01275   //@cond PRIVATE
01276   kmime_mk_trivial_ctor_with_name( Control )
01277   //@endcond
01278   public:
01279     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01280     virtual void clear();
01281     virtual bool isEmpty() const;
01282 
01286     QByteArray controlType() const;
01287 
01291     QByteArray parameter() const;
01292 
01297     bool isCancel() const;
01298 
01303     void setCancel( const QByteArray &msgid );
01304 
01305   protected:
01306     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01307 
01308   private:
01309     Q_DECLARE_PRIVATE(Control)
01310 };
01311 
01312 
01313 class DatePrivate;
01314 
01320 class KMIME_EXPORT Date : public Generics::Structured
01321 {
01322   //@cond PRIVATE
01323   kmime_mk_trivial_ctor_with_name( Date )
01324   //@endcond
01325   public:
01326     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01327     virtual void clear();
01328     virtual bool isEmpty() const;
01329 
01333     KDateTime dateTime() const;
01334 
01338     void setDateTime( const KDateTime &dt );
01339 
01343     int ageInDays() const;
01344 
01345   protected:
01346     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01347 
01348   private:
01349     Q_DECLARE_PRIVATE( Date )
01350 };
01351 
01352 
01353 class NewsgroupsPrivate;
01354 
01360 class KMIME_EXPORT Newsgroups : public Generics::Structured
01361 {
01362   //@cond PRIVATE
01363   kmime_mk_trivial_ctor_with_name( Newsgroups )
01364   //@endcond
01365   public:
01366     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01367     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
01368     virtual QString asUnicodeString() const;
01369     virtual void clear();
01370     virtual bool isEmpty() const;
01371 
01375     QList<QByteArray> groups() const;
01376 
01380     void setGroups( const QList<QByteArray> &groups );
01381 
01386     bool isCrossposted() const;
01387 
01388   protected:
01389     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01390 
01391   private:
01392     Q_DECLARE_PRIVATE( Newsgroups )
01393 };
01394 
01400 class KMIME_EXPORT FollowUpTo : public Newsgroups
01401 {
01402   //@cond PRIVATE
01403   kmime_mk_trivial_ctor_with_name( FollowUpTo )
01404   //@endcond
01405 };
01406 
01407 
01408 class LinesPrivate;
01409 
01415 class KMIME_EXPORT Lines : public Generics::Structured
01416 {
01417   //@cond PRIVATE
01418   kmime_mk_trivial_ctor_with_name( Lines )
01419   //@endcond
01420   public:
01421     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01422     virtual QString asUnicodeString() const;
01423     virtual void clear();
01424     virtual bool isEmpty() const;
01425 
01429     int numberOfLines() const;
01430 
01434     void setNumberOfLines( int lines );
01435 
01436   protected:
01437     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01438 
01439   private:
01440     Q_DECLARE_PRIVATE( Lines )
01441 };
01442 
01446 class KMIME_EXPORT UserAgent : public Generics::Unstructured
01447 {
01448   kmime_mk_trivial_ctor_with_name( UserAgent )
01449 };
01450 
01451 }  //namespace Headers
01452 
01453 }  //namespace KMime
01454 
01455 // undefine code generation macros again
01456 #undef kmime_mk_trivial_ctor
01457 #undef kmime_mk_dptr_ctor
01458 #undef kmime_mk_trivial_ctor_with_name
01459 
01460 #endif // __KMIME_HEADERS_H__

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
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7.1
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