summaryrefslogtreecommitdiffstats
path: root/components/mailviewer/qml
diff options
context:
space:
mode:
authorSandro Knauß <sknauss@kde.org>2016-10-10 13:01:15 +0200
committerSandro Knauß <sknauss@kde.org>2016-10-10 13:01:15 +0200
commit6b6f20ffbe06402abcc7d4721ad1f647c3fc4c46 (patch)
tree6e2762d879c64373519b0506e9a66ddc27f04830 /components/mailviewer/qml
parent349e404b539c1f9d1feb54658e2e6fbbd2165462 (diff)
parent5fa8608e9877eab40336a60ed8ed979aaf3cfbd0 (diff)
downloadkube-6b6f20ffbe06402abcc7d4721ad1f647c3fc4c46.tar.gz
kube-6b6f20ffbe06402abcc7d4721ad1f647c3fc4c46.zip
Merge branch 'develop' into dev/mimetreeinterface
Diffstat (limited to 'components/mailviewer/qml')
-rw-r--r--components/mailviewer/qml/EmbededPart.qml54
-rw-r--r--components/mailviewer/qml/EncryptedPart.qml43
-rw-r--r--components/mailviewer/qml/HtmlPart.qml48
-rw-r--r--components/mailviewer/qml/MailModel.qml50
-rw-r--r--components/mailviewer/qml/MailModel2.qml28
-rw-r--r--components/mailviewer/qml/MailPart.qml82
-rw-r--r--components/mailviewer/qml/SignedPart.qml44
-rw-r--r--components/mailviewer/qml/TextPart.qml28
-rw-r--r--components/mailviewer/qml/dummyapp.qml90
-rw-r--r--components/mailviewer/qml/securitybordersGRAY.pngbin0 -> 734 bytes
-rw-r--r--components/mailviewer/qml/securitybordersGREEN.pngbin0 -> 725 bytes
-rw-r--r--components/mailviewer/qml/securitybordersRED.pngbin0 -> 725 bytes
-rw-r--r--components/mailviewer/qml/securitybordersYELLOW.pngbin0 -> 735 bytes
13 files changed, 467 insertions, 0 deletions
diff --git a/components/mailviewer/qml/EmbededPart.qml b/components/mailviewer/qml/EmbededPart.qml
new file mode 100644
index 00000000..8921ab6f
--- /dev/null
+++ b/components/mailviewer/qml/EmbededPart.qml
@@ -0,0 +1,54 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21Item {
22
23 height: mailPart.height
24 width: mailPart.width
25
26
27 Rectangle {
28 id: border
29 color: "lightgrey"
30 height: mailPart.height
31 width: 5
32 }
33
34 Text {
35 id: sender
36
37 anchors {
38 left: border.right
39 leftMargin: 15
40 }
41
42 text: "sent by " + model.sender + " on " + model.date
43 color: "grey"
44 }
45
46 MailPart {
47 id: mailPart
48
49 anchors.top: sender.bottom
50
51 }
52
53}
54
diff --git a/components/mailviewer/qml/EncryptedPart.qml b/components/mailviewer/qml/EncryptedPart.qml
new file mode 100644
index 00000000..18a5d588
--- /dev/null
+++ b/components/mailviewer/qml/EncryptedPart.qml
@@ -0,0 +1,43 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20import QtQuick.Controls 1.5
21
22Item {
23
24 height: mailPart.height + 20
25 width: mailPart.width + 20
26
27 BorderImage {
28
29 anchors.fill: parent
30 border { left: 40; top: 40; right: 40; bottom: 40 }
31 horizontalTileMode: BorderImage.Round
32 verticalTileMode: BorderImage.Round
33
34 source: "securityborders" + model.securityLevel + ".png"
35 }
36
37 MailPart {
38 id: mailPart
39
40 anchors.centerIn: parent
41
42 }
43}
diff --git a/components/mailviewer/qml/HtmlPart.qml b/components/mailviewer/qml/HtmlPart.qml
new file mode 100644
index 00000000..f1add75c
--- /dev/null
+++ b/components/mailviewer/qml/HtmlPart.qml
@@ -0,0 +1,48 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20import QtQuick.Controls 1.3
21import QtWebKit 3.0
22// import QtWebEngine 1.3 //This would give use contentsSize
23import QtWebEngine 1.2
24
25Item {
26 id: root
27 property string content: model.htmlContent
28 property int contentHeight: helperView.contentHeight;
29 //FIXME workaround until QtWebEngine 1.3 with contentsSize
30
31 height: contentHeight
32 width: delegateRoot.width
33
34 WebView {
35 id: helperView
36 visible: false
37 Component.onCompleted: loadHtml(content, "file:///")
38 }
39 WebEngineView {
40 id: htmlView
41 anchors.fill: parent
42 Component.onCompleted: loadHtml(content, "file:///")
43 }
44 onContentChanged: {
45 htmlView.loadHtml(content, "file:///");
46 helperView.loadHtml(content, "file:///");
47 }
48}
diff --git a/components/mailviewer/qml/MailModel.qml b/components/mailviewer/qml/MailModel.qml
new file mode 100644
index 00000000..d18f5ece
--- /dev/null
+++ b/components/mailviewer/qml/MailModel.qml
@@ -0,0 +1,50 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21ListModel {
22
23 ListElement {
24 type: "encrypted"
25 securityLevel: "GREEN"
26 content: [
27 ListElement {
28 type: "plaintext"
29 textContent: "Moin, \n find the forwarded mail below. \n \n - M"
30 embeded: false
31 },
32 ListElement {
33 type: "embeded"
34 sender: "Senderson"
35 date: "05/05/2055"
36 content: [
37 ListElement{
38 type: "plaintext"
39 textContent: "sender mc senderson is a sender. sender mc senderson is a sender. sender mc senderson is a mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc a sender sender mc is a sender sender mc senderson is a sendersender mc senderson is a sender"
40 embeded: true
41 }]
42 }
43 ]
44 }
45 ListElement {
46 type: "plaintext"
47 textContent: "footer mc footerson"
48 embeded: false
49 }
50}
diff --git a/components/mailviewer/qml/MailModel2.qml b/components/mailviewer/qml/MailModel2.qml
new file mode 100644
index 00000000..9ea45d57
--- /dev/null
+++ b/components/mailviewer/qml/MailModel2.qml
@@ -0,0 +1,28 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21ListModel {
22
23 ListElement {
24 type: "html"
25 htmlContent: "<!DOCTYPE html> <html> <body> <h1>Some Heading</h1> <p>My some paragraph.</p> </body> </html>"
26 }
27}
28
diff --git a/components/mailviewer/qml/MailPart.qml b/components/mailviewer/qml/MailPart.qml
new file mode 100644
index 00000000..966337cd
--- /dev/null
+++ b/components/mailviewer/qml/MailPart.qml
@@ -0,0 +1,82 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21Item {
22 id: root
23
24 height: partColumn.height + 40
25 width: delegateRoot.width
26
27 Column {
28 id: partColumn
29
30 anchors {
31 top: parent.top
32 left: parent.left
33 right: parent.right
34 margins: 20
35 }
36
37 spacing: 10
38
39 Repeater {
40 model: content
41
42 delegate: Column {
43 id: delegateRoot
44
45 width: partColumn.width
46
47 Loader {
48 id: loader
49 }
50
51 Component.onCompleted: {
52
53 switch (model.type) {
54 case "encrypted":
55 loader.source = "EncryptedPart.qml";
56 break;
57 case "embeded":
58 loader.source = "EmbededPart.qml";
59 break;
60 case "frame":
61 loader.source = "Frame.qml"
62 break;
63 case "plaintext":
64 loader.source = "TextPart.qml";
65 break;
66 case "html":
67 loader.source = "HtmlPart.qml";
68 break;
69 }
70 }
71 }
72 }
73
74
75 Item {
76 id: footer
77
78 height: 5
79 width: 10
80 }
81 }
82}
diff --git a/components/mailviewer/qml/SignedPart.qml b/components/mailviewer/qml/SignedPart.qml
new file mode 100644
index 00000000..f0daedeb
--- /dev/null
+++ b/components/mailviewer/qml/SignedPart.qml
@@ -0,0 +1,44 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20import QtQuick.Controls 1.5
21
22Item {
23
24 height: mailPart.height + 20
25 width: mailPart.width + 20
26
27 BorderImage {
28
29 anchors.fill: parent
30 border { left: 40; top: 40; right: 40; bottom: 40 }
31 horizontalTileMode: BorderImage.Round
32 verticalTileMode: BorderImage.Round
33
34 source: "securityborders" + model.securityLevel + ".png"
35 }
36
37 MailPart {
38 id: mailPart
39
40 anchors.centerIn: parent
41
42 }
43}
44
diff --git a/components/mailviewer/qml/TextPart.qml b/components/mailviewer/qml/TextPart.qml
new file mode 100644
index 00000000..5f183852
--- /dev/null
+++ b/components/mailviewer/qml/TextPart.qml
@@ -0,0 +1,28 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21Text {
22 width: delegateRoot.width
23
24 text: model.textContent
25 wrapMode: Text.WordWrap
26
27 color: embeded ? "grey" : "black"
28}
diff --git a/components/mailviewer/qml/dummyapp.qml b/components/mailviewer/qml/dummyapp.qml
new file mode 100644
index 00000000..a186f0f1
--- /dev/null
+++ b/components/mailviewer/qml/dummyapp.qml
@@ -0,0 +1,90 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19import QtQuick 2.4
20
21Rectangle {
22 id: app
23
24 width: 1200
25 height: 700
26
27 Rectangle {
28 anchors.fill: parent
29
30 color: "black"
31
32 opacity: 0.8
33
34 }
35
36 Rectangle {
37
38 anchors.centerIn: parent
39
40 height: mainColumn.height + 50
41 width: parent.width * 0.9
42
43 Column {
44 id: mainColumn
45
46 anchors.centerIn: parent
47
48 width: parent.width - 50
49
50 spacing: 10
51
52 Repeater {
53 model: MailModel {}
54
55 delegate: Column {
56 id: delegateRoot
57
58 width: mainColumn.width
59
60 Loader {
61 id: loader
62 }
63
64 Component.onCompleted: {
65 switch (model.type) {
66 case "red":
67 loader.source = "Rect2.qml";
68 break;
69 case "green":
70 loader.source = "Rect1.qml";
71 break;
72 case "encrypted":
73 loader.source = "EncryptedPart.qml";
74 break;
75 case "frame":
76 loader.source = "Frame.qml";
77 break;
78 case "plaintext":
79 loader.source = "TextPart.qml";
80 break;
81 case "html":
82 loader.source = "HtmlPart.qml";
83 break;
84 }
85 }
86 }
87 }
88 }
89 }
90}
diff --git a/components/mailviewer/qml/securitybordersGRAY.png b/components/mailviewer/qml/securitybordersGRAY.png
new file mode 100644
index 00000000..f8b768a8
--- /dev/null
+++ b/components/mailviewer/qml/securitybordersGRAY.png
Binary files differ
diff --git a/components/mailviewer/qml/securitybordersGREEN.png b/components/mailviewer/qml/securitybordersGREEN.png
new file mode 100644
index 00000000..8de8c534
--- /dev/null
+++ b/components/mailviewer/qml/securitybordersGREEN.png
Binary files differ
diff --git a/components/mailviewer/qml/securitybordersRED.png b/components/mailviewer/qml/securitybordersRED.png
new file mode 100644
index 00000000..f28ed990
--- /dev/null
+++ b/components/mailviewer/qml/securitybordersRED.png
Binary files differ
diff --git a/components/mailviewer/qml/securitybordersYELLOW.png b/components/mailviewer/qml/securitybordersYELLOW.png
new file mode 100644
index 00000000..a40a8887
--- /dev/null
+++ b/components/mailviewer/qml/securitybordersYELLOW.png
Binary files differ