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

KMIME Library

  • 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 
362 class AddressPrivate;
363 
367 class KMIME_EXPORT Address : public Structured
368 {
369  public:
370  explicit Address( Content *p = 0 );
371  Address( Content *p, const QByteArray &s );
372  Address( Content *p, const QString &s, const QByteArray &cs );
373  ~Address();
374  protected:
375  //@cond PRIVATE
376  kmime_mk_dptr_ctor( Address )
377  //@endcond
378  private:
379  Q_DECLARE_PRIVATE(Address)
380 };
381 
382 
383 class MailboxListPrivate;
384 
391 class KMIME_EXPORT MailboxList : public Address
392 {
393  //@cond PRIVATE
394  kmime_mk_trivial_ctor( MailboxList )
395  kmime_mk_dptr_ctor( MailboxList )
396  //@endcond
397  public:
398  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
399  virtual void fromUnicodeString( const QString &s, const QByteArray &b );
400  virtual QString asUnicodeString() const;
401 
402  virtual void clear();
403  virtual bool isEmpty() const;
404 
410  void addAddress( const Types::Mailbox &mbox );
411 
417  void addAddress( const QByteArray &address,
418  const QString &displayName = QString() );
419 
423  QList<QByteArray> addresses() const;
424 
430  QStringList displayNames() const;
431 
438  QStringList prettyAddresses() const;
439 
443  Types::Mailbox::List mailboxes() const;
444 
445  protected:
446  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
447 
448  private:
449  Q_DECLARE_PRIVATE(MailboxList)
450 };
451 
452 
453 class SingleMailboxPrivate;
454 
459 class KMIME_EXPORT SingleMailbox : public MailboxList
460 {
461  //@cond PRIVATE
462  kmime_mk_trivial_ctor( SingleMailbox )
463  //@endcond
464  protected:
465  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
466  private:
467  Q_DECLARE_PRIVATE(SingleMailbox)
468 };
469 
470 
471 class AddressListPrivate;
472 
484 class KMIME_EXPORT AddressList : public Address
485 {
486  //@cond PRIVATE
487  kmime_mk_trivial_ctor( AddressList )
488  kmime_mk_dptr_ctor( AddressList )
489  //@endcond
490  public:
491  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
492  virtual void fromUnicodeString( const QString &s, const QByteArray &b );
493  virtual QString asUnicodeString() const;
494 
495  virtual void clear();
496  virtual bool isEmpty() const;
497 
503  void addAddress( const Types::Mailbox &mbox );
504 
510  void addAddress( const QByteArray &address, const QString &displayName = QString() );
511 
515  QList<QByteArray> addresses() const;
516 
521  QStringList displayNames() const;
522 
528  QStringList prettyAddresses() const;
529 
533  Types::Mailbox::List mailboxes() const;
534 
535  protected:
536  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
537 
538  private:
539  Q_DECLARE_PRIVATE(AddressList)
540 };
541 
542 
543 class IdentPrivate;
544 
550 class KMIME_EXPORT Ident : public Address
551 {
552  //@cond PRIVATE
553  kmime_mk_trivial_ctor( Ident )
554  kmime_mk_dptr_ctor( Ident )
555  //@endcond
556  public:
557  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
558  virtual void clear();
559  virtual bool isEmpty() const;
560 
567  QList<QByteArray> identifiers() const;
568 
573  void appendIdentifier( const QByteArray &id );
574 
575  protected:
576  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
577 
578  private:
579  Q_DECLARE_PRIVATE(Ident)
580 };
581 
582 
583 class SingleIdentPrivate;
584 
590 class KMIME_EXPORT SingleIdent : public Ident
591 {
592  //@cond PRIVATE
593  kmime_mk_trivial_ctor( SingleIdent )
594  kmime_mk_dptr_ctor( SingleIdent )
595  //@endcond
596  public:
601  QByteArray identifier() const;
602 
607  void setIdentifier( const QByteArray &id );
608 
609  protected:
610  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
611 
612  private:
613  Q_DECLARE_PRIVATE(SingleIdent)
614 };
615 
616 
617 class TokenPrivate;
618 
622 class KMIME_EXPORT Token : public Structured
623 {
624  //@cond PRIVATE
625  kmime_mk_trivial_ctor( Token )
626  kmime_mk_dptr_ctor( Token )
627  //@endcond
628  public:
629  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
630  virtual void clear();
631  virtual bool isEmpty() const;
632 
636  QByteArray token() const;
637 
641  void setToken( const QByteArray &t );
642 
643  protected:
644  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
645 
646  private:
647  Q_DECLARE_PRIVATE(Token)
648 };
649 
650 
651 class PhraseListPrivate;
652 
656 class KMIME_EXPORT PhraseList : public Structured
657 {
658  //@cond PRIVATE
659  kmime_mk_trivial_ctor( PhraseList )
660  //@endcond
661  public:
662  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
663  virtual QString asUnicodeString() const;
664  virtual void clear();
665  virtual bool isEmpty() const;
666 
670  QStringList phrases() const;
671 
672  protected:
673  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
674 
675  private:
676  Q_DECLARE_PRIVATE(PhraseList)
677 };
678 
679 
680 class DotAtomPrivate;
681 
685 class KMIME_EXPORT DotAtom : public Structured
686 {
687  //@cond PRIVATE
688  kmime_mk_trivial_ctor( DotAtom )
689  //@endcond
690  public:
691  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
692  virtual QString asUnicodeString() const;
693  virtual void clear();
694  virtual bool isEmpty() const;
695 
696  protected:
697  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
698 
699  private:
700  Q_DECLARE_PRIVATE(DotAtom)
701 };
702 
703 
704 class ParametrizedPrivate;
705 
709 class KMIME_EXPORT Parametrized : public Structured
710 {
711  //@cond PRIVATE
712  kmime_mk_trivial_ctor( Parametrized )
713  kmime_mk_dptr_ctor( Parametrized )
714  //@endcond
715  public:
716  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
717 
718  virtual bool isEmpty() const;
719  virtual void clear();
720 
721  //FIXME: Shouldn't the parameter keys be QByteArray and not QStrings? Only the values can be
722  // non-ascii!
723 
728  QString parameter( const QString &key ) const;
729 
734  bool hasParameter( const QString &key ) const;
735 
741  void setParameter( const QString &key, const QString &value );
742 
743  protected:
744  virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
745 
746  private:
747  Q_DECLARE_PRIVATE(Parametrized)
748 };
749 
750 } // namespace Generics
751 
752 //
753 //
754 // INCOMPATIBLE, GSTRUCTURED-BASED FIELDS:
755 //
756 //
757 
758 class ReturnPathPrivate;
759 
765 class KMIME_EXPORT ReturnPath : public Generics::Address
766 {
767  //@cond PRIVATE
768  kmime_mk_trivial_ctor_with_name( ReturnPath )
769  //@endcond
770  public:
771  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
772  virtual void clear();
773  virtual bool isEmpty() const;
774 
775  protected:
776  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
777 
778  private:
779  Q_DECLARE_PRIVATE(ReturnPath)
780 };
781 
782 // Address et al.:
783 
784 // rfc(2)822 headers:
790 class KMIME_EXPORT From : public Generics::MailboxList
791 {
792  kmime_mk_trivial_ctor_with_name( From )
793 };
794 
800 class KMIME_EXPORT Sender : public Generics::SingleMailbox
801 {
802  kmime_mk_trivial_ctor_with_name( Sender )
803 };
804 
810 class KMIME_EXPORT To : public Generics::AddressList
811 {
812  kmime_mk_trivial_ctor_with_name( To )
813 };
814 
820 class KMIME_EXPORT Cc : public Generics::AddressList
821 {
822  kmime_mk_trivial_ctor_with_name( Cc )
823 };
824 
830 class KMIME_EXPORT Bcc : public Generics::AddressList
831 {
832  kmime_mk_trivial_ctor_with_name( Bcc )
833 };
834 
840 class KMIME_EXPORT ReplyTo : public Generics::AddressList
841 {
842  kmime_mk_trivial_ctor_with_name( ReplyTo )
843 };
844 
845 
846 class MailCopiesToPrivate;
847 
853 class KMIME_EXPORT MailCopiesTo : public Generics::AddressList
854 {
855  //@cond PRIVATE
856  kmime_mk_trivial_ctor_with_name( MailCopiesTo )
857  //@endcond
858  public:
859  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
860  virtual QString asUnicodeString() const;
861 
862  virtual void clear();
863  virtual bool isEmpty() const;
864 
868  bool alwaysCopy() const;
869 
873  void setAlwaysCopy();
874 
878  bool neverCopy() const;
879 
883  void setNeverCopy();
884 
885  protected:
886  virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
887 
888  private:
889  Q_DECLARE_PRIVATE(MailCopiesTo)
890 };
891 
892 
893 class ContentTransferEncodingPrivate;
894 
900 class KMIME_EXPORT ContentTransferEncoding : public Generics::Token
901 {
902  //@cond PRIVATE
903  kmime_mk_trivial_ctor_with_name( ContentTransferEncoding )
904  //@endcond
905  public:
906  virtual void clear();
907 
911  contentEncoding encoding() const;
912 
916  void setEncoding( contentEncoding e );
917 
921  // KDE5: rename to isDecoded().
922  bool decoded() const;
923 
929  void setDecoded( bool decoded = true );
930 
935  bool needToEncode() const;
936 
937  protected:
938  virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
939 
940  private:
941  Q_DECLARE_PRIVATE(ContentTransferEncoding)
942 };
943 
949 class KMIME_EXPORT Keywords : public Generics::PhraseList
950 {
951  kmime_mk_trivial_ctor_with_name( Keywords )
952 };
953 
954 // DotAtom:
955 
961 class KMIME_EXPORT MIMEVersion : public Generics::DotAtom
962 {
963  kmime_mk_trivial_ctor_with_name( MIMEVersion )
964 };
965 
966 // Ident:
967 
973 class KMIME_EXPORT MessageID : public Generics::SingleIdent
974 {
975  //@cond PRIVATE
976  kmime_mk_trivial_ctor_with_name( MessageID )
977  //@endcond
978  public:
983  void generate( const QByteArray &fqdn );
984 };
985 
986 class ContentIDPrivate;
987 
991 class KMIME_EXPORT ContentID : public Generics::SingleIdent
992 {
993  //@cond PRIVATE
994  kmime_mk_trivial_ctor_with_name( ContentID )
995  kmime_mk_dptr_ctor( ContentID )
996  //@endcond
997 
998  protected:
999  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
1000  private:
1001  Q_DECLARE_PRIVATE(ContentID)
1002 };
1003 
1007 class KMIME_EXPORT Supersedes : public Generics::SingleIdent
1008 {
1009  kmime_mk_trivial_ctor_with_name( Supersedes )
1010 };
1011 
1017 class KMIME_EXPORT InReplyTo : public Generics::Ident
1018 {
1019  kmime_mk_trivial_ctor_with_name( InReplyTo )
1020 };
1021 
1027 class KMIME_EXPORT References : public Generics::Ident
1028 {
1029  kmime_mk_trivial_ctor_with_name( References )
1030 };
1031 
1032 
1033 class ContentTypePrivate;
1034 
1040 class KMIME_EXPORT ContentType : public Generics::Parametrized
1041 {
1042  //@cond PRIVATE
1043  kmime_mk_trivial_ctor_with_name( ContentType )
1044  //@endcond
1045  public:
1046  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1047  virtual void clear();
1048  virtual bool isEmpty() const;
1049 
1053  QByteArray mimeType() const;
1054 
1059  QByteArray mediaType() const;
1060 
1064  QByteArray subType() const;
1065 
1070  void setMimeType( const QByteArray &mimeType );
1071 
1075  bool isMediatype( const char *mediatype ) const;
1076 
1080  bool isSubtype( const char *subtype ) const;
1081 
1085  bool isText() const;
1086 
1090  bool isPlainText() const;
1091 
1095  bool isHTMLText() const;
1096 
1100  bool isImage() const;
1101 
1105  bool isMultipart() const;
1106 
1111  bool isPartial() const;
1112 
1116  QByteArray charset() const;
1117 
1121  void setCharset( const QByteArray &s );
1122 
1126  QByteArray boundary() const;
1127 
1131  void setBoundary( const QByteArray &s );
1132 
1136  QString name() const;
1137 
1141  void setName( const QString &s, const QByteArray &cs );
1142 
1146  QByteArray id() const;
1147 
1151  void setId( const QByteArray &s );
1152 
1157  int partialNumber() const;
1158 
1163  int partialCount() const;
1164 
1170  void setPartialParams( int total, int number );
1171 
1172  // TODO: document
1173  contentCategory category() const;
1174 
1175  void setCategory( contentCategory c );
1176 
1177  protected:
1178  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
1179 
1180  private:
1181  Q_DECLARE_PRIVATE(ContentType)
1182 };
1183 
1184 
1185 class ContentDispositionPrivate;
1186 
1192 class KMIME_EXPORT ContentDisposition : public Generics::Parametrized
1193 {
1194  //@cond PRIVATE
1195  kmime_mk_trivial_ctor_with_name( ContentDisposition )
1196  //@endcond
1197  public:
1198  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1199  virtual bool isEmpty() const;
1200  virtual void clear();
1201 
1205  contentDisposition disposition() const;
1206 
1211  void setDisposition( contentDisposition disp );
1212 
1218  QString filename() const;
1219 
1226  void setFilename( const QString &filename );
1227 
1228  protected:
1229  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
1230 
1231  private:
1232  Q_DECLARE_PRIVATE( ContentDisposition )
1233 };
1234 
1235 //
1236 //
1237 // COMPATIBLE GUNSTRUCTURED-BASED FIELDS:
1238 //
1239 //
1240 
1241 
1242 class GenericPrivate;
1243 
1249 class KMIME_EXPORT Generic : public Generics::Unstructured
1250 {
1251  public:
1252  Generic();
1253  Generic( const char *t );
1254  Generic( const char *t, Content *p );
1255  Generic( const char *t, Content *p, const QByteArray &s );
1256  Generic( const char *t, Content *p, const QString &s, const QByteArray &cs );
1257  ~Generic();
1258 
1259  virtual void clear();
1260 
1261  virtual bool isEmpty() const;
1262 
1263  virtual const char *type() const;
1264 
1265  void setType( const char *type );
1266 
1267  private:
1268  Q_DECLARE_PRIVATE( Generic )
1269 };
1270 
1276 class KMIME_EXPORT Subject : public Generics::Unstructured
1277 {
1278  //@cond PRIVATE
1279  kmime_mk_trivial_ctor_with_name( Subject )
1280  //@endcond
1281  public:
1282  bool isReply() const;
1283 };
1284 
1288 class KMIME_EXPORT Organization : public Generics::Unstructured
1289 {
1290  kmime_mk_trivial_ctor_with_name( Organization )
1291 };
1292 
1296 class KMIME_EXPORT ContentDescription : public Generics::Unstructured
1297 {
1298  kmime_mk_trivial_ctor_with_name( ContentDescription )
1299 };
1300 
1305 class KMIME_EXPORT ContentLocation : public Generics::Unstructured
1306 {
1307  kmime_mk_trivial_ctor_with_name( ContentLocation )
1308 };
1309 
1310 class ControlPrivate;
1311 
1317 class KMIME_EXPORT Control : public Generics::Structured
1318 {
1319  //@cond PRIVATE
1320  kmime_mk_trivial_ctor_with_name( Control )
1321  //@endcond
1322  public:
1323  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1324  virtual void clear();
1325  virtual bool isEmpty() const;
1326 
1330  QByteArray controlType() const;
1331 
1335  QByteArray parameter() const;
1336 
1341  bool isCancel() const;
1342 
1347  void setCancel( const QByteArray &msgid );
1348 
1349  protected:
1350  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1351 
1352  private:
1353  Q_DECLARE_PRIVATE(Control)
1354 };
1355 
1356 
1357 class DatePrivate;
1358 
1364 class KMIME_EXPORT Date : public Generics::Structured
1365 {
1366  //@cond PRIVATE
1367  kmime_mk_trivial_ctor_with_name( Date )
1368  //@endcond
1369  public:
1370  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1371  virtual void clear();
1372  virtual bool isEmpty() const;
1373 
1377  KDateTime dateTime() const;
1378 
1382  void setDateTime( const KDateTime &dt );
1383 
1387  int ageInDays() const;
1388 
1389  protected:
1390  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1391 
1392  private:
1393  Q_DECLARE_PRIVATE( Date )
1394 };
1395 
1396 
1397 class NewsgroupsPrivate;
1398 
1404 class KMIME_EXPORT Newsgroups : public Generics::Structured
1405 {
1406  //@cond PRIVATE
1407  kmime_mk_trivial_ctor_with_name( Newsgroups )
1408  //@endcond
1409  public:
1410  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1411  virtual void fromUnicodeString( const QString &s, const QByteArray &b );
1412  virtual QString asUnicodeString() const;
1413  virtual void clear();
1414  virtual bool isEmpty() const;
1415 
1419  QList<QByteArray> groups() const;
1420 
1424  void setGroups( const QList<QByteArray> &groups );
1425 
1430  bool isCrossposted() const;
1431 
1432  protected:
1433  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1434 
1435  private:
1436  Q_DECLARE_PRIVATE( Newsgroups )
1437 };
1438 
1444 class KMIME_EXPORT FollowUpTo : public Newsgroups
1445 {
1446  //@cond PRIVATE
1447  kmime_mk_trivial_ctor_with_name( FollowUpTo )
1448  //@endcond
1449 };
1450 
1451 
1452 class LinesPrivate;
1453 
1459 class KMIME_EXPORT Lines : public Generics::Structured
1460 {
1461  //@cond PRIVATE
1462  kmime_mk_trivial_ctor_with_name( Lines )
1463  //@endcond
1464  public:
1465  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1466  virtual QString asUnicodeString() const;
1467  virtual void clear();
1468  virtual bool isEmpty() const;
1469 
1473  int numberOfLines() const;
1474 
1478  void setNumberOfLines( int lines );
1479 
1480  protected:
1481  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1482 
1483  private:
1484  Q_DECLARE_PRIVATE( Lines )
1485 };
1486 
1490 class KMIME_EXPORT UserAgent : public Generics::Unstructured
1491 {
1492  kmime_mk_trivial_ctor_with_name( UserAgent )
1493 };
1494 
1497 KMIME_EXPORT Base *createHeader( const QByteArray& type );
1498 
1499 } //namespace Headers
1500 
1501 } //namespace KMime
1502 
1503 // undefine code generation macros again
1504 #undef kmime_mk_trivial_ctor
1505 #undef kmime_mk_dptr_ctor
1506 #undef kmime_mk_trivial_ctor_with_name
1507 
1508 #endif // __KMIME_HEADERS_H__
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Sep 24 2012 09:03:11 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KMIME Library

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

kdepimlibs-4.9.1 API Reference

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

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