Cutelyst  2.1.0
viewemail.h
1 /*
2  * Copyright (C) 2015-2018 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_PROPERTY(QString stashKey READ stashKey WRITE setStashKey NOTIFY changed)
35  Q_PROPERTY(QByteArray defaultContentType READ defaultContentType WRITE setDefaultContentType NOTIFY changed)
36  Q_PROPERTY(QByteArray defaultCharset READ defaultCharset WRITE setDefaultCharset NOTIFY changed)
37  Q_PROPERTY(QByteArray defaultEncoding READ defaultEncoding WRITE setDefaultEncoding NOTIFY changed)
38 public:
41  {
42  TcpConnection,
43  SslConnection,
44  TlsConnection
45  };
46  Q_ENUM(ConnectionType)
47 
48 
50  {
51  AuthNone,
52  AuthPlain,
53  AuthLogin
54  };
55  Q_ENUM(AuthMethod)
56 
57 
60  explicit ViewEmail(QObject *parent, const QString &name = QString());
61  virtual ~ViewEmail();
62 
66  QString stashKey() const;
67 
71  void setStashKey(const QString &stashKey);
72 
76  QByteArray defaultContentType() const;
77 
81  void setDefaultContentType(const QByteArray &contentType);
82 
87  QByteArray defaultCharset() const;
88 
97  void setDefaultCharset(const QByteArray &charset);
98 
102  QByteArray defaultEncoding() const;
103 
107  void setDefaultEncoding(const QByteArray &encoding);
108 
112  QString senderHost() const;
113 
117  void setSenderHost(const QString &host);
118 
122  int senderPort() const;
123 
127  void setSenderPort(int port);
128 
132  ConnectionType senderConnectionType() const;
133 
137  void setSenderConnectionType(ConnectionType ct);
138 
142  AuthMethod senderAuthMethod() const;
143 
147  void setSenderAuthMethod(AuthMethod method);
148 
152  QString senderUser() const;
153 
157  void setSenderUser(const QString &user);
158 
162  QString senderPassword() const;
163 
167  void setSenderPassword(const QString &password);
168 
172  QByteArray render(Context *c) const override;
173 
174 protected:
178  ViewEmail(ViewEmailPrivate *d, QObject *parent, const QString &name = QString());
179 
180  Q_DECLARE_PRIVATE(ViewEmail)
181  ViewEmailPrivate *d_ptr;
182 
183 Q_SIGNALS:
184  void changed();
185 
186 private:
187  void initSender();
188 };
189 
190 }
191 
192 #endif // VIEWEMAIL_H
The Cutelyst Context.
Definition: context.h:50
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7
Cutelyst View abstract view component
Definition: view.h:33