cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
viewemail.h
1/*
2 * SPDX-FileCopyrightText: (C) 2015-2022 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef VIEWEMAIL_H
6#define VIEWEMAIL_H
7
8#include <Cutelyst/cutelyst_global.h>
9#include <Cutelyst/view.h>
10
11namespace Cutelyst {
12
13class ViewEmailPrivate;
23class CUTELYST_VIEW_EMAIL_EXPORT ViewEmail : public Cutelyst::View
24{
25 Q_OBJECT
26 Q_DECLARE_PRIVATE(ViewEmail)
30 Q_PROPERTY(QString stashKey READ stashKey WRITE setStashKey NOTIFY changed)
35 Q_PROPERTY(QByteArray defaultContentType READ defaultContentType WRITE setDefaultContentType
36 NOTIFY changed)
41 Q_PROPERTY(QByteArray defaultCharset READ defaultCharset WRITE setDefaultCharset NOTIFY changed)
45 Q_PROPERTY(
46 QByteArray defaultEncoding READ defaultEncoding WRITE setDefaultEncoding NOTIFY changed)
47public:
54 Q_ENUM(ConnectionType)
55
56
58 AuthNone,
59 AuthPlain,
60 AuthLogin,
61 AuthCramMd5,
62 };
63 Q_ENUM(AuthMethod)
64
65
71 explicit ViewEmail(QObject *parent, const QString &name = QString());
72
77 [[nodiscard]] QString stashKey() const;
78
83 void setStashKey(const QString &stashKey);
84
90 [[nodiscard]] QByteArray defaultContentType() const;
91
97 void setDefaultContentType(const QByteArray &contentType);
98
104 [[nodiscard]] QByteArray defaultCharset() const;
105
115 void setDefaultCharset(const QByteArray &charset);
116
122 [[nodiscard]] QByteArray defaultEncoding() const;
123
129 void setDefaultEncoding(const QByteArray &encoding);
130
135 [[nodiscard]] QString senderHost() const;
136
141 void setSenderHost(const QString &host);
142
147 [[nodiscard]] int senderPort() const;
148
153 void setSenderPort(int port);
154
159 [[nodiscard]] ConnectionType senderConnectionType() const;
160
165 void setSenderConnectionType(ConnectionType ct);
166
171 [[nodiscard]] AuthMethod senderAuthMethod() const;
172
177 void setSenderAuthMethod(AuthMethod method);
178
183 [[nodiscard]] QString senderUser() const;
184
189 void setSenderUser(const QString &user);
190
195 [[nodiscard]] QString senderPassword() const;
196
201 void setSenderPassword(const QString &password);
202
207 QByteArray render(Context *c) const override;
208
209protected:
213 ViewEmail(ViewEmailPrivate *d, QObject *parent, const QString &name = QString());
214
215Q_SIGNALS:
216 void changed();
217
218private:
219 void initSender();
220};
221
222} // namespace Cutelyst
223
224#endif // VIEWEMAIL_H
The Cutelyst Context.
Definition context.h:42
A view that sends stash data via e-mail.
Definition viewemail.h:24
Abstract View component for Cutelyst.
Definition view.h:25
The Cutelyst namespace holds all public Cutelyst API.