• Skip to content
  • Skip to link menu
KDE 4.4 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 
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 //@endcond
00114 
00115 //
00116 //
00117 // HEADER'S BASE CLASS. DEFINES THE COMMON INTERFACE
00118 //
00119 //
00120 
00123 class KMIME_EXPORT Base
00124 {
00125   public:
00129     typedef QList<KMime::Headers::Base*> List;
00130 
00134     explicit Base( KMime::Content *parent = 0 );
00135 
00139     virtual ~Base();
00140 
00144     KMime::Content *parent() const;
00145 
00149     void setParent( KMime::Content *parent );
00150 
00155     virtual void from7BitString( const QByteArray &s ) = 0;
00156 
00161     virtual QByteArray as7BitString( bool withHeaderType = true ) const = 0;
00162 
00166     QByteArray rfc2047Charset() const;
00167 
00172     void setRFC2047Charset( const QByteArray &cs );
00173 
00177     QByteArray defaultCharset() const;
00178 
00182     bool forceDefaultCharset() const;
00183 
00189     virtual void fromUnicodeString( const QString &s, const QByteArray &b ) = 0;
00190 
00194     virtual QString asUnicodeString() const = 0;
00195 
00199     virtual void clear() = 0;
00200 
00204     virtual bool isEmpty() const = 0;
00205 
00209     virtual const char *type() const;
00210 
00214     bool is( const char *t ) const;
00215 
00219     bool isMimeHeader() const;
00220 
00224     bool isXHeader() const;
00225 
00226   protected:
00230     QByteArray typeIntro() const;
00231 
00232     //@cond PRIVATE
00233     BasePrivate *d_ptr;
00234     kmime_mk_dptr_ctor( Base )
00235     //@endcond
00236 
00237   private:
00238     Q_DECLARE_PRIVATE(Base)
00239     Q_DISABLE_COPY(Base)
00240 };
00241 
00242 //
00243 //
00244 // GENERIC BASE CLASSES FOR DIFFERENT TYPES OF FIELDS
00245 //
00246 //
00247 
00248 namespace Generics {
00249 
00250 class UnstructuredPrivate;
00251 
00262 // known issues:
00263 // - uses old decodeRFC2047String function, instead of our own...
00264 
00265 class KMIME_EXPORT Unstructured : public Base
00266 {
00267   //@cond PRIVATE
00268   kmime_mk_dptr_ctor( Unstructured )
00269   //@endcond
00270   public:
00271     explicit Unstructured( Content *p = 0 );
00272     Unstructured( Content *p, const QByteArray &s );
00273     Unstructured( Content *p, const QString &s, const QByteArray &cs );
00274     ~Unstructured();
00275 
00276     virtual void from7BitString( const QByteArray &s );
00277     virtual QByteArray as7BitString( bool withHeaderType=true ) const;
00278 
00279     virtual void fromUnicodeString( const QString &s,
00280                                   const QByteArray &b );
00281     virtual QString asUnicodeString() const;
00282 
00283     virtual void clear();
00284 
00285     virtual bool isEmpty() const;
00286 
00287   private:
00288     Q_DECLARE_PRIVATE(Unstructured)
00289 };
00290 
00291 
00292 class StructuredPrivate;
00293 
00324 class KMIME_EXPORT Structured : public Base
00325 {
00326   public:
00327     explicit Structured( Content *p = 0 );
00328     Structured( Content *p, const QByteArray &s );
00329     Structured( Content *p, const QString &s, const QByteArray &cs );
00330     ~Structured();
00331 
00332     virtual void from7BitString( const QByteArray &s );
00333     virtual QString asUnicodeString() const;
00334     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00335 
00336   protected:
00345     virtual bool parse( const char* &scursor, const char *const send,
00346                         bool isCRLF = false ) = 0;
00347 
00348     //@cond PRIVATE
00349     kmime_mk_dptr_ctor( Structured )
00350     //@endcond
00351 
00352   private:
00353     Q_DECLARE_PRIVATE(Structured)
00354 };
00355 
00356 
00357 class AddressPrivate;
00358 
00362 class KMIME_EXPORT Address : public Structured
00363 {
00364   public:
00365     explicit Address( Content *p = 0 );
00366     Address( Content *p, const QByteArray &s );
00367     Address( Content *p, const QString &s, const QByteArray &cs );
00368     ~Address();
00369   protected:
00370     //@cond PRIVATE
00371     kmime_mk_dptr_ctor( Address )
00372     //@endcond
00373   private:
00374     Q_DECLARE_PRIVATE(Address)
00375 };
00376 
00377 
00378 class MailboxListPrivate;
00379 
00386 class KMIME_EXPORT MailboxList : public Address
00387 {
00388   //@cond PRIVATE
00389   kmime_mk_trivial_ctor( MailboxList )
00390   kmime_mk_dptr_ctor( MailboxList )
00391   //@endcond
00392   public:
00393     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00394     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00395     virtual QString asUnicodeString() const;
00396 
00397     virtual void clear();
00398     virtual bool isEmpty() const;
00399 
00405     void addAddress( const Types::Mailbox &mbox );
00406 
00412     void addAddress( const QByteArray &address,
00413                      const QString &displayName = QString() );
00414 
00418     QList<QByteArray> addresses() const;
00419 
00425     QStringList displayNames() const;
00426 
00433     QStringList prettyAddresses() const;
00434 
00438     Types::Mailbox::List mailboxes() const;
00439 
00440   protected:
00441     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00442 
00443   private:
00444     Q_DECLARE_PRIVATE(MailboxList)
00445 };
00446 
00447 
00448 class SingleMailboxPrivate;
00449 
00454 class KMIME_EXPORT SingleMailbox : public MailboxList
00455 {
00456   //@cond PRIVATE
00457   kmime_mk_trivial_ctor( SingleMailbox )
00458   //@endcond
00459   protected:
00460     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00461   private:
00462     Q_DECLARE_PRIVATE(SingleMailbox)
00463 };
00464 
00465 
00466 class AddressListPrivate;
00467 
00479 class KMIME_EXPORT AddressList : public Address
00480 {
00481   //@cond PRIVATE
00482   kmime_mk_trivial_ctor( AddressList )
00483   kmime_mk_dptr_ctor( AddressList )
00484   //@endcond
00485   public:
00486     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00487     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00488     virtual QString asUnicodeString() const;
00489 
00490     virtual void clear();
00491     virtual bool isEmpty() const;
00492 
00498     void addAddress( const Types::Mailbox &mbox );
00499 
00505     void addAddress( const QByteArray &address, const QString &displayName = QString() );
00506 
00510     QList<QByteArray> addresses() const;
00511 
00516     QStringList displayNames() const;
00517 
00523     QStringList prettyAddresses() const;
00524 
00528     Types::Mailbox::List mailboxes() const;
00529 
00530   protected:
00531     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00532 
00533   private:
00534     Q_DECLARE_PRIVATE(AddressList)
00535 };
00536 
00537 
00538 class IdentPrivate;
00539 
00545 class KMIME_EXPORT Ident : public Address
00546 {
00547   //@cond PRIVATE
00548   kmime_mk_trivial_ctor( Ident )
00549   kmime_mk_dptr_ctor( Ident )
00550   //@endcond
00551   public:
00552     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00553     virtual void clear();
00554     virtual bool isEmpty() const;
00555 
00562     QList<QByteArray> identifiers() const;
00563 
00568     void appendIdentifier( const QByteArray &id );
00569 
00570   protected:
00571     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00572 
00573   private:
00574     Q_DECLARE_PRIVATE(Ident)
00575 };
00576 
00577 
00578 class SingleIdentPrivate;
00579 
00585 class KMIME_EXPORT SingleIdent : public Ident
00586 {
00587   //@cond PRIVATE
00588   kmime_mk_trivial_ctor( SingleIdent )
00589   kmime_mk_dptr_ctor( SingleIdent )
00590   //@endcond
00591   public:
00596     QByteArray identifier() const;
00597 
00602     void setIdentifier( const QByteArray &id );
00603 
00604   protected:
00605     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00606 
00607   private:
00608     Q_DECLARE_PRIVATE(SingleIdent)
00609 };
00610 
00611 
00612 class TokenPrivate;
00613 
00617 class KMIME_EXPORT Token : public Structured
00618 {
00619   //@cond PRIVATE
00620   kmime_mk_trivial_ctor( Token )
00621   kmime_mk_dptr_ctor( Token )
00622   //@endcond
00623   public:
00624     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00625     virtual void clear();
00626     virtual bool isEmpty() const;
00627 
00631     QByteArray token() const;
00632 
00636     void setToken( const QByteArray &t );
00637 
00638   protected:
00639     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00640 
00641   private:
00642     Q_DECLARE_PRIVATE(Token)
00643 };
00644 
00645 
00646 class PhraseListPrivate;
00647 
00651 class KMIME_EXPORT PhraseList : public Structured
00652 {
00653   //@cond PRIVATE
00654   kmime_mk_trivial_ctor( PhraseList )
00655   //@endcond
00656   public:
00657     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00658     virtual QString asUnicodeString() const;
00659     virtual void clear();
00660     virtual bool isEmpty() const;
00661 
00665     QStringList phrases() const;
00666 
00667   protected:
00668     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00669 
00670   private:
00671     Q_DECLARE_PRIVATE(PhraseList)
00672 };
00673 
00674 
00675 class DotAtomPrivate;
00676 
00680 class KMIME_EXPORT DotAtom : public Structured
00681 {
00682   //@cond PRIVATE
00683   kmime_mk_trivial_ctor( DotAtom )
00684   //@endcond
00685   public:
00686     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00687     virtual QString asUnicodeString() const;
00688     virtual void clear();
00689     virtual bool isEmpty() const;
00690 
00691   protected:
00692     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00693 
00694   private:
00695     Q_DECLARE_PRIVATE(DotAtom)
00696 };
00697 
00698 
00699 class ParametrizedPrivate;
00700 
00704 class KMIME_EXPORT Parametrized : public Structured
00705 {
00706   //@cond PRIVATE
00707   kmime_mk_trivial_ctor( Parametrized )
00708   kmime_mk_dptr_ctor( Parametrized )
00709   //@endcond
00710   public:
00711     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00712 
00713     virtual bool isEmpty() const;
00714     virtual void clear();
00715 
00720     QString parameter( const QString &key ) const;
00721 
00727     void setParameter( const QString &key, const QString &value );
00728 
00729   protected:
00730     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00731 
00732   private:
00733     Q_DECLARE_PRIVATE(Parametrized)
00734 };
00735 
00736 } // namespace Generics
00737 
00738 //
00739 //
00740 // INCOMPATIBLE, GSTRUCTURED-BASED FIELDS:
00741 //
00742 //
00743 
00744 class ReturnPathPrivate;
00745 
00751 class KMIME_EXPORT ReturnPath : public Generics::Address
00752 {
00753   //@cond PRIVATE
00754   kmime_mk_trivial_ctor_with_name( ReturnPath )
00755   //@endcond
00756   public:
00757     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00758     virtual void clear();
00759     virtual bool isEmpty() const;
00760 
00761   protected:
00762     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00763 
00764   private:
00765     Q_DECLARE_PRIVATE(ReturnPath)
00766 };
00767 
00768 // Address et al.:
00769 
00770 // rfc(2)822 headers:
00776 class KMIME_EXPORT From : public Generics::MailboxList
00777 {
00778   kmime_mk_trivial_ctor_with_name( From )
00779 };
00780 
00786 class KMIME_EXPORT Sender : public Generics::SingleMailbox
00787 {
00788   kmime_mk_trivial_ctor_with_name( Sender )
00789 };
00790 
00796 class KMIME_EXPORT To : public Generics::AddressList
00797 {
00798   kmime_mk_trivial_ctor_with_name( To )
00799 };
00800 
00806 class KMIME_EXPORT Cc : public Generics::AddressList
00807 {
00808   kmime_mk_trivial_ctor_with_name( Cc )
00809 };
00810 
00816 class KMIME_EXPORT Bcc : public Generics::AddressList
00817 {
00818   kmime_mk_trivial_ctor_with_name( Bcc )
00819 };
00820 
00826 class KMIME_EXPORT ReplyTo : public Generics::AddressList
00827 {
00828   kmime_mk_trivial_ctor_with_name( ReplyTo )
00829 };
00830 
00831 
00832 class MailCopiesToPrivate;
00833 
00839 class KMIME_EXPORT MailCopiesTo : public Generics::AddressList
00840 {
00841   //@cond PRIVATE
00842   kmime_mk_trivial_ctor_with_name( MailCopiesTo )
00843   //@endcond
00844   public:
00845     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00846     virtual QString asUnicodeString() const;
00847 
00848     virtual void clear();
00849     virtual bool isEmpty() const;
00850 
00854     bool alwaysCopy() const;
00855 
00859     void setAlwaysCopy();
00860 
00864     bool neverCopy() const;
00865 
00869     void setNeverCopy();
00870 
00871   protected:
00872     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00873 
00874   private:
00875     Q_DECLARE_PRIVATE(MailCopiesTo)
00876 };
00877 
00878 
00879 class ContentTransferEncodingPrivate;
00880 
00886 class KMIME_EXPORT ContentTransferEncoding : public Generics::Token
00887 {
00888   //@cond PRIVATE
00889   kmime_mk_trivial_ctor_with_name( ContentTransferEncoding )
00890   //@endcond
00891   public:
00892     virtual void clear();
00893 
00897     contentEncoding encoding() const;
00898 
00902     void setEncoding( contentEncoding e );
00903 
00907     // KDE5: rename to isDecoded().
00908     bool decoded() const;
00909 
00915     void setDecoded( bool decoded = true );
00916 
00921     bool needToEncode() const;
00922 
00923   protected:
00924     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00925 
00926   private:
00927     Q_DECLARE_PRIVATE(ContentTransferEncoding)
00928 };
00929 
00935 class KMIME_EXPORT Keywords : public Generics::PhraseList
00936 {
00937   kmime_mk_trivial_ctor_with_name( Keywords )
00938 };
00939 
00940 // DotAtom:
00941 
00947 class KMIME_EXPORT MIMEVersion : public Generics::DotAtom
00948 {
00949   kmime_mk_trivial_ctor_with_name( MIMEVersion )
00950 };
00951 
00952 // Ident:
00953 
00959 class KMIME_EXPORT MessageID : public Generics::SingleIdent
00960 {
00961   //@cond PRIVATE
00962   kmime_mk_trivial_ctor_with_name( MessageID )
00963   //@endcond
00964   public:
00969     void generate( const QByteArray &fqdn );
00970 };
00971 
00972 class ContentIDPrivate;
00973 
00977 class KMIME_EXPORT ContentID : public Generics::SingleIdent
00978 {
00979   //@cond PRIVATE
00980   kmime_mk_trivial_ctor_with_name( ContentID )
00981   kmime_mk_dptr_ctor( ContentID )
00982   //@endcond
00983 
00984   protected:
00985     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00986   private:
00987     Q_DECLARE_PRIVATE(ContentID)
00988 };
00989 
00993 class KMIME_EXPORT Supersedes : public Generics::SingleIdent
00994 {
00995   kmime_mk_trivial_ctor_with_name( Supersedes )
00996 };
00997 
01003 class KMIME_EXPORT InReplyTo : public Generics::Ident
01004 {
01005   kmime_mk_trivial_ctor_with_name( InReplyTo )
01006 };
01007 
01013 class KMIME_EXPORT References : public Generics::Ident
01014 {
01015   kmime_mk_trivial_ctor_with_name( References )
01016 };
01017 
01018 
01019 class ContentTypePrivate;
01020 
01026 class KMIME_EXPORT ContentType : public Generics::Parametrized
01027 {
01028   //@cond PRIVATE
01029   kmime_mk_trivial_ctor_with_name( ContentType )
01030   //@endcond
01031   public:
01032     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01033     virtual void clear();
01034     virtual bool isEmpty() const;
01035 
01039     QByteArray mimeType() const;
01040 
01045     QByteArray mediaType() const;
01046 
01050     QByteArray subType() const;
01051 
01056     void setMimeType( const QByteArray &mimeType );
01057 
01061     bool isMediatype( const char *mediatype ) const;
01062 
01066     bool isSubtype( const char *subtype ) const;
01067 
01071     bool isText() const;
01072 
01076     bool isPlainText() const;
01077 
01081     bool isHTMLText() const;
01082 
01086     bool isImage() const;
01087 
01091     bool isMultipart() const;
01092 
01097     bool isPartial() const;
01098 
01102     QByteArray charset() const;
01103 
01107     void setCharset( const QByteArray &s );
01108 
01112     QByteArray boundary() const;
01113 
01117     void setBoundary( const QByteArray &s );
01118 
01122     QString name() const;
01123 
01127     void setName( const QString &s, const QByteArray &cs );
01128 
01132     QByteArray id() const;
01133 
01137     void setId( const QByteArray &s );
01138 
01143     int partialNumber() const;
01144 
01149     int partialCount() const;
01150 
01156     void setPartialParams( int total, int number );
01157 
01158     // TODO: document
01159     contentCategory category() const;
01160 
01161     void setCategory( contentCategory c );
01162 
01163   protected:
01164     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01165 
01166   private:
01167     Q_DECLARE_PRIVATE(ContentType)
01168 };
01169 
01170 
01171 class ContentDispositionPrivate;
01172 
01178 class KMIME_EXPORT ContentDisposition : public Generics::Parametrized
01179 {
01180   //@cond PRIVATE
01181   kmime_mk_trivial_ctor_with_name( ContentDisposition )
01182   //@endcond
01183   public:
01184     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01185     virtual bool isEmpty() const;
01186     virtual void clear();
01187 
01191     contentDisposition disposition() const;
01192 
01197     void setDisposition( contentDisposition disp );
01198 
01204     QString filename() const;
01205 
01212     void setFilename( const QString &filename );
01213 
01214   protected:
01215     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01216 
01217   private:
01218     Q_DECLARE_PRIVATE( ContentDisposition )
01219 };
01220 
01221 //
01222 //
01223 // COMPATIBLE GUNSTRUCTURED-BASED FIELDS:
01224 //
01225 //
01226 
01227 
01228 class GenericPrivate;
01229 
01235 class KMIME_EXPORT Generic : public Generics::Unstructured
01236 {
01237   public:
01238     Generic();
01239     Generic( const char *t );
01240     Generic( const char *t, Content *p );
01241     Generic( const char *t, Content *p, const QByteArray &s );
01242     Generic( const char *t, Content *p, const QString &s, const QByteArray &cs );
01243     ~Generic();
01244 
01245     virtual void clear();
01246 
01247     virtual bool isEmpty() const;
01248 
01249     virtual const char *type() const;
01250 
01251     void setType( const char *type );
01252 
01253   private:
01254     Q_DECLARE_PRIVATE( Generic )
01255 };
01256 
01262 class KMIME_EXPORT Subject : public Generics::Unstructured
01263 {
01264   //@cond PRIVATE
01265   kmime_mk_trivial_ctor_with_name( Subject )
01266   //@endcond
01267   public:
01268     bool isReply() const;
01269 };
01270 
01274 class KMIME_EXPORT Organization : public Generics::Unstructured
01275 {
01276   kmime_mk_trivial_ctor_with_name( Organization )
01277 };
01278 
01282 class KMIME_EXPORT ContentDescription : public Generics::Unstructured
01283 {
01284   kmime_mk_trivial_ctor_with_name( ContentDescription )
01285 };
01286 
01291 class KMIME_EXPORT ContentLocation : public Generics::Unstructured
01292 {
01293   kmime_mk_trivial_ctor_with_name( ContentLocation )
01294 };
01295 
01296 class ControlPrivate;
01297 
01303 class KMIME_EXPORT Control : public Generics::Structured
01304 {
01305   //@cond PRIVATE
01306   kmime_mk_trivial_ctor_with_name( Control )
01307   //@endcond
01308   public:
01309     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01310     virtual void clear();
01311     virtual bool isEmpty() const;
01312 
01316     QByteArray controlType() const;
01317 
01321     QByteArray parameter() const;
01322 
01327     bool isCancel() const;
01328 
01333     void setCancel( const QByteArray &msgid );
01334 
01335   protected:
01336     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01337 
01338   private:
01339     Q_DECLARE_PRIVATE(Control)
01340 };
01341 
01342 
01343 class DatePrivate;
01344 
01350 class KMIME_EXPORT Date : public Generics::Structured
01351 {
01352   //@cond PRIVATE
01353   kmime_mk_trivial_ctor_with_name( Date )
01354   //@endcond
01355   public:
01356     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01357     virtual void clear();
01358     virtual bool isEmpty() const;
01359 
01363     KDateTime dateTime() const;
01364 
01368     void setDateTime( const KDateTime &dt );
01369 
01373     int ageInDays() const;
01374 
01375   protected:
01376     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01377 
01378   private:
01379     Q_DECLARE_PRIVATE( Date )
01380 };
01381 
01382 
01383 class NewsgroupsPrivate;
01384 
01390 class KMIME_EXPORT Newsgroups : public Generics::Structured
01391 {
01392   //@cond PRIVATE
01393   kmime_mk_trivial_ctor_with_name( Newsgroups )
01394   //@endcond
01395   public:
01396     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01397     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
01398     virtual QString asUnicodeString() const;
01399     virtual void clear();
01400     virtual bool isEmpty() const;
01401 
01405     QList<QByteArray> groups() const;
01406 
01410     void setGroups( const QList<QByteArray> &groups );
01411 
01416     bool isCrossposted() const;
01417 
01418   protected:
01419     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01420 
01421   private:
01422     Q_DECLARE_PRIVATE( Newsgroups )
01423 };
01424 
01430 class KMIME_EXPORT FollowUpTo : public Newsgroups
01431 {
01432   //@cond PRIVATE
01433   kmime_mk_trivial_ctor_with_name( FollowUpTo )
01434   //@endcond
01435 };
01436 
01437 
01438 class LinesPrivate;
01439 
01445 class KMIME_EXPORT Lines : public Generics::Structured
01446 {
01447   //@cond PRIVATE
01448   kmime_mk_trivial_ctor_with_name( Lines )
01449   //@endcond
01450   public:
01451     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01452     virtual QString asUnicodeString() const;
01453     virtual void clear();
01454     virtual bool isEmpty() const;
01455 
01459     int numberOfLines() const;
01460 
01464     void setNumberOfLines( int lines );
01465 
01466   protected:
01467     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01468 
01469   private:
01470     Q_DECLARE_PRIVATE( Lines )
01471 };
01472 
01476 class KMIME_EXPORT UserAgent : public Generics::Unstructured
01477 {
01478   kmime_mk_trivial_ctor_with_name( UserAgent )
01479 };
01480 
01481 }  //namespace Headers
01482 
01483 }  //namespace KMime
01484 
01485 // undefine code generation macros again
01486 #undef kmime_mk_trivial_ctor
01487 #undef kmime_mk_dptr_ctor
01488 #undef kmime_mk_trivial_ctor_with_name
01489 
01490 #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
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.6.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