diff options
Diffstat (limited to 'framework/mail/composer.h')
-rw-r--r-- | framework/mail/composer.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/framework/mail/composer.h b/framework/mail/composer.h new file mode 100644 index 00000000..a9741f6b --- /dev/null +++ b/framework/mail/composer.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | Copyright (c) 2016 Michael Bohlender <michael.bohlender@kdemail.net> | ||
3 | |||
4 | This library is free software; you can redistribute it and/or modify it | ||
5 | under the terms of the GNU Library General Public License as published by | ||
6 | the Free Software Foundation; either version 2 of the License, or (at your | ||
7 | option) any later version. | ||
8 | |||
9 | This library is distributed in the hope that it will be useful, but WITHOUT | ||
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public | ||
12 | 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 the | ||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
17 | 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #pragma once | ||
21 | |||
22 | #include <QObject> | ||
23 | #include <QString> | ||
24 | |||
25 | |||
26 | class Composer : public QObject | ||
27 | { | ||
28 | Q_OBJECT | ||
29 | Q_PROPERTY (QString to READ to WRITE setTo NOTIFY toChanged) | ||
30 | Q_PROPERTY (QString cc READ cc WRITE setCc NOTIFY ccChanged) | ||
31 | Q_PROPERTY (QString bcc READ bcc WRITE setBcc NOTIFY bccChanged) | ||
32 | Q_PROPERTY (QString subject READ subject WRITE setSubject NOTIFY subjectChanged) | ||
33 | Q_PROPERTY (QString body READ body WRITE setBody NOTIFY bodyChanged) | ||
34 | |||
35 | public: | ||
36 | explicit Composer(QObject *parent = Q_NULLPTR); | ||
37 | |||
38 | QString to() const; | ||
39 | void setTo(const QString &to); | ||
40 | |||
41 | QString cc() const; | ||
42 | void setCc(const QString &cc); | ||
43 | |||
44 | QString bcc() const; | ||
45 | void setBcc(const QString &bcc); | ||
46 | |||
47 | QString subject() const; | ||
48 | void setSubject(const QString &subject); | ||
49 | |||
50 | QString body() const; | ||
51 | void setBody(const QString &body); | ||
52 | |||
53 | signals: | ||
54 | void subjectChanged(); | ||
55 | void bodyChanged(); | ||
56 | void toChanged(); | ||
57 | void ccChanged(); | ||
58 | void bccChanged(); | ||
59 | |||
60 | public slots: | ||
61 | void send(); | ||
62 | void saveAsDraft(); | ||
63 | void clear(); | ||
64 | |||
65 | private: | ||
66 | QString m_to; | ||
67 | QString m_cc; | ||
68 | QString m_bcc; | ||
69 | QString m_subject; | ||
70 | QString m_body; | ||
71 | }; | ||