29 #include "kmime_export.h"
30 #include "kmime_header_parsing.h"
37 #include <QStringList>
49 enum contentCategory {
80 #define kmime_mk_trivial_ctor( subclass ) \
85 #define kmime_mk_dptr_ctor( subclass ) \
87 explicit subclass( subclass##Private *d );
89 #define kmime_mk_trivial_ctor_with_name( subclass ) \
90 kmime_mk_trivial_ctor( subclass ) \
91 const char *type() const override; \
92 static const char *staticType();
125 virtual void from7BitString(
const char *s,
size_t len);
126 virtual void from7BitString(
const QByteArray &s) = 0;
133 as7BitString(
bool withHeaderType =
true)
const = 0;
138 Q_REQUIRED_RESULT
QByteArray rfc2047Charset()
const;
160 virtual QString asUnicodeString()
const = 0;
165 virtual void clear() = 0;
170 virtual bool isEmpty()
const = 0;
175 virtual const char *type()
const;
180 Q_REQUIRED_RESULT
bool is(
const char *t)
const;
185 Q_REQUIRED_RESULT
bool isMimeHeader()
const;
195 kmime_mk_dptr_ctor(
Base)
199 Q_DECLARE_PRIVATE(
Base)
212 class UnstructuredPrivate;
237 void from7BitString(
const QByteArray &s)
override;
238 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
241 QString asUnicodeString()
const override;
243 void clear()
override;
245 bool isEmpty()
const override;
251 class StructuredPrivate;
289 void from7BitString(
const char *s,
size_t len)
override;
290 void from7BitString(
const QByteArray &s)
override;
291 QString asUnicodeString()
const override;
303 virtual bool parse(
const char *&scursor,
const char *
const send,
304 bool isCRLF =
false) = 0;
314 class AddressPrivate;
332 class MailboxListPrivate;
347 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
349 QString asUnicodeString()
const override;
351 void clear()
override;
352 bool isEmpty()
const override;
394 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
400 class SingleMailboxPrivate;
412 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
417 class AddressListPrivate;
437 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
439 QString asUnicodeString()
const override;
441 void clear()
override;
442 bool isEmpty()
const override;
482 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
498 kmime_mk_trivial_ctor(
Ident)
499 kmime_mk_dptr_ctor(
Ident)
502 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
503 void clear()
override;
504 bool isEmpty()
const override;
509 void fromIdent(
const Ident* ident);
526 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
529 Q_DECLARE_PRIVATE(
Ident)
532 class SingleIdentPrivate;
559 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
573 kmime_mk_trivial_ctor(
Token)
574 kmime_mk_dptr_ctor(
Token)
577 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
578 void clear()
override;
579 bool isEmpty()
const override;
592 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
595 Q_DECLARE_PRIVATE(
Token)
598 class PhraseListPrivate;
609 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
610 QString asUnicodeString()
const override;
611 void clear()
override;
612 bool isEmpty()
const override;
620 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
626 class DotAtomPrivate;
637 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
638 QString asUnicodeString()
const override;
639 void clear()
override;
640 bool isEmpty()
const override;
643 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
649 class ParametrizedPrivate;
661 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
663 bool isEmpty()
const override;
664 void clear()
override;
680 bool hasParameter(
const QString &key)
const;
690 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
704 class ReturnPathPrivate;
717 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
718 void clear()
override;
719 bool isEmpty()
const override;
722 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
738 kmime_mk_trivial_ctor_with_name(
From)
748 kmime_mk_trivial_ctor_with_name(
Sender)
758 kmime_mk_trivial_ctor_with_name(
To)
768 kmime_mk_trivial_ctor_with_name(
Cc)
778 kmime_mk_trivial_ctor_with_name(
Bcc)
788 kmime_mk_trivial_ctor_with_name(
ReplyTo)
791 class MailCopiesToPrivate;
804 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
805 QString asUnicodeString()
const override;
807 void clear()
override;
808 bool isEmpty()
const override;
813 bool alwaysCopy()
const;
818 void setAlwaysCopy();
823 bool neverCopy()
const;
831 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
837 class ContentTransferEncodingPrivate;
850 void clear()
override;
865 bool isDecoded()
const;
873 void setDecoded(
bool isDecoded =
true);
879 bool needToEncode()
const;
882 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
895 kmime_mk_trivial_ctor_with_name(
Keywords)
920 kmime_mk_trivial_ctor_with_name(
MessageID)
930 class ContentIDPrivate;
938 kmime_mk_trivial_ctor_with_name(
ContentID)
943 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
963 kmime_mk_trivial_ctor_with_name(
InReplyTo)
976 class ContentTypePrivate;
989 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
990 void clear()
override;
991 bool isEmpty()
const override;
1013 void setMimeType(
const QByteArray &mimeType);
1018 bool isMediatype(
const char *mediatype)
const;
1023 bool isSubtype(
const char *subtype)
const;
1028 bool isMimeType(
const char *mimeType)
const;
1033 bool isText()
const;
1038 bool isPlainText()
const;
1043 bool isHTMLText()
const;
1048 bool isImage()
const;
1053 bool isMultipart()
const;
1059 bool isPartial()
const;
1105 int partialNumber()
const;
1111 int partialCount()
const;
1118 void setPartialParams(
int total,
int number);
1121 contentCategory category()
const;
1123 void setCategory(contentCategory c);
1126 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
1132 class ContentDispositionPrivate;
1145 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
1146 bool isEmpty()
const override;
1147 void clear()
override;
1173 void setFilename(
const QString &filename);
1176 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
1188 class GenericPrivate;
1199 Generic(
const char *t,
int len = -1);
1202 void clear()
override;
1204 bool isEmpty()
const override;
1206 const char *type()
const override;
1208 void setType(
const char *type,
int len = -1);
1222 kmime_mk_trivial_ctor_with_name(
Subject)
1251 class ControlPrivate;
1261 kmime_mk_trivial_ctor_with_name(
Control)
1264 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
1265 void clear()
override;
1266 bool isEmpty()
const override;
1282 bool isCancel()
const;
1291 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
1307 kmime_mk_trivial_ctor_with_name(
Date)
1310 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
1311 void clear()
override;
1312 bool isEmpty()
const override;
1327 int ageInDays()
const;
1330 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
1333 Q_DECLARE_PRIVATE(
Date)
1336 class NewsgroupsPrivate;
1349 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
1351 QString asUnicodeString()
const override;
1352 void clear()
override;
1353 bool isEmpty()
const override;
1369 bool isCrossposted()
const;
1372 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
1400 kmime_mk_trivial_ctor_with_name(
Lines)
1403 QByteArray as7BitString(
bool withHeaderType =
true)
const override;
1404 QString asUnicodeString()
const override;
1405 void clear()
override;
1406 bool isEmpty()
const override;
1411 int numberOfLines()
const;
1416 void setNumberOfLines(
int lines);
1419 bool parse(
const char *&scursor,
const char *
const send,
bool isCRLF =
false)
override;
1422 Q_DECLARE_PRIVATE(
Lines)
1430 kmime_mk_trivial_ctor_with_name(
UserAgent)
1442 #undef kmime_mk_trivial_ctor
1443 #undef kmime_mk_dptr_ctor
1444 #undef kmime_mk_trivial_ctor_with_name