• 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 //@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 
00726     bool hasParameter( const QString &key ) const;
00727 
00733     void setParameter( const QString &key, const QString &value );
00734 
00735   protected:
00736     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00737 
00738   private:
00739     Q_DECLARE_PRIVATE(Parametrized)
00740 };
00741 
00742 } // namespace Generics
00743 
00744 //
00745 //
00746 // INCOMPATIBLE, GSTRUCTURED-BASED FIELDS:
00747 //
00748 //
00749 
00750 class ReturnPathPrivate;
00751 
00757 class KMIME_EXPORT ReturnPath : public Generics::Address
00758 {
00759   //@cond PRIVATE
00760   kmime_mk_trivial_ctor_with_name( ReturnPath )
00761   //@endcond
00762   public:
00763     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00764     virtual void clear();
00765     virtual bool isEmpty() const;
00766 
00767   protected:
00768     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00769 
00770   private:
00771     Q_DECLARE_PRIVATE(ReturnPath)
00772 };
00773 
00774 // Address et al.:
00775 
00776 // rfc(2)822 headers:
00782 class KMIME_EXPORT From : public Generics::MailboxList
00783 {
00784   kmime_mk_trivial_ctor_with_name( From )
00785 };
00786 
00792 class KMIME_EXPORT Sender : public Generics::SingleMailbox
00793 {
00794   kmime_mk_trivial_ctor_with_name( Sender )
00795 };
00796 
00802 class KMIME_EXPORT To : public Generics::AddressList
00803 {
00804   kmime_mk_trivial_ctor_with_name( To )
00805 };
00806 
00812 class KMIME_EXPORT Cc : public Generics::AddressList
00813 {
00814   kmime_mk_trivial_ctor_with_name( Cc )
00815 };
00816 
00822 class KMIME_EXPORT Bcc : public Generics::AddressList
00823 {
00824   kmime_mk_trivial_ctor_with_name( Bcc )
00825 };
00826 
00832 class KMIME_EXPORT ReplyTo : public Generics::AddressList
00833 {
00834   kmime_mk_trivial_ctor_with_name( ReplyTo )
00835 };
00836 
00837 
00838 class MailCopiesToPrivate;
00839 
00845 class KMIME_EXPORT MailCopiesTo : public Generics::AddressList
00846 {
00847   //@cond PRIVATE
00848   kmime_mk_trivial_ctor_with_name( MailCopiesTo )
00849   //@endcond
00850   public:
00851     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
00852     virtual QString asUnicodeString() const;
00853 
00854     virtual void clear();
00855     virtual bool isEmpty() const;
00856 
00860     bool alwaysCopy() const;
00861 
00865     void setAlwaysCopy();
00866 
00870     bool neverCopy() const;
00871 
00875     void setNeverCopy();
00876 
00877   protected:
00878     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00879 
00880   private:
00881     Q_DECLARE_PRIVATE(MailCopiesTo)
00882 };
00883 
00884 
00885 class ContentTransferEncodingPrivate;
00886 
00892 class KMIME_EXPORT ContentTransferEncoding : public Generics::Token
00893 {
00894   //@cond PRIVATE
00895   kmime_mk_trivial_ctor_with_name( ContentTransferEncoding )
00896   //@endcond
00897   public:
00898     virtual void clear();
00899 
00903     contentEncoding encoding() const;
00904 
00908     void setEncoding( contentEncoding e );
00909 
00913     // KDE5: rename to isDecoded().
00914     bool decoded() const;
00915 
00921     void setDecoded( bool decoded = true );
00922 
00927     bool needToEncode() const;
00928 
00929   protected:
00930     virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00931 
00932   private:
00933     Q_DECLARE_PRIVATE(ContentTransferEncoding)
00934 };
00935 
00941 class KMIME_EXPORT Keywords : public Generics::PhraseList
00942 {
00943   kmime_mk_trivial_ctor_with_name( Keywords )
00944 };
00945 
00946 // DotAtom:
00947 
00953 class KMIME_EXPORT MIMEVersion : public Generics::DotAtom
00954 {
00955   kmime_mk_trivial_ctor_with_name( MIMEVersion )
00956 };
00957 
00958 // Ident:
00959 
00965 class KMIME_EXPORT MessageID : public Generics::SingleIdent
00966 {
00967   //@cond PRIVATE
00968   kmime_mk_trivial_ctor_with_name( MessageID )
00969   //@endcond
00970   public:
00975     void generate( const QByteArray &fqdn );
00976 };
00977 
00978 class ContentIDPrivate;
00979 
00983 class KMIME_EXPORT ContentID : public Generics::SingleIdent
00984 {
00985   //@cond PRIVATE
00986   kmime_mk_trivial_ctor_with_name( ContentID )
00987   kmime_mk_dptr_ctor( ContentID )
00988   //@endcond
00989 
00990   protected:
00991     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
00992   private:
00993     Q_DECLARE_PRIVATE(ContentID)
00994 };
00995 
00999 class KMIME_EXPORT Supersedes : public Generics::SingleIdent
01000 {
01001   kmime_mk_trivial_ctor_with_name( Supersedes )
01002 };
01003 
01009 class KMIME_EXPORT InReplyTo : public Generics::Ident
01010 {
01011   kmime_mk_trivial_ctor_with_name( InReplyTo )
01012 };
01013 
01019 class KMIME_EXPORT References : public Generics::Ident
01020 {
01021   kmime_mk_trivial_ctor_with_name( References )
01022 };
01023 
01024 
01025 class ContentTypePrivate;
01026 
01032 class KMIME_EXPORT ContentType : public Generics::Parametrized
01033 {
01034   //@cond PRIVATE
01035   kmime_mk_trivial_ctor_with_name( ContentType )
01036   //@endcond
01037   public:
01038     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01039     virtual void clear();
01040     virtual bool isEmpty() const;
01041 
01045     QByteArray mimeType() const;
01046 
01051     QByteArray mediaType() const;
01052 
01056     QByteArray subType() const;
01057 
01062     void setMimeType( const QByteArray &mimeType );
01063 
01067     bool isMediatype( const char *mediatype ) const;
01068 
01072     bool isSubtype( const char *subtype ) const;
01073 
01077     bool isText() const;
01078 
01082     bool isPlainText() const;
01083 
01087     bool isHTMLText() const;
01088 
01092     bool isImage() const;
01093 
01097     bool isMultipart() const;
01098 
01103     bool isPartial() const;
01104 
01108     QByteArray charset() const;
01109 
01113     void setCharset( const QByteArray &s );
01114 
01118     QByteArray boundary() const;
01119 
01123     void setBoundary( const QByteArray &s );
01124 
01128     QString name() const;
01129 
01133     void setName( const QString &s, const QByteArray &cs );
01134 
01138     QByteArray id() const;
01139 
01143     void setId( const QByteArray &s );
01144 
01149     int partialNumber() const;
01150 
01155     int partialCount() const;
01156 
01162     void setPartialParams( int total, int number );
01163 
01164     // TODO: document
01165     contentCategory category() const;
01166 
01167     void setCategory( contentCategory c );
01168 
01169   protected:
01170     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01171 
01172   private:
01173     Q_DECLARE_PRIVATE(ContentType)
01174 };
01175 
01176 
01177 class ContentDispositionPrivate;
01178 
01184 class KMIME_EXPORT ContentDisposition : public Generics::Parametrized
01185 {
01186   //@cond PRIVATE
01187   kmime_mk_trivial_ctor_with_name( ContentDisposition )
01188   //@endcond
01189   public:
01190     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01191     virtual bool isEmpty() const;
01192     virtual void clear();
01193 
01197     contentDisposition disposition() const;
01198 
01203     void setDisposition( contentDisposition disp );
01204 
01210     QString filename() const;
01211 
01218     void setFilename( const QString &filename );
01219 
01220   protected:
01221     bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
01222 
01223   private:
01224     Q_DECLARE_PRIVATE( ContentDisposition )
01225 };
01226 
01227 //
01228 //
01229 // COMPATIBLE GUNSTRUCTURED-BASED FIELDS:
01230 //
01231 //
01232 
01233 
01234 class GenericPrivate;
01235 
01241 class KMIME_EXPORT Generic : public Generics::Unstructured
01242 {
01243   public:
01244     Generic();
01245     Generic( const char *t );
01246     Generic( const char *t, Content *p );
01247     Generic( const char *t, Content *p, const QByteArray &s );
01248     Generic( const char *t, Content *p, const QString &s, const QByteArray &cs );
01249     ~Generic();
01250 
01251     virtual void clear();
01252 
01253     virtual bool isEmpty() const;
01254 
01255     virtual const char *type() const;
01256 
01257     void setType( const char *type );
01258 
01259   private:
01260     Q_DECLARE_PRIVATE( Generic )
01261 };
01262 
01268 class KMIME_EXPORT Subject : public Generics::Unstructured
01269 {
01270   //@cond PRIVATE
01271   kmime_mk_trivial_ctor_with_name( Subject )
01272   //@endcond
01273   public:
01274     bool isReply() const;
01275 };
01276 
01280 class KMIME_EXPORT Organization : public Generics::Unstructured
01281 {
01282   kmime_mk_trivial_ctor_with_name( Organization )
01283 };
01284 
01288 class KMIME_EXPORT ContentDescription : public Generics::Unstructured
01289 {
01290   kmime_mk_trivial_ctor_with_name( ContentDescription )
01291 };
01292 
01297 class KMIME_EXPORT ContentLocation : public Generics::Unstructured
01298 {
01299   kmime_mk_trivial_ctor_with_name( ContentLocation )
01300 };
01301 
01302 class ControlPrivate;
01303 
01309 class KMIME_EXPORT Control : public Generics::Structured
01310 {
01311   //@cond PRIVATE
01312   kmime_mk_trivial_ctor_with_name( Control )
01313   //@endcond
01314   public:
01315     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01316     virtual void clear();
01317     virtual bool isEmpty() const;
01318 
01322     QByteArray controlType() const;
01323 
01327     QByteArray parameter() const;
01328 
01333     bool isCancel() const;
01334 
01339     void setCancel( const QByteArray &msgid );
01340 
01341   protected:
01342     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01343 
01344   private:
01345     Q_DECLARE_PRIVATE(Control)
01346 };
01347 
01348 
01349 class DatePrivate;
01350 
01356 class KMIME_EXPORT Date : public Generics::Structured
01357 {
01358   //@cond PRIVATE
01359   kmime_mk_trivial_ctor_with_name( Date )
01360   //@endcond
01361   public:
01362     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01363     virtual void clear();
01364     virtual bool isEmpty() const;
01365 
01369     KDateTime dateTime() const;
01370 
01374     void setDateTime( const KDateTime &dt );
01375 
01379     int ageInDays() const;
01380 
01381   protected:
01382     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01383 
01384   private:
01385     Q_DECLARE_PRIVATE( Date )
01386 };
01387 
01388 
01389 class NewsgroupsPrivate;
01390 
01396 class KMIME_EXPORT Newsgroups : public Generics::Structured
01397 {
01398   //@cond PRIVATE
01399   kmime_mk_trivial_ctor_with_name( Newsgroups )
01400   //@endcond
01401   public:
01402     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01403     virtual void fromUnicodeString( const QString &s, const QByteArray &b );
01404     virtual QString asUnicodeString() const;
01405     virtual void clear();
01406     virtual bool isEmpty() const;
01407 
01411     QList<QByteArray> groups() const;
01412 
01416     void setGroups( const QList<QByteArray> &groups );
01417 
01422     bool isCrossposted() const;
01423 
01424   protected:
01425     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01426 
01427   private:
01428     Q_DECLARE_PRIVATE( Newsgroups )
01429 };
01430 
01436 class KMIME_EXPORT FollowUpTo : public Newsgroups
01437 {
01438   //@cond PRIVATE
01439   kmime_mk_trivial_ctor_with_name( FollowUpTo )
01440   //@endcond
01441 };
01442 
01443 
01444 class LinesPrivate;
01445 
01451 class KMIME_EXPORT Lines : public Generics::Structured
01452 {
01453   //@cond PRIVATE
01454   kmime_mk_trivial_ctor_with_name( Lines )
01455   //@endcond
01456   public:
01457     virtual QByteArray as7BitString( bool withHeaderType = true ) const;
01458     virtual QString asUnicodeString() const;
01459     virtual void clear();
01460     virtual bool isEmpty() const;
01461 
01465     int numberOfLines() const;
01466 
01470     void setNumberOfLines( int lines );
01471 
01472   protected:
01473     bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
01474 
01475   private:
01476     Q_DECLARE_PRIVATE( Lines )
01477 };
01478 
01482 class KMIME_EXPORT UserAgent : public Generics::Unstructured
01483 {
01484   kmime_mk_trivial_ctor_with_name( UserAgent )
01485 };
01486 
01487 }  //namespace Headers
01488 
01489 }  //namespace KMime
01490 
01491 // undefine code generation macros again
01492 #undef kmime_mk_trivial_ctor
01493 #undef kmime_mk_dptr_ctor
01494 #undef kmime_mk_trivial_ctor_with_name
01495 
01496 #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