• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KMIME Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kmime
kmime_headers.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  kmime_headers.h
3 
4  KMime, the KDE Internet mail/usenet news message library.
5  Copyright (c) 2001-2002 the KMime authors.
6  See file AUTHORS for details
7  Copyright (c) 2006 Volker Krause <vkrause@kde.org>
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Library General Public
11  License as published by the Free Software Foundation; either
12  version 2 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Library General Public License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to
21  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  Boston, MA 02110-1301, USA.
23 */
40 #ifndef __KMIME_HEADERS_H__
41 #define __KMIME_HEADERS_H__
42 
43 #include "kmime_export.h"
44 #include "kmime_header_parsing.h"
45 
46 #include <QtCore/QString>
47 #include <QtCore/QStringList>
48 #include <QtCore/QRegExp>
49 #include <QtCore/QDateTime>
50 #include <QtCore/QMap>
51 #include <QtCore/QList>
52 #include <QtCore/QByteArray>
53 
54 #include <kdatetime.h>
55 
56 namespace KMime {
57 
58 class Content;
59 
60 namespace Headers {
61 
62 class BasePrivate;
63 
64 enum contentCategory {
65  CCsingle,
66  CCcontainer,
67  CCmixedPart,
68  CCalternativePart
69 };
70 
74 enum contentEncoding {
75  CE7Bit,
76  CE8Bit,
77  CEquPr,
78  CEbase64,
79  CEuuenc,
80  CEbinary
81 };
82 
86 enum contentDisposition {
87  CDInvalid,
88  CDinline,
89  CDattachment,
90  CDparallel
91 };
92 
93 //often used charset
94 // TODO: get rid of this!
95 static const QByteArray Latin1( "ISO-8859-1" );
96 
97 //@cond PRIVATE
98 // internal macro to generate default constructors
99 #define kmime_mk_trivial_ctor( subclass ) \
100  public: \
101  explicit subclass( Content *parent = 0 ); \
102  subclass( Content *parent, const QByteArray &s ); \
103  subclass( Content *parent, const QString &s, const QByteArray &charset ); \
104  ~subclass();
105 
106 #define kmime_mk_dptr_ctor( subclass ) \
107  protected: \
108  explicit subclass( subclass##Private *d, KMime::Content *parent = 0 );
109 
110 #define kmime_mk_trivial_ctor_with_name( subclass ) \
111  kmime_mk_trivial_ctor( subclass ) \
112  const char *type() const; \
113  static const char *staticType();
114 //@endcond
115 
116 //
117 //
118 // HEADER'S BASE CLASS. DEFINES THE COMMON INTERFACE
119 //
120 //
121 
124 class KMIME_EXPORT Base
125 {
126  public:
130  typedef QList<KMime::Headers::Base*> List;
131 
135  explicit Base( KMime::Content *parent = 0 );
136 
140  virtual ~Base();
141 
145  KMime::Content *parent() const;
146 
150  void setParent( KMime::Content *parent );
151 
156  virtual void from7BitString( const QByteArray &s ) = 0;
157 
162  virtual QByteArray as7BitString( bool withHeaderType = true ) const = 0;
163 
167  QByteArray rfc2047Charset() const;
168 
173  void setRFC2047Charset( const QByteArray &cs );
174 
178  QByteArray defaultCharset() const;
179 
183  bool forceDefaultCharset() const;
184 
190  virtual void fromUnicodeString( const QString &s, const QByteArray &b ) = 0;
191 
199  virtual QString asUnicodeString() const = 0;
200 
204  virtual void clear() = 0;
205 
209  virtual bool isEmpty() const = 0;
210 
214  virtual const char *type() const;
215 
219  bool is( const char *t ) const;
220 
224  bool isMimeHeader() const;
225 
229  bool isXHeader() const;
230 
231  protected:
235  QByteArray typeIntro() const;
236 
237  //@cond PRIVATE
238  BasePrivate *d_ptr;
239  kmime_mk_dptr_ctor( Base )
240  //@endcond
241 
242  private:
243  Q_DECLARE_PRIVATE( Base )
244  Q_DISABLE_COPY( Base )
245 };
246 
247 //
248 //
249 // GENERIC BASE CLASSES FOR DIFFERENT TYPES OF FIELDS
250 //
251 //
252 
253 namespace Generics {
254 
255 class UnstructuredPrivate;
256 
267 // known issues:
268 // - uses old decodeRFC2047String function, instead of our own...
269 
270 class KMIME_EXPORT Unstructured : public Base
271 {
272  //@cond PRIVATE
273  kmime_mk_dptr_ctor( Unstructured )
274  //@endcond
275  public:
276  explicit Unstructured( Content *p = 0 );
277  Unstructured( Content *p, const QByteArray &s );
278  Unstructured( Content *p, const QString &s, const QByteArray &cs );
279  ~Unstructured();
280 
281  virtual void from7BitString( const QByteArray &s );
282  virtual QByteArray as7BitString( bool withHeaderType=true ) const;
283 
284  virtual void fromUnicodeString( const QString &s,
285  const QByteArray &b );
286  virtual QString asUnicodeString() const;
287 
288  virtual void clear();
289 
290  virtual bool isEmpty() const;
291 
292  private:
293  Q_DECLARE_PRIVATE( Unstructured )
294 };
295 
296 
297 class StructuredPrivate;
298 
329 class KMIME_EXPORT Structured : public Base
330 {
331  public:
332  explicit Structured( Content *p = 0 );
333  Structured( Content *p, const QByteArray &s );
334  Structured( Content *p, const QString &s, const QByteArray &cs );
335  ~Structured();
336 
337  virtual void from7BitString( const QByteArray &s );
338  virtual QString asUnicodeString() const;
339  virtual void fromUnicodeString( const QString &s, const QByteArray &b );
340 
341  protected:
350  virtual bool parse( const char* &scursor, const char *const send,
351  bool isCRLF = false ) = 0;
352 
353  //@cond PRIVATE
354  kmime_mk_dptr_ctor( Structured )
355  //@endcond
356 
357  private:
358  Q_DECLARE_PRIVATE( Structured )
359 };
360 
361 class AddressPrivate;
362 
366 class KMIME_EXPORT Address : public Structured
367 {
368  public:
369  explicit Address( Content *p = 0 );
370  Address( Content *p, const QByteArray &s );
371  Address( Content *p, const QString &s, const QByteArray &cs );
372  ~Address();
373  protected:
374  //@cond PRIVATE
375  kmime_mk_dptr_ctor( Address )
376  //@endcond
377  private:
378  Q_DECLARE_PRIVATE( Address )
379 };
380 
381 class MailboxListPrivate;
382 
389 class KMIME_EXPORT MailboxList : public Address
390 {
391  //@cond PRIVATE
392  kmime_mk_trivial_ctor( MailboxList )
393  kmime_mk_dptr_ctor( MailboxList )
394  //@endcond
395  public:
396  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
397  virtual void fromUnicodeString( const QString &s, const QByteArray &b );
398  virtual QString asUnicodeString() const;
399 
400  virtual void clear();
401  virtual bool isEmpty() const;
402 
408  void addAddress( const Types::Mailbox &mbox );
409 
415  void addAddress( const QByteArray &address,
416  const QString &displayName = QString() );
417 
421  QList<QByteArray> addresses() const;
422 
428  QStringList displayNames() const;
429 
436  QStringList prettyAddresses() const;
437 
441  Types::Mailbox::List mailboxes() const;
442 
443  protected:
444  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
445 
446  private:
447  Q_DECLARE_PRIVATE( MailboxList )
448 };
449 
450 class SingleMailboxPrivate;
451 
456 class KMIME_EXPORT SingleMailbox : public MailboxList
457 {
458  //@cond PRIVATE
459  kmime_mk_trivial_ctor( SingleMailbox )
460  //@endcond
461  protected:
462  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
463  private:
464  Q_DECLARE_PRIVATE( SingleMailbox )
465 };
466 
467 class AddressListPrivate;
468 
480 class KMIME_EXPORT AddressList : public Address
481 {
482  //@cond PRIVATE
483  kmime_mk_trivial_ctor( AddressList )
484  kmime_mk_dptr_ctor( AddressList )
485  //@endcond
486  public:
487  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
488  virtual void fromUnicodeString( const QString &s, const QByteArray &b );
489  virtual QString asUnicodeString() const;
490 
491  virtual void clear();
492  virtual bool isEmpty() const;
493 
499  void addAddress( const Types::Mailbox &mbox );
500 
506  void addAddress( const QByteArray &address, const QString &displayName = QString() );
507 
511  QList<QByteArray> addresses() const;
512 
517  QStringList displayNames() const;
518 
524  QStringList prettyAddresses() const;
525 
529  Types::Mailbox::List mailboxes() const;
530 
531  protected:
532  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
533 
534  private:
535  Q_DECLARE_PRIVATE( AddressList )
536 };
537 
538 class IdentPrivate;
539 
545 class KMIME_EXPORT Ident : public Address
546 {
547  //@cond PRIVATE
548  kmime_mk_trivial_ctor( Ident )
549  kmime_mk_dptr_ctor( Ident )
550  //@endcond
551  public:
552  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
553  virtual void clear();
554  virtual bool isEmpty() const;
555 
562  QList<QByteArray> identifiers() const;
563 
568  void appendIdentifier( const QByteArray &id );
569 
570  protected:
571  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
572 
573  private:
574  Q_DECLARE_PRIVATE( Ident )
575 };
576 
577 class SingleIdentPrivate;
578 
584 class KMIME_EXPORT SingleIdent : public Ident
585 {
586  //@cond PRIVATE
587  kmime_mk_trivial_ctor( SingleIdent )
588  kmime_mk_dptr_ctor( SingleIdent )
589  //@endcond
590  public:
595  QByteArray identifier() const;
596 
601  void setIdentifier( const QByteArray &id );
602 
603  protected:
604  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
605 
606  private:
607  Q_DECLARE_PRIVATE( SingleIdent )
608 };
609 
610 class TokenPrivate;
611 
615 class KMIME_EXPORT Token : public Structured
616 {
617  //@cond PRIVATE
618  kmime_mk_trivial_ctor( Token )
619  kmime_mk_dptr_ctor( Token )
620  //@endcond
621  public:
622  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
623  virtual void clear();
624  virtual bool isEmpty() const;
625 
629  QByteArray token() const;
630 
634  void setToken( const QByteArray &t );
635 
636  protected:
637  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
638 
639  private:
640  Q_DECLARE_PRIVATE( Token )
641 };
642 
643 class PhraseListPrivate;
644 
648 class KMIME_EXPORT PhraseList : public Structured
649 {
650  //@cond PRIVATE
651  kmime_mk_trivial_ctor( PhraseList )
652  //@endcond
653  public:
654  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
655  virtual QString asUnicodeString() const;
656  virtual void clear();
657  virtual bool isEmpty() const;
658 
662  QStringList phrases() const;
663 
664  protected:
665  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
666 
667  private:
668  Q_DECLARE_PRIVATE( PhraseList )
669 };
670 
671 class DotAtomPrivate;
672 
676 class KMIME_EXPORT DotAtom : public Structured
677 {
678  //@cond PRIVATE
679  kmime_mk_trivial_ctor( DotAtom )
680  //@endcond
681  public:
682  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
683  virtual QString asUnicodeString() const;
684  virtual void clear();
685  virtual bool isEmpty() const;
686 
687  protected:
688  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
689 
690  private:
691  Q_DECLARE_PRIVATE( DotAtom )
692 };
693 
694 class ParametrizedPrivate;
695 
699 class KMIME_EXPORT Parametrized : public Structured
700 {
701  //@cond PRIVATE
702  kmime_mk_trivial_ctor( Parametrized )
703  kmime_mk_dptr_ctor( Parametrized )
704  //@endcond
705  public:
706  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
707 
708  virtual bool isEmpty() const;
709  virtual void clear();
710 
711  //FIXME: Shouldn't the parameter keys be QByteArray and not QStrings? Only the values can be
712  // non-ascii!
713 
718  QString parameter( const QString &key ) const;
719 
725  bool hasParameter( const QString &key ) const;
726 
732  void setParameter( const QString &key, const QString &value );
733 
734  protected:
735  virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
736 
737  private:
738  Q_DECLARE_PRIVATE( Parametrized )
739 };
740 
741 } // namespace Generics
742 
743 //
744 //
745 // INCOMPATIBLE, GSTRUCTURED-BASED FIELDS:
746 //
747 //
748 
749 class ReturnPathPrivate;
750 
756 class KMIME_EXPORT ReturnPath : public Generics::Address
757 {
758  //@cond PRIVATE
759  kmime_mk_trivial_ctor_with_name( ReturnPath )
760  //@endcond
761  public:
762  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
763  virtual void clear();
764  virtual bool isEmpty() const;
765 
766  protected:
767  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
768 
769  private:
770  Q_DECLARE_PRIVATE( ReturnPath )
771 };
772 
773 // Address et al.:
774 
775 // rfc(2)822 headers:
781 class KMIME_EXPORT From : public Generics::MailboxList
782 {
783  kmime_mk_trivial_ctor_with_name( From )
784 };
785 
791 class KMIME_EXPORT Sender : public Generics::SingleMailbox
792 {
793  kmime_mk_trivial_ctor_with_name( Sender )
794 };
795 
801 class KMIME_EXPORT To : public Generics::AddressList
802 {
803  kmime_mk_trivial_ctor_with_name( To )
804 };
805 
811 class KMIME_EXPORT Cc : public Generics::AddressList
812 {
813  kmime_mk_trivial_ctor_with_name( Cc )
814 };
815 
821 class KMIME_EXPORT Bcc : public Generics::AddressList
822 {
823  kmime_mk_trivial_ctor_with_name( Bcc )
824 };
825 
831 class KMIME_EXPORT ReplyTo : public Generics::AddressList
832 {
833  kmime_mk_trivial_ctor_with_name( ReplyTo )
834 };
835 
836 
837 class MailCopiesToPrivate;
838 
844 class KMIME_EXPORT MailCopiesTo : public Generics::AddressList
845 {
846  //@cond PRIVATE
847  kmime_mk_trivial_ctor_with_name( MailCopiesTo )
848  //@endcond
849  public:
850  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
851  virtual QString asUnicodeString() const;
852 
853  virtual void clear();
854  virtual bool isEmpty() const;
855 
859  bool alwaysCopy() const;
860 
864  void setAlwaysCopy();
865 
869  bool neverCopy() const;
870 
874  void setNeverCopy();
875 
876  protected:
877  virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
878 
879  private:
880  Q_DECLARE_PRIVATE( MailCopiesTo )
881 };
882 
883 class ContentTransferEncodingPrivate;
884 
890 class KMIME_EXPORT ContentTransferEncoding : public Generics::Token
891 {
892  //@cond PRIVATE
893  kmime_mk_trivial_ctor_with_name( ContentTransferEncoding )
894  //@endcond
895  public:
896  virtual void clear();
897 
901  contentEncoding encoding() const;
902 
906  void setEncoding( contentEncoding e );
907 
911  // KDE5: rename to isDecoded().
912  bool decoded() const;
913 
920  void setDecoded( bool decoded = true );
921 
926  bool needToEncode() const;
927 
928  protected:
929  virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
930 
931  private:
932  Q_DECLARE_PRIVATE( ContentTransferEncoding )
933 };
934 
940 class KMIME_EXPORT Keywords : public Generics::PhraseList
941 {
942  kmime_mk_trivial_ctor_with_name( Keywords )
943 };
944 
945 // DotAtom:
946 
952 class KMIME_EXPORT MIMEVersion : public Generics::DotAtom
953 {
954  kmime_mk_trivial_ctor_with_name( MIMEVersion )
955 };
956 
957 // Ident:
958 
964 class KMIME_EXPORT MessageID : public Generics::SingleIdent
965 {
966  //@cond PRIVATE
967  kmime_mk_trivial_ctor_with_name( MessageID )
968  //@endcond
969  public:
974  void generate( const QByteArray &fqdn );
975 };
976 
977 class ContentIDPrivate;
978 
982 class KMIME_EXPORT ContentID : public Generics::SingleIdent
983 {
984  //@cond PRIVATE
985  kmime_mk_trivial_ctor_with_name( ContentID )
986  kmime_mk_dptr_ctor( ContentID )
987  //@endcond
988 
989  protected:
990  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
991  private:
992  Q_DECLARE_PRIVATE( ContentID )
993 };
994 
998 class KMIME_EXPORT Supersedes : public Generics::SingleIdent
999 {
1000  kmime_mk_trivial_ctor_with_name( Supersedes )
1001 };
1002 
1008 class KMIME_EXPORT InReplyTo : public Generics::Ident
1009 {
1010  kmime_mk_trivial_ctor_with_name( InReplyTo )
1011 };
1012 
1018 class KMIME_EXPORT References : public Generics::Ident
1019 {
1020  kmime_mk_trivial_ctor_with_name( References )
1021 };
1022 
1023 
1024 class ContentTypePrivate;
1025 
1031 class KMIME_EXPORT ContentType : public Generics::Parametrized
1032 {
1033  //@cond PRIVATE
1034  kmime_mk_trivial_ctor_with_name( ContentType )
1035  //@endcond
1036  public:
1037  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1038  virtual void clear();
1039  virtual bool isEmpty() const;
1040 
1044  QByteArray mimeType() const;
1045 
1050  QByteArray mediaType() const;
1051 
1055  QByteArray subType() const;
1056 
1061  void setMimeType( const QByteArray &mimeType );
1062 
1066  bool isMediatype( const char *mediatype ) const;
1067 
1071  bool isSubtype( const char *subtype ) const;
1072 
1076  bool isText() const;
1077 
1081  bool isPlainText() const;
1082 
1086  bool isHTMLText() const;
1087 
1091  bool isImage() const;
1092 
1096  bool isMultipart() const;
1097 
1102  bool isPartial() const;
1103 
1107  QByteArray charset() const;
1108 
1112  void setCharset( const QByteArray &s );
1113 
1117  QByteArray boundary() const;
1118 
1122  void setBoundary( const QByteArray &s );
1123 
1127  QString name() const;
1128 
1132  void setName( const QString &s, const QByteArray &cs );
1133 
1137  QByteArray id() const;
1138 
1142  void setId( const QByteArray &s );
1143 
1148  int partialNumber() const;
1149 
1154  int partialCount() const;
1155 
1161  void setPartialParams( int total, int number );
1162 
1163  // TODO: document
1164  contentCategory category() const;
1165 
1166  void setCategory( contentCategory c );
1167 
1168  protected:
1169  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
1170 
1171  private:
1172  Q_DECLARE_PRIVATE( ContentType )
1173 };
1174 
1175 class ContentDispositionPrivate;
1176 
1182 class KMIME_EXPORT ContentDisposition : public Generics::Parametrized
1183 {
1184  //@cond PRIVATE
1185  kmime_mk_trivial_ctor_with_name( ContentDisposition )
1186  //@endcond
1187  public:
1188  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1189  virtual bool isEmpty() const;
1190  virtual void clear();
1191 
1195  contentDisposition disposition() const;
1196 
1201  void setDisposition( contentDisposition disp );
1202 
1208  QString filename() const;
1209 
1216  void setFilename( const QString &filename );
1217 
1218  protected:
1219  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
1220 
1221  private:
1222  Q_DECLARE_PRIVATE( ContentDisposition )
1223 };
1224 
1225 //
1226 //
1227 // COMPATIBLE GUNSTRUCTURED-BASED FIELDS:
1228 //
1229 //
1230 
1231 
1232 class GenericPrivate;
1233 
1239 class KMIME_EXPORT Generic : public Generics::Unstructured
1240 {
1241  public:
1242  Generic();
1243  Generic( const char *t );
1244  Generic( const char *t, Content *p );
1245  Generic( const char *t, Content *p, const QByteArray &s );
1246  Generic( const char *t, Content *p, const QString &s, const QByteArray &cs );
1247  ~Generic();
1248 
1249  virtual void clear();
1250 
1251  virtual bool isEmpty() const;
1252 
1253  virtual const char *type() const;
1254 
1255  void setType( const char *type );
1256 
1257  private:
1258  Q_DECLARE_PRIVATE( Generic )
1259 };
1260 
1266 class KMIME_EXPORT Subject : public Generics::Unstructured
1267 {
1268  //@cond PRIVATE
1269  kmime_mk_trivial_ctor_with_name( Subject )
1270  //@endcond
1271  public:
1272  bool isReply() const;
1273 };
1274 
1278 class KMIME_EXPORT Organization : public Generics::Unstructured
1279 {
1280  kmime_mk_trivial_ctor_with_name( Organization )
1281 };
1282 
1286 class KMIME_EXPORT ContentDescription : public Generics::Unstructured
1287 {
1288  kmime_mk_trivial_ctor_with_name( ContentDescription )
1289 };
1290 
1295 class KMIME_EXPORT ContentLocation : public Generics::Unstructured
1296 {
1297  kmime_mk_trivial_ctor_with_name( ContentLocation )
1298 };
1299 
1300 class ControlPrivate;
1301 
1307 class KMIME_EXPORT Control : public Generics::Structured
1308 {
1309  //@cond PRIVATE
1310  kmime_mk_trivial_ctor_with_name( Control )
1311  //@endcond
1312  public:
1313  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1314  virtual void clear();
1315  virtual bool isEmpty() const;
1316 
1320  QByteArray controlType() const;
1321 
1325  QByteArray parameter() const;
1326 
1331  bool isCancel() const;
1332 
1337  void setCancel( const QByteArray &msgid );
1338 
1339  protected:
1340  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1341 
1342  private:
1343  Q_DECLARE_PRIVATE( Control )
1344 };
1345 
1346 class DatePrivate;
1347 
1353 class KMIME_EXPORT Date : public Generics::Structured
1354 {
1355  //@cond PRIVATE
1356  kmime_mk_trivial_ctor_with_name( Date )
1357  //@endcond
1358  public:
1359  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1360  virtual void clear();
1361  virtual bool isEmpty() const;
1362 
1366  KDateTime dateTime() const;
1367 
1371  void setDateTime( const KDateTime &dt );
1372 
1376  int ageInDays() const;
1377 
1378  protected:
1379  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1380 
1381  private:
1382  Q_DECLARE_PRIVATE( Date )
1383 };
1384 
1385 
1386 class NewsgroupsPrivate;
1387 
1393 class KMIME_EXPORT Newsgroups : public Generics::Structured
1394 {
1395  //@cond PRIVATE
1396  kmime_mk_trivial_ctor_with_name( Newsgroups )
1397  //@endcond
1398  public:
1399  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1400  virtual void fromUnicodeString( const QString &s, const QByteArray &b );
1401  virtual QString asUnicodeString() const;
1402  virtual void clear();
1403  virtual bool isEmpty() const;
1404 
1408  QList<QByteArray> groups() const;
1409 
1413  void setGroups( const QList<QByteArray> &groups );
1414 
1419  bool isCrossposted() const;
1420 
1421  protected:
1422  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1423 
1424  private:
1425  Q_DECLARE_PRIVATE( Newsgroups )
1426 };
1427 
1433 class KMIME_EXPORT FollowUpTo : public Newsgroups
1434 {
1435  //@cond PRIVATE
1436  kmime_mk_trivial_ctor_with_name( FollowUpTo )
1437  //@endcond
1438 };
1439 
1440 
1441 class LinesPrivate;
1442 
1448 class KMIME_EXPORT Lines : public Generics::Structured
1449 {
1450  //@cond PRIVATE
1451  kmime_mk_trivial_ctor_with_name( Lines )
1452  //@endcond
1453  public:
1454  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1455  virtual QString asUnicodeString() const;
1456  virtual void clear();
1457  virtual bool isEmpty() const;
1458 
1462  int numberOfLines() const;
1463 
1467  void setNumberOfLines( int lines );
1468 
1469  protected:
1470  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1471 
1472  private:
1473  Q_DECLARE_PRIVATE( Lines )
1474 };
1475 
1479 class KMIME_EXPORT UserAgent : public Generics::Unstructured
1480 {
1481  kmime_mk_trivial_ctor_with_name( UserAgent )
1482 };
1483 
1486 KMIME_EXPORT Base *createHeader( const QByteArray& type );
1487 
1488 } //namespace Headers
1489 
1490 } //namespace KMime
1491 
1492 // undefine code generation macros again
1493 #undef kmime_mk_trivial_ctor
1494 #undef kmime_mk_dptr_ctor
1495 #undef kmime_mk_trivial_ctor_with_name
1496 
1497 #endif // __KMIME_HEADERS_H__
KMime::Headers::Generics::SingleMailbox
Base class for headers that deal with exactly one mailbox (e.g.
Definition: kmime_headers.h:456
KMime::Headers::MessageID
Represents a "Message-ID" header.
Definition: kmime_headers.h:964
KMime::Headers::ContentDisposition
Represents a "Content-Disposition" header.
Definition: kmime_headers.h:1182
KMime::Headers::Date
Represents a "Date" header.
Definition: kmime_headers.h:1353
KMime::Types::Mailbox
Represents an (email address, display name) pair according RFC 2822, section 3.4. ...
Definition: kmime_header_parsing.h:69
KMime::Headers::References
Represents a "References" header.
Definition: kmime_headers.h:1018
KMime::Headers::Generics::MailboxList
Base class for headers that deal with (possibly multiple) addresses, but don't allow groups...
Definition: kmime_headers.h:389
KMime::Headers::MailCopiesTo
Represents a "Mail-Copies-To" header.
Definition: kmime_headers.h:844
KMime::Headers::Cc
Represents a "Cc" header.
Definition: kmime_headers.h:811
KMime::Headers::To
Represents a "To" header.
Definition: kmime_headers.h:801
KMime::Headers::FollowUpTo
Represents a "Followup-To" header.
Definition: kmime_headers.h:1433
KMime::Headers::Control
Represents a "Control" header.
Definition: kmime_headers.h:1307
KMime::Headers::Generics::Address
Base class for all address related headers.
Definition: kmime_headers.h:366
KMime::Headers::ContentID
Represents a "Content-ID" header.
Definition: kmime_headers.h:982
KMime::Headers::Generics::AddressList
Base class for headers that deal with (possibly multiple) addresses, allowing groups.
Definition: kmime_headers.h:480
KMime::Headers::Generic
Represents an arbitrary header, that can contain any header-field.
Definition: kmime_headers.h:1239
KMime::Headers::MIMEVersion
Represents a "MIME-Version" header.
Definition: kmime_headers.h:952
KMime::Headers::ReturnPath
Represents the Return-Path header field.
Definition: kmime_headers.h:756
KMime::Headers::Generics::Parametrized
Base class for headers containing a parameter list such as "Content-Type".
Definition: kmime_headers.h:699
KMime::Headers::Generics::DotAtom
Base class for headers containing a dot atom.
Definition: kmime_headers.h:676
KMime::Headers::From
Represent a "From" header.
Definition: kmime_headers.h:781
KMime::Headers::Base
Baseclass of all header-classes.
Definition: kmime_headers.h:124
KMime::Headers::Generics::PhraseList
Base class for headers containing a list of phrases.
Definition: kmime_headers.h:648
KMime::Headers::ReplyTo
Represents a "ReplyTo" header.
Definition: kmime_headers.h:831
KMime::Headers::ContentLocation
Represents a "Content-Location" header.
Definition: kmime_headers.h:1295
KMime::Headers::Lines
Represents a "Lines" header.
Definition: kmime_headers.h:1448
KMime::Headers::Keywords
Represents a "Keywords" header.
Definition: kmime_headers.h:940
KMime::Headers::ContentDescription
Represents a "Content-Description" header.
Definition: kmime_headers.h:1286
KMime::Headers::Newsgroups
Represents a "Newsgroups" header.
Definition: kmime_headers.h:1393
KMime::Headers::Base::List
QList< KMime::Headers::Base * > List
A list of headers.
Definition: kmime_headers.h:130
KMime::Headers::InReplyTo
Represents a "In-Reply-To" header.
Definition: kmime_headers.h:1008
KMime::Headers::Supersedes
Represents a "Supersedes" header.
Definition: kmime_headers.h:998
KMime::Headers::Subject
Represents a "Subject" header.
Definition: kmime_headers.h:1266
KMime::Headers::Generics::SingleIdent
Base class for headers which deal with a single msg-id.
Definition: kmime_headers.h:584
KMime::Headers::Organization
Represents a "Organization" header.
Definition: kmime_headers.h:1278
KMime::Headers::Generics::Unstructured
Abstract base class for unstructured header fields (e.g.
Definition: kmime_headers.h:270
KMime::Content
A class that encapsulates MIME encoded Content.
Definition: kmime_content.h:112
KMime::Headers::Generics::Ident
Base class for headers which deal with a list of msg-id's.
Definition: kmime_headers.h:545
KMime::Headers::UserAgent
Represents a "User-Agent" header.
Definition: kmime_headers.h:1479
KMime::Headers::ContentTransferEncoding
Represents a "Content-Transfer-Encoding" header.
Definition: kmime_headers.h:890
KMime::Headers::Generics::Structured
Base class for structured header fields.
Definition: kmime_headers.h:329
KMime::Headers::Generics::Token
Base class for headers which deal with a single atom.
Definition: kmime_headers.h:615
KMime::Headers::ContentType
Represents a "Content-Type" header.
Definition: kmime_headers.h:1031
KMime::Headers::Bcc
Represents a "Bcc" header.
Definition: kmime_headers.h:821
KMime::Headers::Sender
Represents a "Sender" header.
Definition: kmime_headers.h:791
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KMIME Library

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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