Cutelyst  2.13.0
viewemail.h
1 /*
2  * Copyright (C) 2015-2019 Daniel Nicoletti <dantti12@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef VIEWEMAIL_H
19 #define VIEWEMAIL_H
20 
21 #include <Cutelyst/cutelyst_global.h>
22 #include <Cutelyst/view.h>
23 
24 namespace Cutelyst {
25 
26 class ViewEmailPrivate;
31 class CUTELYST_VIEW_EMAIL_EXPORT ViewEmail : public Cutelyst::View
32 {
33  Q_OBJECT
34  Q_DECLARE_PRIVATE(ViewEmail)
35  Q_PROPERTY(QString stashKey READ stashKey WRITE setStashKey NOTIFY changed)
36  Q_PROPERTY(QByteArray defaultContentType READ defaultContentType WRITE setDefaultContentType NOTIFY changed)
37  Q_PROPERTY(QByteArray defaultCharset READ defaultCharset WRITE setDefaultCharset NOTIFY changed)
38  Q_PROPERTY(QByteArray defaultEncoding READ defaultEncoding WRITE setDefaultEncoding NOTIFY changed)
39  Q_PROPERTY(bool async READ async WRITE setAsync NOTIFY changed)
40 public:
43  {
44  TcpConnection,
45  SslConnection,
46  TlsConnection,
47  };
48  Q_ENUM(ConnectionType)
49 
50 
52  {
53  AuthNone,
54  AuthPlain,
55  AuthLogin,
56  AuthCramMd5,
57  };
58  Q_ENUM(AuthMethod)
59 
60 
63  explicit ViewEmail(QObject *parent, const QString &name = QString());
64 
68  QString stashKey() const;
69 
73  void setStashKey(const QString &stashKey);
74 
78  QByteArray defaultContentType() const;
79 
83  void setDefaultContentType(const QByteArray &contentType);
84 
89  QByteArray defaultCharset() const;
90 
99  void setDefaultCharset(const QByteArray &charset);
100 
104  QByteArray defaultEncoding() const;
105 
109  void setDefaultEncoding(const QByteArray &encoding);
110 
114  QString senderHost() const;
115 
119  void setSenderHost(const QString &host);
120 
124  int senderPort() const;
125 
129  void setSenderPort(int port);
130 
134  ConnectionType senderConnectionType() const;
135 
139  void setSenderConnectionType(ConnectionType ct);
140 
144  AuthMethod senderAuthMethod() const;
145 
149  void setSenderAuthMethod(AuthMethod method);
150 
154  QString senderUser() const;
155 
159  void setSenderUser(const QString &user);
160 
164  QString senderPassword() const;
165 
169  void setSenderPassword(const QString &password);
170 
174  bool async() const;
175 
180  void setAsync(bool enable);
181 
185  virtual QByteArray render(Context *c) const override;
186 
187 protected:
191  ViewEmail(ViewEmailPrivate *d, QObject *parent, const QString &name = QString());
192 
193 Q_SIGNALS:
194  void changed();
195 
196 private:
197  void initSender();
198 };
199 
200 }
201 
202 #endif // VIEWEMAIL_H
Cutelyst::Context
The Cutelyst Context.
Definition: context.h:50
Cutelyst::ViewEmail::ConnectionType
ConnectionType
Definition: viewemail.h:42
Cutelyst::View
Cutelyst View abstract view component
Definition: view.h:34
Cutelyst
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7
Cutelyst::ViewEmail::AuthMethod
AuthMethod
Definition: viewemail.h:51
Cutelyst::ViewEmail
Definition: viewemail.h:31