• Skip to content
  • Skip to link menu
KDE 4.5 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     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 
00195     virtual QString asUnicodeString() const = 0;
00196 
00200     virtual void clear() = 0;
00201 
00205     virtual bool isEmpty() const = 0;
00206 
00210     virtual const char *type() const;
00211 
00215     bool is( const char *t ) const;
00216 
00220     bool isMimeHeader() const;
00221 
00225     bool isXHeader() const;
00226 
00227   protected:
00231     QByteArray typeIntro() const;
00232 
00233     //@cond PRIVATE
00234     BasePrivate *d_ptr;
00235     kmime_mk_dptr_ctor( Base )
00236     //@endcond
00237 
00238   private:
00239     Q_DECLARE_PRIVATE(Base)
00240     Q_DISABLE_COPY(Base)
00241 };
00242 
00243 //
00244 //
00245 // GENERIC BASE CLASSES FOR DIFFERENT TYPES OF FIELDS
00246 //
00247 //
00248 
00249 namespace Generics {
00250 
00251 class UnstructuredPrivate;
00252 
00263 // known issues:
00264 // - uses old decodeRFC2047String function, instead of our own...
00265 
00266 class KMIME_EXPORT Unstructured : public Base
00267 {
00268   //@cond PRIVATE
00269   kmime_mk_dptr_ctor( Unstructured )
00270   //@endcond
00271   public:
00272     explicit Unstructured( Content *p = 0 );
00273     Unstructured( Content *p, const QByteArray &s );
00274     Unstructured( Content *p, const QString &s, const QByteArray &cs );
00275     ~Unstructured();
00276 
00277     virtual void from7BitString( const QByteArray &s );
00278     virtual QByteArray as7BitString( bool withHeaderType=true ) const;
00279 
00280     virtual void fromUnicodeString( const QString &s,
00281                                   const QByteArray &b );
00282     virtual QString asUnicodeString() const;
00283 
00284     virtual void clear();
00285 
00286     virtual bool isEmpty() const;
00287 
00288   private:
00289     Q_DECLARE_PRIVATE(Unstructured)
00290 };
00291 
00292 
00293 class StructuredPrivate;
00294 
00325 class KMIME_EXPORT Structured : public Base
00326 {
00327   public:
00328     explicit Structured( Content *p = 0 );
00329     Structured( Content *p, const QByteArray &s );
00330     Structured( Content *p, const QString &s, const QByteArray &cs );
00331     ~Structured();
00332 
00333     virtual void from7BitString( const QByteArray &s );
00334     virtual QString asUnicodeString() const;
00335     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00336 
00337   protected:
00346     virtual bool parse( const char* &scursor, const char *const send,
00347                         bool isCRLF = false ) = 0;
00348 
00349     //@cond PRIVATE
00350     kmime_mk_dptr_ctor( Structured )
00351     //@endcond
00352 
00353   private:
00354     Q_DECLARE_PRIVATE(Structured)
00355 };
00356 
00357 
00358 class AddressPrivate;
00359 
00363 class KMIME_EXPORT Address : public Structured
00364 {
00365   public:
00366     explicit Address( Content *p = 0 );
00367     Address( Content *p, const QByteArray &s );
00368     Address( Content *p, const QString &s, const QByteArray &cs );
00369     ~Address();
00370   protected:
00371     //@cond PRIVATE
00372     kmime_mk_dptr_ctor( Address )
00373     //@endcond
00374   private:
00375     Q_DECLARE_PRIVATE(Address)
00376 };
00377 
00378 
00379 class MailboxListPrivate;
00380 
00387 class KMIME_EXPORT MailboxList : public Address
00388 {
00389   //@cond PRIVATE
00390   kmime_mk_trivial_ctor( MailboxList )
00391   kmime_mk_dptr_ctor( MailboxList )
00392   //@endcond
00393   public:
00394     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00395     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00396     virtual QString asUnicodeString() const;
00397 
00398     virtual void clear();
00399     virtual bool isEmpty() const;
00400 
00406     void addAddress( const Types::Mailbox &mbox );
00407 
00413     void addAddress( const QByteArray &address,
00414                      const QString &displayName = QString() );
00415 
00419     QList<QByteArray> addresses() const;
00420 
00426     QStringList displayNames() const;
00427 
00434     QStringList prettyAddresses() const;
00435 
00439     Types::Mailbox::List mailboxes() const;
00440 
00441   protected:
00442     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00443 
00444   private:
00445     Q_DECLARE_PRIVATE(MailboxList)
00446 };
00447 
00448 
00449 class SingleMailboxPrivate;
00450 
00455 class KMIME_EXPORT SingleMailbox : public MailboxList
00456 {
00457   //@cond PRIVATE
00458   kmime_mk_trivial_ctor( SingleMailbox )
00459   //@endcond
00460   protected:
00461     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00462   private:
00463     Q_DECLARE_PRIVATE(SingleMailbox)
00464 };
00465 
00466 
00467 class AddressListPrivate;
00468 
00480 class KMIME_EXPORT AddressList : public Address
00481 {
00482   //@cond PRIVATE
00483   kmime_mk_trivial_ctor( AddressList )
00484   kmime_mk_dptr_ctor( AddressList )
00485   //@endcond
00486   public:
00487     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00488     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
00489     virtual QString asUnicodeString() const;
00490 
00491     virtual void clear();
00492     virtual bool isEmpty() const;
00493 
00499     void addAddress( const Types::Mailbox &mbox );
00500 
00506     void addAddress( const QByteArray &address, const QString &displayName = QString() );
00507 
00511     QList<QByteArray> addresses() const;
00512 
00517     QStringList displayNames() const;
00518 
00524     QStringList prettyAddresses() const;
00525 
00529     Types::Mailbox::List mailboxes() const;
00530 
00531   protected:
00532     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00533 
00534   private:
00535     Q_DECLARE_PRIVATE(AddressList)
00536 };
00537 
00538 
00539 class IdentPrivate;
00540 
00546 class KMIME_EXPORT Ident : public Address
00547 {
00548   //@cond PRIVATE
00549   kmime_mk_trivial_ctor( Ident )
00550   kmime_mk_dptr_ctor( Ident )
00551   //@endcond
00552   public:
00553     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00554     virtual void clear();
00555     virtual bool isEmpty() const;
00556 
00563     QList<QByteArray> identifiers() const;
00564 
00569     void appendIdentifier( const QByteArray &id );
00570 
00571   protected:
00572     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00573 
00574   private:
00575     Q_DECLARE_PRIVATE(Ident)
00576 };
00577 
00578 
00579 class SingleIdentPrivate;
00580 
00586 class KMIME_EXPORT SingleIdent : public Ident
00587 {
00588   //@cond PRIVATE
00589   kmime_mk_trivial_ctor( SingleIdent )
00590   kmime_mk_dptr_ctor( SingleIdent )
00591   //@endcond
00592   public:
00597     QByteArray identifier() const;
00598 
00603     void setIdentifier( const QByteArray &id );
00604 
00605   protected:
00606     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00607 
00608   private:
00609     Q_DECLARE_PRIVATE(SingleIdent)
00610 };
00611 
00612 
00613 class TokenPrivate;
00614 
00618 class KMIME_EXPORT Token : public Structured
00619 {
00620   //@cond PRIVATE
00621   kmime_mk_trivial_ctor( Token )
00622   kmime_mk_dptr_ctor( Token )
00623   //@endcond
00624   public:
00625     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00626     virtual void clear();
00627     virtual bool isEmpty() const;
00628 
00632     QByteArray token() const;
00633 
00637     void setToken( const QByteArray &t );
00638 
00639   protected:
00640     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00641 
00642   private:
00643     Q_DECLARE_PRIVATE(Token)
00644 };
00645 
00646 
00647 class PhraseListPrivate;
00648 
00652 class KMIME_EXPORT PhraseList : public Structured
00653 {
00654   //@cond PRIVATE
00655   kmime_mk_trivial_ctor( PhraseList )
00656   //@endcond
00657   public:
00658     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00659     virtual QString asUnicodeString() const;
00660     virtual void clear();
00661     virtual bool isEmpty() const;
00662 
00666     QStringList phrases() const;
00667 
00668   protected:
00669     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00670 
00671   private:
00672     Q_DECLARE_PRIVATE(PhraseList)
00673 };
00674 
00675 
00676 class DotAtomPrivate;
00677 
00681 class KMIME_EXPORT DotAtom : public Structured
00682 {
00683   //@cond PRIVATE
00684   kmime_mk_trivial_ctor( DotAtom )
00685   //@endcond
00686   public:
00687     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00688     virtual QString asUnicodeString() const;
00689     virtual void clear();
00690     virtual bool isEmpty() const;
00691 
00692   protected:
00693     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00694 
00695   private:
00696     Q_DECLARE_PRIVATE(DotAtom)
00697 };
00698 
00699 
00700 class ParametrizedPrivate;
00701 
00705 class KMIME_EXPORT Parametrized : public Structured
00706 {
00707   //@cond PRIVATE
00708   kmime_mk_trivial_ctor( Parametrized )
00709   kmime_mk_dptr_ctor( Parametrized )
00710   //@endcond
00711   public:
00712     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00713 
00714     virtual bool isEmpty() const;
00715     virtual void clear();
00716 
00721     QString parameter( const QString &key ) const;
00722 
00727     bool hasParameter( const QString &key ) const;
00728 
00734     void setParameter( const QString &key, const QString &value );
00735 
00736   protected:
00737     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00738 
00739   private:
00740     Q_DECLARE_PRIVATE(Parametrized)
00741 };
00742 
00743 } // namespace Generics
00744 
00745 //
00746 //
00747 // INCOMPATIBLE, GSTRUCTURED-BASED FIELDS:
00748 //
00749 //
00750 
00751 class ReturnPathPrivate;
00752 
00758 class KMIME_EXPORT ReturnPath : public Generics::Address
00759 {
00760   //@cond PRIVATE
00761   kmime_mk_trivial_ctor_with_name( ReturnPath )
00762   //@endcond
00763   public:
00764     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00765     virtual void clear();
00766     virtual bool isEmpty() const;
00767 
00768   protected:
00769     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00770 
00771   private:
00772     Q_DECLARE_PRIVATE(ReturnPath)
00773 };
00774 
00775 // Address et al.:
00776 
00777 // rfc(2)822 headers:
00783 class KMIME_EXPORT From : public Generics::MailboxList
00784 {
00785   kmime_mk_trivial_ctor_with_name( From )
00786 };
00787 
00793 class KMIME_EXPORT Sender : public Generics::SingleMailbox
00794 {
00795   kmime_mk_trivial_ctor_with_name( Sender )
00796 };
00797 
00803 class KMIME_EXPORT To : public Generics::AddressList
00804 {
00805   kmime_mk_trivial_ctor_with_name( To )
00806 };
00807 
00813 class KMIME_EXPORT Cc : public Generics::AddressList
00814 {
00815   kmime_mk_trivial_ctor_with_name( Cc )
00816 };
00817 
00823 class KMIME_EXPORT Bcc : public Generics::AddressList
00824 {
00825   kmime_mk_trivial_ctor_with_name( Bcc )
00826 };
00827 
00833 class KMIME_EXPORT ReplyTo : public Generics::AddressList
00834 {
00835   kmime_mk_trivial_ctor_with_name( ReplyTo )
00836 };
00837 
00838 
00839 class MailCopiesToPrivate;
00840 
00846 class KMIME_EXPORT MailCopiesTo : public Generics::AddressList
00847 {
00848   //@cond PRIVATE
00849   kmime_mk_trivial_ctor_with_name( MailCopiesTo )
00850   //@endcond
00851   public:
00852     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00853     virtual QString asUnicodeString() const;
00854 
00855     virtual void clear();
00856     virtual bool isEmpty() const;
00857 
00861     bool alwaysCopy() const;
00862 
00866     void setAlwaysCopy();
00867 
00871     bool neverCopy() const;
00872 
00876     void setNeverCopy();
00877 
00878   protected:
00879     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00880 
00881   private:
00882     Q_DECLARE_PRIVATE(MailCopiesTo)
00883 };
00884 
00885 
00886 class ContentTransferEncodingPrivate;
00887 
00893 class KMIME_EXPORT ContentTransferEncoding : public Generics::Token
00894 {
00895   //@cond PRIVATE
00896   kmime_mk_trivial_ctor_with_name( ContentTransferEncoding )
00897   //@endcond
00898   public:
00899     virtual void clear();
00900 
00904     contentEncoding encoding() const;
00905 
00909     void setEncoding( contentEncoding e );
00910 
00914     // KDE5: rename to isDecoded().
00915     bool decoded() const;
00916 
00922     void setDecoded( bool decoded = true );
00923 
00928     bool needToEncode() const;
00929 
00930   protected:
00931     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00932 
00933   private:
00934     Q_DECLARE_PRIVATE(ContentTransferEncoding)
00935 };
00936 
00942 class KMIME_EXPORT Keywords : public Generics::PhraseList
00943 {
00944   kmime_mk_trivial_ctor_with_name( Keywords )
00945 };
00946 
00947 // DotAtom:
00948 
00954 class KMIME_EXPORT MIMEVersion : public Generics::DotAtom
00955 {
00956   kmime_mk_trivial_ctor_with_name( MIMEVersion )
00957 };
00958 
00959 // Ident:
00960 
00966 class KMIME_EXPORT MessageID : public Generics::SingleIdent
00967 {
00968   //@cond PRIVATE
00969   kmime_mk_trivial_ctor_with_name( MessageID )
00970   //@endcond
00971   public:
00976     void generate( const QByteArray &fqdn );
00977 };
00978 
00979 class ContentIDPrivate;
00980 
00984 class KMIME_EXPORT ContentID : public Generics::SingleIdent
00985 {
00986   //@cond PRIVATE
00987   kmime_mk_trivial_ctor_with_name( ContentID )
00988   kmime_mk_dptr_ctor( ContentID )
00989   //@endcond
00990 
00991   protected:
00992     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00993   private:
00994     Q_DECLARE_PRIVATE(ContentID)
00995 };
00996 
01000 class KMIME_EXPORT Supersedes : public Generics::SingleIdent
01001 {
01002   kmime_mk_trivial_ctor_with_name( Supersedes )
01003 };
01004 
01010 class KMIME_EXPORT InReplyTo : public Generics::Ident
01011 {
01012   kmime_mk_trivial_ctor_with_name( InReplyTo )
01013 };
01014 
01020 class KMIME_EXPORT References : public Generics::Ident
01021 {
01022   kmime_mk_trivial_ctor_with_name( References )
01023 };
01024 
01025 
01026 class ContentTypePrivate;
01027 
01033 class KMIME_EXPORT ContentType : public Generics::Parametrized
01034 {
01035   //@cond PRIVATE
01036   kmime_mk_trivial_ctor_with_name( ContentType )
01037   //@endcond
01038   public:
01039     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01040     virtual void clear();
01041     virtual bool isEmpty() const;
01042 
01046     QByteArray mimeType() const;
01047 
01052     QByteArray mediaType() const;
01053 
01057     QByteArray subType() const;
01058 
01063     void setMimeType( const QByteArray &mimeType );
01064 
01068     bool isMediatype( const char *mediatype ) const;
01069 
01073     bool isSubtype( const char *subtype ) const;
01074 
01078     bool isText() const;
01079 
01083     bool isPlainText() const;
01084 
01088     bool isHTMLText() const;
01089 
01093     bool isImage() const;
01094 
01098     bool isMultipart() const;
01099 
01104     bool isPartial() const;
01105 
01109     QByteArray charset() const;
01110 
01114     void setCharset( const QByteArray &s );
01115 
01119     QByteArray boundary() const;
01120 
01124     void setBoundary( const QByteArray &s );
01125 
01129     QString name() const;
01130 
01134     void setName( const QString &s, const QByteArray &cs );
01135 
01139     QByteArray id() const;
01140 
01144     void setId( const QByteArray &s );
01145 
01150     int partialNumber() const;
01151 
01156     int partialCount() const;
01157 
01163     void setPartialParams( int total, int number );
01164 
01165     // TODO: document
01166     contentCategory category() const;
01167 
01168     void setCategory( contentCategory c );
01169 
01170   protected:
01171     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01172 
01173   private:
01174     Q_DECLARE_PRIVATE(ContentType)
01175 };
01176 
01177 
01178 class ContentDispositionPrivate;
01179 
01185 class KMIME_EXPORT ContentDisposition : public Generics::Parametrized
01186 {
01187   //@cond PRIVATE
01188   kmime_mk_trivial_ctor_with_name( ContentDisposition )
01189   //@endcond
01190   public:
01191     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01192     virtual bool isEmpty() const;
01193     virtual void clear();
01194 
01198     contentDisposition disposition() const;
01199 
01204     void setDisposition( contentDisposition disp );
01205 
01211     QString filename() const;
01212 
01219     void setFilename( const QString &filename );
01220 
01221   protected:
01222     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01223 
01224   private:
01225     Q_DECLARE_PRIVATE( ContentDisposition )
01226 };
01227 
01228 //
01229 //
01230 // COMPATIBLE GUNSTRUCTURED-BASED FIELDS:
01231 //
01232 //
01233 
01234 
01235 class GenericPrivate;
01236 
01242 class KMIME_EXPORT Generic : public Generics::Unstructured
01243 {
01244   public:
01245     Generic();
01246     Generic( const char *t );
01247     Generic( const char *t, Content *p );
01248     Generic( const char *t, Content *p, const QByteArray &s );
01249     Generic( const char *t, Content *p, const QString &s, const QByteArray &cs );
01250     ~Generic();
01251 
01252     virtual void clear();
01253 
01254     virtual bool isEmpty() const;
01255 
01256     virtual const char *type() const;
01257 
01258     void setType( const char *type );
01259 
01260   private:
01261     Q_DECLARE_PRIVATE( Generic )
01262 };
01263 
01269 class KMIME_EXPORT Subject : public Generics::Unstructured
01270 {
01271   //@cond PRIVATE
01272   kmime_mk_trivial_ctor_with_name( Subject )
01273   //@endcond
01274   public:
01275     bool isReply() const;
01276 };
01277 
01281 class KMIME_EXPORT Organization : public Generics::Unstructured
01282 {
01283   kmime_mk_trivial_ctor_with_name( Organization )
01284 };
01285 
01289 class KMIME_EXPORT ContentDescription : public Generics::Unstructured
01290 {
01291   kmime_mk_trivial_ctor_with_name( ContentDescription )
01292 };
01293 
01298 class KMIME_EXPORT ContentLocation : public Generics::Unstructured
01299 {
01300   kmime_mk_trivial_ctor_with_name( ContentLocation )
01301 };
01302 
01303 class ControlPrivate;
01304 
01310 class KMIME_EXPORT Control : public Generics::Structured
01311 {
01312   //@cond PRIVATE
01313   kmime_mk_trivial_ctor_with_name( Control )
01314   //@endcond
01315   public:
01316     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01317     virtual void clear();
01318     virtual bool isEmpty() const;
01319 
01323     QByteArray controlType() const;
01324 
01328     QByteArray parameter() const;
01329 
01334     bool isCancel() const;
01335 
01340     void setCancel( const QByteArray &msgid );
01341 
01342   protected:
01343     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01344 
01345   private:
01346     Q_DECLARE_PRIVATE(Control)
01347 };
01348 
01349 
01350 class DatePrivate;
01351 
01357 class KMIME_EXPORT Date : public Generics::Structured
01358 {
01359   //@cond PRIVATE
01360   kmime_mk_trivial_ctor_with_name( Date )
01361   //@endcond
01362   public:
01363     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01364     virtual void clear();
01365     virtual bool isEmpty() const;
01366 
01370     KDateTime dateTime() const;
01371 
01375     void setDateTime( const KDateTime &dt );
01376 
01380     int ageInDays() const;
01381 
01382   protected:
01383     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01384 
01385   private:
01386     Q_DECLARE_PRIVATE( Date )
01387 };
01388 
01389 
01390 class NewsgroupsPrivate;
01391 
01397 class KMIME_EXPORT Newsgroups : public Generics::Structured
01398 {
01399   //@cond PRIVATE
01400   kmime_mk_trivial_ctor_with_name( Newsgroups )
01401   //@endcond
01402   public:
01403     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01404     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
01405     virtual QString asUnicodeString() const;
01406     virtual void clear();
01407     virtual bool isEmpty() const;
01408 
01412     QList<QByteArray> groups() const;
01413 
01417     void setGroups( const QList<QByteArray> &groups );
01418 
01423     bool isCrossposted() const;
01424 
01425   protected:
01426     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01427 
01428   private:
01429     Q_DECLARE_PRIVATE( Newsgroups )
01430 };
01431 
01437 class KMIME_EXPORT FollowUpTo : public Newsgroups
01438 {
01439   //@cond PRIVATE
01440   kmime_mk_trivial_ctor_with_name( FollowUpTo )
01441   //@endcond
01442 };
01443 
01444 
01445 class LinesPrivate;
01446 
01452 class KMIME_EXPORT Lines : public Generics::Structured
01453 {
01454   //@cond PRIVATE
01455   kmime_mk_trivial_ctor_with_name( Lines )
01456   //@endcond
01457   public:
01458     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01459     virtual QString asUnicodeString() const;
01460     virtual void clear();
01461     virtual bool isEmpty() const;
01462 
01466     int numberOfLines() const;
01467 
01471     void setNumberOfLines( int lines );
01472 
01473   protected:
01474     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01475 
01476   private:
01477     Q_DECLARE_PRIVATE( Lines )
01478 };
01479 
01483 class KMIME_EXPORT UserAgent : public Generics::Unstructured
01484 {
01485   kmime_mk_trivial_ctor_with_name( UserAgent )
01486 };
01487 
01488 }  //namespace Headers
01489 
01490 }  //namespace KMime
01491 
01492 // undefine code generation macros again
01493 #undef kmime_mk_trivial_ctor
01494 #undef kmime_mk_dptr_ctor
01495 #undef kmime_mk_trivial_ctor_with_name
01496 
01497 #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.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