• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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 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 
724  bool hasParameter( const QString &key ) const;
725 
731  void setParameter( const QString &key, const QString &value );
732 
733  protected:
734  virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
735 
736  private:
737  Q_DECLARE_PRIVATE( Parametrized )
738 };
739 
740 } // namespace Generics
741 
742 //
743 //
744 // INCOMPATIBLE, GSTRUCTURED-BASED FIELDS:
745 //
746 //
747 
748 class ReturnPathPrivate;
749 
755 class KMIME_EXPORT ReturnPath : public Generics::Address
756 {
757  //@cond PRIVATE
758  kmime_mk_trivial_ctor_with_name( ReturnPath )
759  //@endcond
760  public:
761  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
762  virtual void clear();
763  virtual bool isEmpty() const;
764 
765  protected:
766  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
767 
768  private:
769  Q_DECLARE_PRIVATE( ReturnPath )
770 };
771 
772 // Address et al.:
773 
774 // rfc(2)822 headers:
780 class KMIME_EXPORT From : public Generics::MailboxList
781 {
782  kmime_mk_trivial_ctor_with_name( From )
783 };
784 
790 class KMIME_EXPORT Sender : public Generics::SingleMailbox
791 {
792  kmime_mk_trivial_ctor_with_name( Sender )
793 };
794 
800 class KMIME_EXPORT To : public Generics::AddressList
801 {
802  kmime_mk_trivial_ctor_with_name( To )
803 };
804 
810 class KMIME_EXPORT Cc : public Generics::AddressList
811 {
812  kmime_mk_trivial_ctor_with_name( Cc )
813 };
814 
820 class KMIME_EXPORT Bcc : public Generics::AddressList
821 {
822  kmime_mk_trivial_ctor_with_name( Bcc )
823 };
824 
830 class KMIME_EXPORT ReplyTo : public Generics::AddressList
831 {
832  kmime_mk_trivial_ctor_with_name( ReplyTo )
833 };
834 
835 
836 class MailCopiesToPrivate;
837 
843 class KMIME_EXPORT MailCopiesTo : public Generics::AddressList
844 {
845  //@cond PRIVATE
846  kmime_mk_trivial_ctor_with_name( MailCopiesTo )
847  //@endcond
848  public:
849  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
850  virtual QString asUnicodeString() const;
851 
852  virtual void clear();
853  virtual bool isEmpty() const;
854 
858  bool alwaysCopy() const;
859 
863  void setAlwaysCopy();
864 
868  bool neverCopy() const;
869 
873  void setNeverCopy();
874 
875  protected:
876  virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
877 
878  private:
879  Q_DECLARE_PRIVATE( MailCopiesTo )
880 };
881 
882 class ContentTransferEncodingPrivate;
883 
889 class KMIME_EXPORT ContentTransferEncoding : public Generics::Token
890 {
891  //@cond PRIVATE
892  kmime_mk_trivial_ctor_with_name( ContentTransferEncoding )
893  //@endcond
894  public:
895  virtual void clear();
896 
900  contentEncoding encoding() const;
901 
905  void setEncoding( contentEncoding e );
906 
910  // KDE5: rename to isDecoded().
911  bool decoded() const;
912 
918  void setDecoded( bool decoded = true );
919 
924  bool needToEncode() const;
925 
926  protected:
927  virtual bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
928 
929  private:
930  Q_DECLARE_PRIVATE( ContentTransferEncoding )
931 };
932 
938 class KMIME_EXPORT Keywords : public Generics::PhraseList
939 {
940  kmime_mk_trivial_ctor_with_name( Keywords )
941 };
942 
943 // DotAtom:
944 
950 class KMIME_EXPORT MIMEVersion : public Generics::DotAtom
951 {
952  kmime_mk_trivial_ctor_with_name( MIMEVersion )
953 };
954 
955 // Ident:
956 
962 class KMIME_EXPORT MessageID : public Generics::SingleIdent
963 {
964  //@cond PRIVATE
965  kmime_mk_trivial_ctor_with_name( MessageID )
966  //@endcond
967  public:
972  void generate( const QByteArray &fqdn );
973 };
974 
975 class ContentIDPrivate;
976 
980 class KMIME_EXPORT ContentID : public Generics::SingleIdent
981 {
982  //@cond PRIVATE
983  kmime_mk_trivial_ctor_with_name( ContentID )
984  kmime_mk_dptr_ctor( ContentID )
985  //@endcond
986 
987  protected:
988  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
989  private:
990  Q_DECLARE_PRIVATE( ContentID )
991 };
992 
996 class KMIME_EXPORT Supersedes : public Generics::SingleIdent
997 {
998  kmime_mk_trivial_ctor_with_name( Supersedes )
999 };
1000 
1006 class KMIME_EXPORT InReplyTo : public Generics::Ident
1007 {
1008  kmime_mk_trivial_ctor_with_name( InReplyTo )
1009 };
1010 
1016 class KMIME_EXPORT References : public Generics::Ident
1017 {
1018  kmime_mk_trivial_ctor_with_name( References )
1019 };
1020 
1021 
1022 class ContentTypePrivate;
1023 
1029 class KMIME_EXPORT ContentType : public Generics::Parametrized
1030 {
1031  //@cond PRIVATE
1032  kmime_mk_trivial_ctor_with_name( ContentType )
1033  //@endcond
1034  public:
1035  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1036  virtual void clear();
1037  virtual bool isEmpty() const;
1038 
1042  QByteArray mimeType() const;
1043 
1048  QByteArray mediaType() const;
1049 
1053  QByteArray subType() const;
1054 
1059  void setMimeType( const QByteArray &mimeType );
1060 
1064  bool isMediatype( const char *mediatype ) const;
1065 
1069  bool isSubtype( const char *subtype ) const;
1070 
1074  bool isText() const;
1075 
1079  bool isPlainText() const;
1080 
1084  bool isHTMLText() const;
1085 
1089  bool isImage() const;
1090 
1094  bool isMultipart() const;
1095 
1100  bool isPartial() const;
1101 
1105  QByteArray charset() const;
1106 
1110  void setCharset( const QByteArray &s );
1111 
1115  QByteArray boundary() const;
1116 
1120  void setBoundary( const QByteArray &s );
1121 
1125  QString name() const;
1126 
1130  void setName( const QString &s, const QByteArray &cs );
1131 
1135  QByteArray id() const;
1136 
1140  void setId( const QByteArray &s );
1141 
1146  int partialNumber() const;
1147 
1152  int partialCount() const;
1153 
1159  void setPartialParams( int total, int number );
1160 
1161  // TODO: document
1162  contentCategory category() const;
1163 
1164  void setCategory( contentCategory c );
1165 
1166  protected:
1167  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
1168 
1169  private:
1170  Q_DECLARE_PRIVATE( ContentType )
1171 };
1172 
1173 class ContentDispositionPrivate;
1174 
1180 class KMIME_EXPORT ContentDisposition : public Generics::Parametrized
1181 {
1182  //@cond PRIVATE
1183  kmime_mk_trivial_ctor_with_name( ContentDisposition )
1184  //@endcond
1185  public:
1186  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1187  virtual bool isEmpty() const;
1188  virtual void clear();
1189 
1193  contentDisposition disposition() const;
1194 
1199  void setDisposition( contentDisposition disp );
1200 
1206  QString filename() const;
1207 
1214  void setFilename( const QString &filename );
1215 
1216  protected:
1217  bool parse( const char* &scursor, const char *const send, bool isCRLF=false );
1218 
1219  private:
1220  Q_DECLARE_PRIVATE( ContentDisposition )
1221 };
1222 
1223 //
1224 //
1225 // COMPATIBLE GUNSTRUCTURED-BASED FIELDS:
1226 //
1227 //
1228 
1229 
1230 class GenericPrivate;
1231 
1237 class KMIME_EXPORT Generic : public Generics::Unstructured
1238 {
1239  public:
1240  Generic();
1241  Generic( const char *t );
1242  Generic( const char *t, Content *p );
1243  Generic( const char *t, Content *p, const QByteArray &s );
1244  Generic( const char *t, Content *p, const QString &s, const QByteArray &cs );
1245  ~Generic();
1246 
1247  virtual void clear();
1248 
1249  virtual bool isEmpty() const;
1250 
1251  virtual const char *type() const;
1252 
1253  void setType( const char *type );
1254 
1255  private:
1256  Q_DECLARE_PRIVATE( Generic )
1257 };
1258 
1264 class KMIME_EXPORT Subject : public Generics::Unstructured
1265 {
1266  //@cond PRIVATE
1267  kmime_mk_trivial_ctor_with_name( Subject )
1268  //@endcond
1269  public:
1270  bool isReply() const;
1271 };
1272 
1276 class KMIME_EXPORT Organization : public Generics::Unstructured
1277 {
1278  kmime_mk_trivial_ctor_with_name( Organization )
1279 };
1280 
1284 class KMIME_EXPORT ContentDescription : public Generics::Unstructured
1285 {
1286  kmime_mk_trivial_ctor_with_name( ContentDescription )
1287 };
1288 
1293 class KMIME_EXPORT ContentLocation : public Generics::Unstructured
1294 {
1295  kmime_mk_trivial_ctor_with_name( ContentLocation )
1296 };
1297 
1298 class ControlPrivate;
1299 
1305 class KMIME_EXPORT Control : public Generics::Structured
1306 {
1307  //@cond PRIVATE
1308  kmime_mk_trivial_ctor_with_name( Control )
1309  //@endcond
1310  public:
1311  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1312  virtual void clear();
1313  virtual bool isEmpty() const;
1314 
1318  QByteArray controlType() const;
1319 
1323  QByteArray parameter() const;
1324 
1329  bool isCancel() const;
1330 
1335  void setCancel( const QByteArray &msgid );
1336 
1337  protected:
1338  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1339 
1340  private:
1341  Q_DECLARE_PRIVATE( Control )
1342 };
1343 
1344 class DatePrivate;
1345 
1351 class KMIME_EXPORT Date : public Generics::Structured
1352 {
1353  //@cond PRIVATE
1354  kmime_mk_trivial_ctor_with_name( Date )
1355  //@endcond
1356  public:
1357  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1358  virtual void clear();
1359  virtual bool isEmpty() const;
1360 
1364  KDateTime dateTime() const;
1365 
1369  void setDateTime( const KDateTime &dt );
1370 
1374  int ageInDays() const;
1375 
1376  protected:
1377  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1378 
1379  private:
1380  Q_DECLARE_PRIVATE( Date )
1381 };
1382 
1383 
1384 class NewsgroupsPrivate;
1385 
1391 class KMIME_EXPORT Newsgroups : public Generics::Structured
1392 {
1393  //@cond PRIVATE
1394  kmime_mk_trivial_ctor_with_name( Newsgroups )
1395  //@endcond
1396  public:
1397  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1398  virtual void fromUnicodeString( const QString &s, const QByteArray &b );
1399  virtual QString asUnicodeString() const;
1400  virtual void clear();
1401  virtual bool isEmpty() const;
1402 
1406  QList<QByteArray> groups() const;
1407 
1411  void setGroups( const QList<QByteArray> &groups );
1412 
1417  bool isCrossposted() const;
1418 
1419  protected:
1420  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1421 
1422  private:
1423  Q_DECLARE_PRIVATE( Newsgroups )
1424 };
1425 
1431 class KMIME_EXPORT FollowUpTo : public Newsgroups
1432 {
1433  //@cond PRIVATE
1434  kmime_mk_trivial_ctor_with_name( FollowUpTo )
1435  //@endcond
1436 };
1437 
1438 
1439 class LinesPrivate;
1440 
1446 class KMIME_EXPORT Lines : public Generics::Structured
1447 {
1448  //@cond PRIVATE
1449  kmime_mk_trivial_ctor_with_name( Lines )
1450  //@endcond
1451  public:
1452  virtual QByteArray as7BitString( bool withHeaderType = true ) const;
1453  virtual QString asUnicodeString() const;
1454  virtual void clear();
1455  virtual bool isEmpty() const;
1456 
1460  int numberOfLines() const;
1461 
1465  void setNumberOfLines( int lines );
1466 
1467  protected:
1468  bool parse( const char* &scursor, const char *const send, bool isCRLF = false );
1469 
1470  private:
1471  Q_DECLARE_PRIVATE( Lines )
1472 };
1473 
1477 class KMIME_EXPORT UserAgent : public Generics::Unstructured
1478 {
1479  kmime_mk_trivial_ctor_with_name( UserAgent )
1480 };
1481 
1484 KMIME_EXPORT Base *createHeader( const QByteArray& type );
1485 
1486 } //namespace Headers
1487 
1488 } //namespace KMime
1489 
1490 // undefine code generation macros again
1491 #undef kmime_mk_trivial_ctor
1492 #undef kmime_mk_dptr_ctor
1493 #undef kmime_mk_trivial_ctor_with_name
1494 
1495 #endif // __KMIME_HEADERS_H__
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:25:46 by doxygen 1.8.3.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.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • 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