NAWA 0.9
Web Application Framework for C++
MimeEmail.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019-2022 Tobias Flaig.
3 *
4 * This file is part of nawa.
5 *
6 * nawa is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License,
8 * version 3, as published by the Free Software Foundation.
9 *
10 * nawa is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with nawa. If not, see <https://www.gnu.org/licenses/>.
17 */
18
24#ifndef NAWA_MIMEEMAIL_H
25#define NAWA_MIMEEMAIL_H
26
28#include <string>
29#include <unordered_map>
30
31namespace nawa::mail {
35 class MimeEmail : public Email {
37
38 public:
40
42
44
46
48
50
51 class MimePartOrList;
52
56 class MimePart {
58
59 public:
64 enum class ApplyEncoding {
65 BASE64,
67 NONE
68 };
71
73
75
77
79
81
86
92
98
103
109
114
116 };
117
118 class MimePartList;
119
127
128 public:
130
132
134
136
138
140
145 MimePartOrList(MimePart const& _mimePart);
146
151 MimePartOrList(MimePartList const& _mimePartList);
152
158 MimePartOrList& operator=(MimePart const& otherMimePart);
159
165 MimePartOrList& operator=(MimePartList const& otherMimePartList);
166
174
181 };
182
188
189 public:
194 enum class MultipartType {
195 MIXED,
196 DIGEST,
198 RELATED,
199 REPORT,
200 SIGNED,
202 };
203
205
207
209
211
213
215
220
226
228 };
229
235
241 [[nodiscard]] std::string getRaw(std::shared_ptr<ReplacementRules> const& replacementRules) const override;
242 };
243}// namespace nawa::mail
244
245#endif//NAWA_MIMEEMAIL_H
Base structure for emails.
std::unordered_map< std::string, std::string > HeadersMap
Definition: Email.h:60
std::vector< MimePartOrList > & mimeParts() noexcept
MultipartType & multipartType() noexcept
MimePartOrList(MimePart const &_mimePart)
std::unique_ptr< MimePartList > & mimePartList() noexcept
MimePartOrList(MimePartList const &_mimePartList)
MimePartOrList & operator=(MimePartList const &otherMimePartList)
std::unique_ptr< MimePart > & mimePart() noexcept
MimePartOrList & operator=(MimePart const &otherMimePart)
std::string & contentDisposition() noexcept
std::string & partData() noexcept
HeadersMap & partHeaders() noexcept
bool & allowReplacements() noexcept
std::string & contentType() noexcept
ApplyEncoding & applyEncoding() noexcept
MimePartList & mimePartList() noexcept
std::string getRaw(std::shared_ptr< ReplacementRules > const &replacementRules) const override
#define NAWA_COMPLEX_DATA_ACCESSORS_DEF(Class, Member, Type)
Definition: macros.h:133
#define NAWA_DEFAULT_DESTRUCTOR_DEF(Class)
Definition: macros.h:34
#define NAWA_DEFAULT_DESTRUCTOR_OVERRIDE_DEF(Class)
Definition: macros.h:35
#define NAWA_DEFAULT_CONSTRUCTOR_DEF(Class)
Definition: macros.h:39
#define NAWA_MOVE_CONSTRUCTOR_DEF(Class)
Definition: macros.h:87
#define NAWA_PRIMITIVE_DATA_ACCESSORS_DEF(Class, Member, Type)
Definition: macros.h:129
#define NAWA_COPY_ASSIGNMENT_OPERATOR_DEF(Class)
Definition: macros.h:55
#define NAWA_PRIVATE_DATA()
Definition: macros.h:30
#define NAWA_MOVE_ASSIGNMENT_OPERATOR_DEF(Class)
Definition: macros.h:97
#define NAWA_COPY_CONSTRUCTOR_DEF(Class)
Definition: macros.h:45