NAWA  0.8
Web Application Framework for C++
MimeEmail.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright (C) 2019-2021 Tobias Flaig.
8  *
9  * This file is part of nawa.
10  *
11  * nawa is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License,
13  * version 3, as published by the Free Software Foundation.
14  *
15  * nawa is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with nawa. If not, see <https://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef NAWA_MIMEEMAIL_H
25 #define NAWA_MIMEEMAIL_H
26 
27 #include <nawa/mail/Email/Email.h>
28 #include <string>
29 #include <unordered_map>
30 
31 namespace 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 
186  class MimePartList {
188 
189  public:
194  enum class MultipartType {
195  MIXED,
196  DIGEST,
197  ALTERNATIVE,
198  RELATED,
199  REPORT,
200  SIGNED,
201  ENCRYPTED
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
MultipartType & multipartType() noexcept
std::vector< MimePartOrList > & mimeParts() noexcept
MimePartOrList(MimePart const &_mimePart)
MimePartOrList & operator=(MimePart const &otherMimePart)
MimePartOrList(MimePartList const &_mimePartList)
std::unique_ptr< MimePartList > & mimePartList() noexcept
MimePartOrList & operator=(MimePartList const &otherMimePartList)
std::unique_ptr< MimePart > & mimePart() noexcept
std::string & contentDisposition() noexcept
std::string & partData() noexcept
ApplyEncoding & applyEncoding() noexcept
std::string & contentType() noexcept
bool & allowReplacements() noexcept
HeadersMap & partHeaders() noexcept
std::string getRaw(std::shared_ptr< ReplacementRules > const &replacementRules) const override
MimePartList & mimePartList() noexcept
#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