Cutelyst  1.7.0
viewemail.h
1 /*
2  * Copyright (C) 2015-2017 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 Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef VIEWEMAIL_H
21 #define VIEWEMAIL_H
22 
23 #include <Cutelyst/cutelyst_global.h>
24 #include <Cutelyst/view.h>
25 
26 namespace Cutelyst {
27 
28 class ViewEmailPrivate;
33 class CUTELYST_VIEW_EMAIL_EXPORT ViewEmail : public Cutelyst::View
34 {
35  Q_OBJECT
36  Q_PROPERTY(QString stashKey READ stashKey WRITE setStashKey)
37  Q_PROPERTY(QByteArray defaultContentType READ defaultContentType WRITE setDefaultContentType)
38  Q_PROPERTY(QByteArray defaultCharset READ defaultCharset WRITE setDefaultCharset)
39  Q_PROPERTY(QByteArray defaultEncoding READ defaultEncoding WRITE setDefaultEncoding)
40 public:
43  {
44  TcpConnection,
45  SslConnection,
46  TlsConnection
47  };
48  Q_ENUM(ConnectionType)
49 
50 
52  {
53  AuthNone,
54  AuthPlain,
55  AuthLogin
56  };
57  Q_ENUM(AuthMethod)
58 
59 
62  explicit ViewEmail(QObject *parent, const QString &name = QString());
63  virtual ~ViewEmail();
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  QByteArray render(Context *c) const override;
175 
176 protected:
180  ViewEmail(ViewEmailPrivate *d, QObject *parent, const QString &name = QString());
181 
182  Q_DECLARE_PRIVATE(ViewEmail)
183  ViewEmailPrivate *d_ptr;
184 
185 private:
186  void initSender();
187 };
188 
189 }
190 
191 #endif // VIEWEMAIL_H
The Cutelyst Context.
Definition: context.h:52
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7
Cutelyst View abstract view component
Definition: view.h:35