File indexing completed on 2024-03-24 05:21:19
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 {} 0129 QByteArray mimeType; 0130 }; 0131 0132 class ContentDispositionPrivate : public Generics::ParametrizedPrivate 0133 { 0134 public: 0135 ContentDispositionPrivate() : 0136 Generics::ParametrizedPrivate(), 0137 disposition(CDInvalid) 0138 {} 0139 contentDisposition disposition; 0140 }; 0141 0142 class GenericPrivate : public Generics::UnstructuredPrivate 0143 { 0144 public: 0145 GenericPrivate() : 0146 Generics::UnstructuredPrivate() 0147 {} 0148 ~GenericPrivate() 0149 { 0150 delete[] type; 0151 } 0152 0153 char *type = nullptr; 0154 }; 0155 0156 class ControlPrivate : public Generics::StructuredPrivate 0157 { 0158 public: 0159 QByteArray name; 0160 QByteArray parameter; 0161 }; 0162 0163 class DatePrivate : public Generics::StructuredPrivate 0164 { 0165 public: 0166 QDateTime dateTime; 0167 }; 0168 0169 class NewsgroupsPrivate : public Generics::StructuredPrivate 0170 { 0171 public: 0172 QList<QByteArray> groups; 0173 }; 0174 0175 class LinesPrivate : public Generics::StructuredPrivate 0176 { 0177 public: 0178 LinesPrivate() : 0179 Generics::StructuredPrivate(), 0180 lines(-1) 0181 {} 0182 int lines; 0183 }; 0184 0185 kmime_mk_empty_private(ContentID, Generics::SingleIdent) 0186 } 0187 0188 } 0189 0190 #undef kmime_mk_empty_private 0191 0192 //@endcond 0193