Dekko
MessageComposer.qml
1 /* Copyright (C) 2016 - 2017 Dan Chapman <dpniel@ubuntu.com>
2 
3  This file is part of Dekko email client for Ubuntu devices
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License as
7  published by the Free Software Foundation; either version 2 of
8  the License or (at your option) version 3
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 import QtQuick 2.4
19 import QtQuick.Controls.Suru 2.2
20 import Lomiri.Components 1.3
21 import Dekko.Components 1.0
22 import Dekko.Mail 1.0
23 import Dekko.Mail.API 1.0
24 import Dekko.Mail.Stores.Composer 1.0
25 import Dekko.Markdown 1.0
26 import Dekko.Lomiri.Constants 1.0
27 
28 FocusScope {
29  anchors.fill: parent
30 
31  Rectangle {
32  anchors.fill: parent
33  color: Suru.backgroundColor
34  }
35 
37  id: pbuilder
38  onPartsReady: ContentActions.displayHtmlContent(composer, parts.html)
39  }
40 
41  Binding {
42  target: ComposerStore
43  property: "bodyDocument"
44  value: me.textDocument
45  }
46 
48  id: me
49  anchors.fill: parent
50  frameSpacing: units.gu(2)
51  plainTextOnly: true
52 
53  onShowPreview: {
54  var sig = ComposerStore.currentSignature ? "-- \n%1".arg(ComposerStore.currentSignature) : ""
55  pbuilder.build(text, sig)
56  }
57 
58  header: Column {
59  id: contentHeader
60  anchors {
61  top: parent.top
62  left: parent.left
63  right: parent.right
64  }
65 
67  anchors {
68  left: parent.left
69  right: parent.right
70  }
71  }
72 
74  recipientType: RecipientType.To
75  recipientModel: ComposerStore.recipients.to
76  anchors {
77  left: parent.left
78  right: parent.right
79  }
80  }
81 
83  visible: ComposerStore.showCC || ComposerStore.recipients.cc.count
84  recipientType: RecipientType.Cc
85  recipientModel: ComposerStore.recipients.cc
86  anchors {
87  left: parent.left
88  right: parent.right
89  }
90  }
92  visible: ComposerStore.showBCC || ComposerStore.recipients.bcc.count
93  recipientType: RecipientType.Bcc
94  recipientModel: ComposerStore.recipients.bcc
95  anchors {
96  left: parent.left
97  right: parent.right
98  }
99  }
100  SubjectField {
101  anchors {
102  left: parent.left
103  right: parent.right
104  }
105  }
106  }
107  }
108 }
109 
SenderIdentityField
Definition: SenderIdentityField.qml:26
RecipientField
Definition: RecipientField.qml:28
Dekko
Definition: Dekko.qml:30
Dekko::Markdown::MarkdownPartBuilder
Definition: MarkdownPartBuilder.qml:6
Dekko::Markdown::MarkdownEditor
Definition: MarkdownEditor.qml:7
SubjectField
Definition: SubjectField.qml:25