File indexing completed on 2024-04-28 09:12:10

0001 /*
0002     SPDX-FileCopyrightText: 2007 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QMap>
0010 //@cond PRIVATE
0011 
0012 #define kmime_mk_empty_private( subclass, base ) \
0013     class subclass##Private : public base##Private {};
0014 
0015 namespace KMime
0016 {
0017 
0018 namespace Headers
0019 {
0020 
0021 // Note that this entire class hierarchy has no virtual dtor, in order to not
0022 // have a second set of vtables, as this is a rather high-volume class.
0023 // This means it's not enough to just delete d_ptr in the base class, but
0024 // we need to delete it with the exact sub-class it was created.
0025 
0026 class BasePrivate
0027 {
0028 public:
0029     QByteArray encCS;
0030 };
0031 
0032 namespace Generics
0033 {
0034 
0035 class UnstructuredPrivate : public BasePrivate
0036 {
0037 public:
0038     QString decoded;
0039 };
0040 
0041 kmime_mk_empty_private(Structured, Base)
0042 kmime_mk_empty_private(Address, Structured)
0043 
0044 class MailboxListPrivate : public AddressPrivate
0045 {
0046 public:
0047   QList<Types::Mailbox> mailboxList;
0048 };
0049 
0050 kmime_mk_empty_private(SingleMailbox, MailboxList)
0051 
0052 class AddressListPrivate : public AddressPrivate
0053 {
0054 public:
0055     KMime::Types::AddressList addressList;
0056 };
0057 
0058 class IdentPrivate : public AddressPrivate
0059 {
0060 public:
0061     KMime::Types::AddrSpecList msgIdList;
0062     mutable QByteArray cachedIdentifier;
0063 };
0064 
0065 kmime_mk_empty_private(SingleIdent, Ident)
0066 
0067 class TokenPrivate : public StructuredPrivate
0068 {
0069 public:
0070     QByteArray token;
0071 };
0072 
0073 class PhraseListPrivate : public StructuredPrivate
0074 {
0075 public:
0076     QStringList phraseList;
0077 };
0078 
0079 class DotAtomPrivate : public StructuredPrivate
0080 {
0081 public:
0082     QByteArray dotAtom;
0083 };
0084 
0085 class ParametrizedPrivate : public StructuredPrivate
0086 {
0087 public:
0088     QMap<QString, QString> parameterHash;
0089 };
0090 
0091 } // namespace Generics
0092 
0093 class ReturnPathPrivate : public Generics::AddressPrivate
0094 {
0095 public:
0096     Types::Mailbox mailbox;
0097 };
0098 
0099 class MailCopiesToPrivate : public Generics::AddressListPrivate
0100 {
0101 public:
0102     MailCopiesToPrivate() :
0103         Generics::AddressListPrivate(),
0104         alwaysCopy(false),
0105         neverCopy(false)
0106     {}
0107     bool alwaysCopy;
0108     bool neverCopy;
0109 };
0110 
0111 class ContentTransferEncodingPrivate : public Generics::TokenPrivate
0112 {
0113 public:
0114     ContentTransferEncodingPrivate() :
0115         Generics::TokenPrivate(),
0116         cte(CE7Bit),
0117         decoded(true)
0118     {}
0119     contentEncoding cte;
0120     bool decoded;
0121 };
0122 
0123 class ContentTypePrivate : public Generics::ParametrizedPrivate
0124 {
0125 public:
0126     ContentTypePrivate() :
0127         Generics::ParametrizedPrivate(),
0128         category(CCsingle)
0129     {}
0130     QByteArray mimeType;
0131     contentCategory category;
0132 };
0133 
0134 class ContentDispositionPrivate : public Generics::ParametrizedPrivate
0135 {
0136 public:
0137     ContentDispositionPrivate() :
0138         Generics::ParametrizedPrivate(),
0139         disposition(CDInvalid)
0140     {}
0141     contentDisposition disposition;
0142 };
0143 
0144 class GenericPrivate : public Generics::UnstructuredPrivate
0145 {
0146 public:
0147     GenericPrivate() :
0148         Generics::UnstructuredPrivate()
0149     {}
0150     ~GenericPrivate()
0151     {
0152         delete[] type;
0153     }
0154 
0155     char *type = nullptr;
0156 };
0157 
0158 class ControlPrivate : public Generics::StructuredPrivate
0159 {
0160 public:
0161     QByteArray name;
0162     QByteArray parameter;
0163 };
0164 
0165 class DatePrivate : public Generics::StructuredPrivate
0166 {
0167 public:
0168     QDateTime dateTime;
0169 };
0170 
0171 class NewsgroupsPrivate : public Generics::StructuredPrivate
0172 {
0173 public:
0174   QList<QByteArray> groups;
0175 };
0176 
0177 class LinesPrivate : public Generics::StructuredPrivate
0178 {
0179 public:
0180     LinesPrivate() :
0181         Generics::StructuredPrivate(),
0182         lines(-1)
0183     {}
0184     int lines;
0185 };
0186 
0187 kmime_mk_empty_private(ContentID, Generics::SingleIdent)
0188 }
0189 
0190 }
0191 
0192 #undef kmime_mk_empty_private
0193 
0194 //@endcond
0195