diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-09 15:20:31 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-09 15:20:31 +0100 |
commit | f5185c4799fe0e9c31a218dfc8310515ac921c2b (patch) | |
tree | 5524d7a85c8bf82890d79ec6d1bb82b5124fd3b3 /framework/domain/composer.h | |
parent | c9ccf868f5d533a07811b949577f772f618d2de3 (diff) | |
download | kube-f5185c4799fe0e9c31a218dfc8310515ac921c2b.tar.gz kube-f5185c4799fe0e9c31a218dfc8310515ac921c2b.zip |
Moved framework/mail to framework/domain
Diffstat (limited to 'framework/domain/composer.h')
-rw-r--r-- | framework/domain/composer.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/framework/domain/composer.h b/framework/domain/composer.h new file mode 100644 index 00000000..dd066b2e --- /dev/null +++ b/framework/domain/composer.h | |||
@@ -0,0 +1,93 @@ | |||
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 | #include <QStringList> | ||
25 | #include <QVariant> | ||
26 | |||
27 | namespace KMime { | ||
28 | class Message; | ||
29 | } | ||
30 | |||
31 | class Composer : public QObject | ||
32 | { | ||
33 | Q_OBJECT | ||
34 | Q_PROPERTY (QVariant originalMessage READ originalMessage WRITE setOriginalMessage) | ||
35 | Q_PROPERTY (QString to READ to WRITE setTo NOTIFY toChanged) | ||
36 | Q_PROPERTY (QString cc READ cc WRITE setCc NOTIFY ccChanged) | ||
37 | Q_PROPERTY (QString bcc READ bcc WRITE setBcc NOTIFY bccChanged) | ||
38 | Q_PROPERTY (QString subject READ subject WRITE setSubject NOTIFY subjectChanged) | ||
39 | Q_PROPERTY (QString body READ body WRITE setBody NOTIFY bodyChanged) | ||
40 | Q_PROPERTY (QStringList identityModel READ identityModel) | ||
41 | Q_PROPERTY (int fromIndex READ fromIndex WRITE setFromIndex NOTIFY fromIndexChanged) | ||
42 | |||
43 | public: | ||
44 | explicit Composer(QObject *parent = Q_NULLPTR); | ||
45 | |||
46 | QString to() const; | ||
47 | void setTo(const QString &to); | ||
48 | |||
49 | QString cc() const; | ||
50 | void setCc(const QString &cc); | ||
51 | |||
52 | QString bcc() const; | ||
53 | void setBcc(const QString &bcc); | ||
54 | |||
55 | QString subject() const; | ||
56 | void setSubject(const QString &subject); | ||
57 | |||
58 | QString body() const; | ||
59 | void setBody(const QString &body); | ||
60 | |||
61 | QStringList identityModel() const; | ||
62 | |||
63 | int fromIndex() const; | ||
64 | void setFromIndex(int fromIndex); | ||
65 | |||
66 | QVariant originalMessage() const; | ||
67 | void setOriginalMessage(const QVariant &originalMessage); | ||
68 | |||
69 | signals: | ||
70 | void subjectChanged(); | ||
71 | void bodyChanged(); | ||
72 | void toChanged(); | ||
73 | void ccChanged(); | ||
74 | void bccChanged(); | ||
75 | void fromIndexChanged(); | ||
76 | |||
77 | public slots: | ||
78 | void send(); | ||
79 | void saveAsDraft(); | ||
80 | void clear(); | ||
81 | |||
82 | private: | ||
83 | QSharedPointer<KMime::Message> assembleMessage(); | ||
84 | QString m_to; | ||
85 | QString m_cc; | ||
86 | QString m_bcc; | ||
87 | QString m_subject; | ||
88 | QString m_body; | ||
89 | QStringList m_identityModel; | ||
90 | int m_fromIndex; | ||
91 | QVariant m_originalMessage; | ||
92 | QVariant m_msg; | ||
93 | }; | ||