• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.3 API Reference
  • KDE Home
  • 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 
00074 enum contentEncoding {
00075   CE7Bit,              
00076   CE8Bit,              
00077   CEquPr,              
00078   CEbase64,            
00079   CEuuenc,             
00080   CEbinary             
00081 };
00082 
00086 enum contentDisposition {
00087   CDInvalid,           
00088   CDinline,            
00089   CDattachment,        
00090   CDparallel           
00091 };
00092 
00093 //often used charset
00094 // TODO: get rid of this!
00095 static const QByteArray Latin1( "ISO-8859-1" );
00096 
00097 //@cond PRIVATE
00098 // internal macro to generate default constructors
00099 #define kmime_mk_trivial_ctor( subclass )                               \
00100   public:                                                               \
00101     explicit subclass( Content *parent = 0 );                           \
00102     subclass( Content *parent, const QByteArray &s );                   \
00103     subclass( Content *parent, const QString &s, const QByteArray &charset ); \
00104     ~subclass();
00105 
00106 #define kmime_mk_dptr_ctor( subclass ) \
00107   protected: \
00108     explicit subclass( subclass##Private *d, KMime::Content *parent = 0 );
00109 
00110 #define kmime_mk_trivial_ctor_with_name( subclass )     \
00111   kmime_mk_trivial_ctor( subclass )                     \
00112     const char *type() const;                           \
00113     static const char *staticType();
00114 //@endcond
00115 
00116 //
00117 //
00118 // HEADER'S BASE CLASS. DEFINES THE COMMON INTERFACE
00119 //
00120 //
00121 
00124 class KMIME_EXPORT Base
00125 {
00126   public:
00130     typedef QList<KMime::Headers::Base*> List;
00131 
00135     explicit Base( KMime::Content *parent = 0 );
00136 
00140     virtual ~Base();
00141 
00145     KMime::Content *parent() const;
00146 
00150     void setParent( KMime::Content *parent );
00151 
00156     virtual void from7BitString( const QByteArray &s ) = 0;
00157 
00162     virtual QByteArray as7BitString( bool withHeaderType = true ) const = 0;
00163 
00167     QByteArray rfc2047Charset() const;
00168 
00173     void setRFC2047Charset( const QByteArray &cs );
00174 
00178     QByteArray defaultCharset() const;
00179 
00183     bool forceDefaultCharset() const;
00184 
00190     virtual void fromUnicodeString( const QString &s, const QByteArray &b ) = 0;
00191 
00199     virtual QString asUnicodeString() const = 0;
00200 
00204     virtual void clear() = 0;
00205 
00209     virtual bool isEmpty() const = 0;
00210 
00214     virtual const char *type() const;
00215 
00219     bool is( const char *t ) const;
00220 
00224     bool isMimeHeader() const;
00225 
00229     bool isXHeader() const;
00230 
00231   protected:
00235     QByteArray typeIntro() const;
00236 
00237     //@cond PRIVATE
00238     BasePrivate *d_ptr;
00239     kmime_mk_dptr_ctor( Base )
00240     //@endcond
00241 
00242   private:
00243     Q_DECLARE_PRIVATE(Base)
00244     Q_DISABLE_COPY(Base)
00245 };
00246 
00247 //
00248 //
00249 // GENERIC BASE CLASSES FOR DIFFERENT TYPES OF FIELDS
00250 //
00251 //
00252 
00253 namespace Generics {
00254 
00255 class UnstructuredPrivate;
00256 
00267 // known issues:
00268 // - uses old decodeRFC2047String function, instead of our own...
00269 
00270 class KMIME_EXPORT Unstructured : public Base
00271 {
00272   //@cond PRIVATE
00273   kmime_mk_dptr_ctor( Unstructured )
00274   //@endcond
00275   public:
00276     explicit Unstructured( Content *p = 0 );
00277     Unstructured( Content *p, const QByteArray &s );
00278     Unstructured( Content *p, const QString &s, const QByteArray &cs );
00279     ~Unstructured();
00280 
00281     virtual void from7BitString( const QByteArray &s );
00282     virtual QByteArray as7BitString( bool withHeaderType=true ) const;
00283 
00284     virtual void fromUnicodeString( const QString &s,
00285                                   const QByteArray &b );
00286     virtual QString asUnicodeString() const;
00287 
00288     virtual void clear();
00289 
00290     virtual bool isEmpty() const;
00291 
00292   private:
00293     Q_DECLARE_PRIVATE(Unstructured)
00294 };
00295 
00296 
00297 class StructuredPrivate;
00298 
00329 class KMIME_EXPORT Structured : public Base
00330 {
00331   public:
00332     explicit Structured( Content *p = 0 );
00333     Structured( Content *p, const QByteArray &s );
00334     Structured( Content *p, const QString &s, const QByteArray &cs );
00335     ~Structured();
00336 
00337     virtual void from7BitString( const QByteArray &s );
00338     virtual QString asUnicodeString() const;
00339     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00340 
00341   protected:
00350     virtual bool parse( const char* &scursor, const char *const send,
00351                         bool isCRLF = false ) = 0;
00352 
00353     //@cond PRIVATE
00354     kmime_mk_dptr_ctor( Structured )
00355     //@endcond
00356 
00357   private:
00358     Q_DECLARE_PRIVATE(Structured)
00359 };
00360 
00361 
00362 class AddressPrivate;
00363 
00367 class KMIME_EXPORT Address : public Structured
00368 {
00369   public:
00370     explicit Address( Content *p = 0 );
00371     Address( Content *p, const QByteArray &s );
00372     Address( Content *p, const QString &s, const QByteArray &cs );
00373     ~Address();
00374   protected:
00375     //@cond PRIVATE
00376     kmime_mk_dptr_ctor( Address )
00377     //@endcond
00378   private:
00379     Q_DECLARE_PRIVATE(Address)
00380 };
00381 
00382 
00383 class MailboxListPrivate;
00384 
00391 class KMIME_EXPORT MailboxList : public Address
00392 {
00393   //@cond PRIVATE
00394   kmime_mk_trivial_ctor( MailboxList )
00395   kmime_mk_dptr_ctor( MailboxList )
00396   //@endcond
00397   public:
00398     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00399     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00400     virtual QString asUnicodeString() const;
00401 
00402     virtual void clear();
00403     virtual bool isEmpty() const;
00404 
00410     void addAddress( const Types::Mailbox &mbox );
00411 
00417     void addAddress( const QByteArray &address,
00418                      const QString &displayName = QString() );
00419 
00423     QList<QByteArray> addresses() const;
00424 
00430     QStringList displayNames() const;
00431 
00438     QStringList prettyAddresses() const;
00439 
00443     Types::Mailbox::List mailboxes() const;
00444 
00445   protected:
00446     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00447 
00448   private:
00449     Q_DECLARE_PRIVATE(MailboxList)
00450 };
00451 
00452 
00453 class SingleMailboxPrivate;
00454 
00459 class KMIME_EXPORT SingleMailbox : public MailboxList
00460 {
00461   //@cond PRIVATE
00462   kmime_mk_trivial_ctor( SingleMailbox )
00463   //@endcond
00464   protected:
00465     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00466   private:
00467     Q_DECLARE_PRIVATE(SingleMailbox)
00468 };
00469 
00470 
00471 class AddressListPrivate;
00472 
00484 class KMIME_EXPORT AddressList : public Address
00485 {
00486   //@cond PRIVATE
00487   kmime_mk_trivial_ctor( AddressList )
00488   kmime_mk_dptr_ctor( AddressList )
00489   //@endcond
00490   public:
00491     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00492     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00493     virtual QString asUnicodeString() const;
00494 
00495     virtual void clear();
00496     virtual bool isEmpty() const;
00497 
00503     void addAddress( const Types::Mailbox &mbox );
00504 
00510     void addAddress( const QByteArray &address, const QString &displayName = QString() );
00511 
00515     QList<QByteArray> addresses() const;
00516 
00521     QStringList displayNames() const;
00522 
00528     QStringList prettyAddresses() const;
00529 
00533     Types::Mailbox::List mailboxes() const;
00534 
00535   protected:
00536     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00537 
00538   private:
00539     Q_DECLARE_PRIVATE(AddressList)
00540 };
00541 
00542 
00543 class IdentPrivate;
00544 
00550 class KMIME_EXPORT Ident : public Address
00551 {
00552   //@cond PRIVATE
00553   kmime_mk_trivial_ctor( Ident )
00554   kmime_mk_dptr_ctor( Ident )
00555   //@endcond
00556   public:
00557     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00558     virtual void clear();
00559     virtual bool isEmpty() const;
00560 
00567     QList<QByteArray> identifiers() const;
00568 
00573     void appendIdentifier( const QByteArray &id );
00574 
00575   protected:
00576     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00577 
00578   private:
00579     Q_DECLARE_PRIVATE(Ident)
00580 };
00581 
00582 
00583 class SingleIdentPrivate;
00584 
00590 class KMIME_EXPORT SingleIdent : public Ident
00591 {
00592   //@cond PRIVATE
00593   kmime_mk_trivial_ctor( SingleIdent )
00594   kmime_mk_dptr_ctor( SingleIdent )
00595   //@endcond
00596   public:
00601     QByteArray identifier() const;
00602 
00607     void setIdentifier( const QByteArray &id );
00608 
00609   protected:
00610     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00611 
00612   private:
00613     Q_DECLARE_PRIVATE(SingleIdent)
00614 };
00615 
00616 
00617 class TokenPrivate;
00618 
00622 class KMIME_EXPORT Token : public Structured
00623 {
00624   //@cond PRIVATE
00625   kmime_mk_trivial_ctor( Token )
00626   kmime_mk_dptr_ctor( Token )
00627   //@endcond
00628   public:
00629     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00630     virtual void clear();
00631     virtual bool isEmpty() const;
00632 
00636     QByteArray token() const;
00637 
00641     void setToken( const QByteArray &t );
00642 
00643   protected:
00644     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00645 
00646   private:
00647     Q_DECLARE_PRIVATE(Token)
00648 };
00649 
00650 
00651 class PhraseListPrivate;
00652 
00656 class KMIME_EXPORT PhraseList : public Structured
00657 {
00658   //@cond PRIVATE
00659   kmime_mk_trivial_ctor( PhraseList )
00660   //@endcond
00661   public:
00662     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00663     virtual QString asUnicodeString() const;
00664     virtual void clear();
00665     virtual bool isEmpty() const;
00666 
00670     QStringList phrases() const;
00671 
00672   protected:
00673     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00674 
00675   private:
00676     Q_DECLARE_PRIVATE(PhraseList)
00677 };
00678 
00679 
00680 class DotAtomPrivate;
00681 
00685 class KMIME_EXPORT DotAtom : public Structured
00686 {
00687   //@cond PRIVATE
00688   kmime_mk_trivial_ctor( DotAtom )
00689   //@endcond
00690   public:
00691     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00692     virtual QString asUnicodeString() const;
00693     virtual void clear();
00694     virtual bool isEmpty() const;
00695 
00696   protected:
00697     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00698 
00699   private:
00700     Q_DECLARE_PRIVATE(DotAtom)
00701 };
00702 
00703 
00704 class ParametrizedPrivate;
00705 
00709 class KMIME_EXPORT Parametrized : public Structured
00710 {
00711   //@cond PRIVATE
00712   kmime_mk_trivial_ctor( Parametrized )
00713   kmime_mk_dptr_ctor( Parametrized )
00714   //@endcond
00715   public:
00716     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00717 
00718     virtual bool isEmpty() const;
00719     virtual void clear();
00720 
00721     //FIXME: Shouldn't the parameter keys be QByteArray and not QStrings? Only the values can be
00722     //       non-ascii!
00723 
00728     QString parameter( const QString &key ) const;
00729 
00734     bool hasParameter( const QString &key ) const;
00735 
00741     void setParameter( const QString &key, const QString &value );
00742 
00743   protected:
00744     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00745 
00746   private:
00747     Q_DECLARE_PRIVATE(Parametrized)
00748 };
00749 
00750 } // namespace Generics
00751 
00752 //
00753 //
00754 // INCOMPATIBLE, GSTRUCTURED-BASED FIELDS:
00755 //
00756 //
00757 
00758 class ReturnPathPrivate;
00759 
00765 class KMIME_EXPORT ReturnPath : public Generics::Address
00766 {
00767   //@cond PRIVATE
00768   kmime_mk_trivial_ctor_with_name( ReturnPath )
00769   //@endcond
00770   public:
00771     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00772     virtual void clear();
00773     virtual bool isEmpty() const;
00774 
00775   protected:
00776     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00777 
00778   private:
00779     Q_DECLARE_PRIVATE(ReturnPath)
00780 };
00781 
00782 // Address et al.:
00783 
00784 // rfc(2)822 headers:
00790 class KMIME_EXPORT From : public Generics::MailboxList
00791 {
00792   kmime_mk_trivial_ctor_with_name( From )
00793 };
00794 
00800 class KMIME_EXPORT Sender : public Generics::SingleMailbox
00801 {
00802   kmime_mk_trivial_ctor_with_name( Sender )
00803 };
00804 
00810 class KMIME_EXPORT To : public Generics::AddressList
00811 {
00812   kmime_mk_trivial_ctor_with_name( To )
00813 };
00814 
00820 class KMIME_EXPORT Cc : public Generics::AddressList
00821 {
00822   kmime_mk_trivial_ctor_with_name( Cc )
00823 };
00824 
00830 class KMIME_EXPORT Bcc : public Generics::AddressList
00831 {
00832   kmime_mk_trivial_ctor_with_name( Bcc )
00833 };
00834 
00840 class KMIME_EXPORT ReplyTo : public Generics::AddressList
00841 {
00842   kmime_mk_trivial_ctor_with_name( ReplyTo )
00843 };
00844 
00845 
00846 class MailCopiesToPrivate;
00847 
00853 class KMIME_EXPORT MailCopiesTo : public Generics::AddressList
00854 {
00855   //@cond PRIVATE
00856   kmime_mk_trivial_ctor_with_name( MailCopiesTo )
00857   //@endcond
00858   public:
00859     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00860     virtual QString asUnicodeString() const;
00861 
00862     virtual void clear();
00863     virtual bool isEmpty() const;
00864 
00868     bool alwaysCopy() const;
00869 
00873     void setAlwaysCopy();
00874 
00878     bool neverCopy() const;
00879 
00883     void setNeverCopy();
00884 
00885   protected:
00886     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00887 
00888   private:
00889     Q_DECLARE_PRIVATE(MailCopiesTo)
00890 };
00891 
00892 
00893 class ContentTransferEncodingPrivate;
00894 
00900 class KMIME_EXPORT ContentTransferEncoding : public Generics::Token
00901 {
00902   //@cond PRIVATE
00903   kmime_mk_trivial_ctor_with_name( ContentTransferEncoding )
00904   //@endcond
00905   public:
00906     virtual void clear();
00907 
00911     contentEncoding encoding() const;
00912 
00916     void setEncoding( contentEncoding e );
00917 
00921     // KDE5: rename to isDecoded().
00922     bool decoded() const;
00923 
00929     void setDecoded( bool decoded = true );
00930 
00935     bool needToEncode() const;
00936 
00937   protected:
00938     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00939 
00940   private:
00941     Q_DECLARE_PRIVATE(ContentTransferEncoding)
00942 };
00943 
00949 class KMIME_EXPORT Keywords : public Generics::PhraseList
00950 {
00951   kmime_mk_trivial_ctor_with_name( Keywords )
00952 };
00953 
00954 // DotAtom:
00955 
00961 class KMIME_EXPORT MIMEVersion : public Generics::DotAtom
00962 {
00963   kmime_mk_trivial_ctor_with_name( MIMEVersion )
00964 };
00965 
00966 // Ident:
00967 
00973 class KMIME_EXPORT MessageID : public Generics::SingleIdent
00974 {
00975   //@cond PRIVATE
00976   kmime_mk_trivial_ctor_with_name( MessageID )
00977   //@endcond
00978   public:
00983     void generate( const QByteArray &fqdn );
00984 };
00985 
00986 class ContentIDPrivate;
00987 
00991 class KMIME_EXPORT ContentID : public Generics::SingleIdent
00992 {
00993   //@cond PRIVATE
00994   kmime_mk_trivial_ctor_with_name( ContentID )
00995   kmime_mk_dptr_ctor( ContentID )
00996   //@endcond
00997 
00998   protected:
00999     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01000   private:
01001     Q_DECLARE_PRIVATE(ContentID)
01002 };
01003 
01007 class KMIME_EXPORT Supersedes : public Generics::SingleIdent
01008 {
01009   kmime_mk_trivial_ctor_with_name( Supersedes )
01010 };
01011 
01017 class KMIME_EXPORT InReplyTo : public Generics::Ident
01018 {
01019   kmime_mk_trivial_ctor_with_name( InReplyTo )
01020 };
01021 
01027 class KMIME_EXPORT References : public Generics::Ident
01028 {
01029   kmime_mk_trivial_ctor_with_name( References )
01030 };
01031 
01032 
01033 class ContentTypePrivate;
01034 
01040 class KMIME_EXPORT ContentType : public Generics::Parametrized
01041 {
01042   //@cond PRIVATE
01043   kmime_mk_trivial_ctor_with_name( ContentType )
01044   //@endcond
01045   public:
01046     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01047     virtual void clear();
01048     virtual bool isEmpty() const;
01049 
01053     QByteArray mimeType() const;
01054 
01059     QByteArray mediaType() const;
01060 
01064     QByteArray subType() const;
01065 
01070     void setMimeType( const QByteArray &mimeType );
01071 
01075     bool isMediatype( const char *mediatype ) const;
01076 
01080     bool isSubtype( const char *subtype ) const;
01081 
01085     bool isText() const;
01086 
01090     bool isPlainText() const;
01091 
01095     bool isHTMLText() const;
01096 
01100     bool isImage() const;
01101 
01105     bool isMultipart() const;
01106 
01111     bool isPartial() const;
01112 
01116     QByteArray charset() const;
01117 
01121     void setCharset( const QByteArray &s );
01122 
01126     QByteArray boundary() const;
01127 
01131     void setBoundary( const QByteArray &s );
01132 
01136     QString name() const;
01137 
01141     void setName( const QString &s, const QByteArray &cs );
01142 
01146     QByteArray id() const;
01147 
01151     void setId( const QByteArray &s );
01152 
01157     int partialNumber() const;
01158 
01163     int partialCount() const;
01164 
01170     void setPartialParams( int total, int number );
01171 
01172     // TODO: document
01173     contentCategory category() const;
01174 
01175     void setCategory( contentCategory c );
01176 
01177   protected:
01178     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01179 
01180   private:
01181     Q_DECLARE_PRIVATE(ContentType)
01182 };
01183 
01184 
01185 class ContentDispositionPrivate;
01186 
01192 class KMIME_EXPORT ContentDisposition : public Generics::Parametrized
01193 {
01194   //@cond PRIVATE
01195   kmime_mk_trivial_ctor_with_name( ContentDisposition )
01196   //@endcond
01197   public:
01198     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01199     virtual bool isEmpty() const;
01200     virtual void clear();
01201 
01205     contentDisposition disposition() const;
01206 
01211     void setDisposition( contentDisposition disp );
01212 
01218     QString filename() const;
01219 
01226     void setFilename( const QString &filename );
01227 
01228   protected:
01229     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01230 
01231   private:
01232     Q_DECLARE_PRIVATE( ContentDisposition )
01233 };
01234 
01235 //
01236 //
01237 // COMPATIBLE GUNSTRUCTURED-BASED FIELDS:
01238 //
01239 //
01240 
01241 
01242 class GenericPrivate;
01243 
01249 class KMIME_EXPORT Generic : public Generics::Unstructured
01250 {
01251   public:
01252     Generic();
01253     Generic( const char *t );
01254     Generic( const char *t, Content *p );
01255     Generic( const char *t, Content *p, const QByteArray &s );
01256     Generic( const char *t, Content *p, const QString &s, const QByteArray &cs );
01257     ~Generic();
01258 
01259     virtual void clear();
01260 
01261     virtual bool isEmpty() const;
01262 
01263     virtual const char *type() const;
01264 
01265     void setType( const char *type );
01266 
01267   private:
01268     Q_DECLARE_PRIVATE( Generic )
01269 };
01270 
01276 class KMIME_EXPORT Subject : public Generics::Unstructured
01277 {
01278   //@cond PRIVATE
01279   kmime_mk_trivial_ctor_with_name( Subject )
01280   //@endcond
01281   public:
01282     bool isReply() const;
01283 };
01284 
01288 class KMIME_EXPORT Organization : public Generics::Unstructured
01289 {
01290   kmime_mk_trivial_ctor_with_name( Organization )
01291 };
01292 
01296 class KMIME_EXPORT ContentDescription : public Generics::Unstructured
01297 {
01298   kmime_mk_trivial_ctor_with_name( ContentDescription )
01299 };
01300 
01305 class KMIME_EXPORT ContentLocation : public Generics::Unstructured
01306 {
01307   kmime_mk_trivial_ctor_with_name( ContentLocation )
01308 };
01309 
01310 class ControlPrivate;
01311 
01317 class KMIME_EXPORT Control : public Generics::Structured
01318 {
01319   //@cond PRIVATE
01320   kmime_mk_trivial_ctor_with_name( Control )
01321   //@endcond
01322   public:
01323     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01324     virtual void clear();
01325     virtual bool isEmpty() const;
01326 
01330     QByteArray controlType() const;
01331 
01335     QByteArray parameter() const;
01336 
01341     bool isCancel() const;
01342 
01347     void setCancel( const QByteArray &msgid );
01348 
01349   protected:
01350     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01351 
01352   private:
01353     Q_DECLARE_PRIVATE(Control)
01354 };
01355 
01356 
01357 class DatePrivate;
01358 
01364 class KMIME_EXPORT Date : public Generics::Structured
01365 {
01366   //@cond PRIVATE
01367   kmime_mk_trivial_ctor_with_name( Date )
01368   //@endcond
01369   public:
01370     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01371     virtual void clear();
01372     virtual bool isEmpty() const;
01373 
01377     KDateTime dateTime() const;
01378 
01382     void setDateTime( const KDateTime &dt );
01383 
01387     int ageInDays() const;
01388 
01389   protected:
01390     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01391 
01392   private:
01393     Q_DECLARE_PRIVATE( Date )
01394 };
01395 
01396 
01397 class NewsgroupsPrivate;
01398 
01404 class KMIME_EXPORT Newsgroups : public Generics::Structured
01405 {
01406   //@cond PRIVATE
01407   kmime_mk_trivial_ctor_with_name( Newsgroups )
01408   //@endcond
01409   public:
01410     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01411     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
01412     virtual QString asUnicodeString() const;
01413     virtual void clear();
01414     virtual bool isEmpty() const;
01415 
01419     QList<QByteArray> groups() const;
01420 
01424     void setGroups( const QList<QByteArray> &groups );
01425 
01430     bool isCrossposted() const;
01431 
01432   protected:
01433     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01434 
01435   private:
01436     Q_DECLARE_PRIVATE( Newsgroups )
01437 };
01438 
01444 class KMIME_EXPORT FollowUpTo : public Newsgroups
01445 {
01446   //@cond PRIVATE
01447   kmime_mk_trivial_ctor_with_name( FollowUpTo )
01448   //@endcond
01449 };
01450 
01451 
01452 class LinesPrivate;
01453 
01459 class KMIME_EXPORT Lines : public Generics::Structured
01460 {
01461   //@cond PRIVATE
01462   kmime_mk_trivial_ctor_with_name( Lines )
01463   //@endcond
01464   public:
01465     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01466     virtual QString asUnicodeString() const;
01467     virtual void clear();
01468     virtual bool isEmpty() const;
01469 
01473     int numberOfLines() const;
01474 
01478     void setNumberOfLines( int lines );
01479 
01480   protected:
01481     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01482 
01483   private:
01484     Q_DECLARE_PRIVATE( Lines )
01485 };
01486 
01490 class KMIME_EXPORT UserAgent : public Generics::Unstructured
01491 {
01492   kmime_mk_trivial_ctor_with_name( UserAgent )
01493 };
01494 
01497 KMIME_EXPORT Base *createHeader( const QByteArray& type );
01498 
01499 }  //namespace Headers
01500 
01501 }  //namespace KMime
01502 
01503 // undefine code generation macros again
01504 #undef kmime_mk_trivial_ctor
01505 #undef kmime_mk_dptr_ctor
01506 #undef kmime_mk_trivial_ctor_with_name
01507 
01508 #endif // __KMIME_HEADERS_H__
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 7 2012 23:55:59 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KMIME Library

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

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal