diff options
Diffstat (limited to 'framework/src/domain/messageparser.h')
-rw-r--r-- | framework/src/domain/messageparser.h | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/framework/src/domain/messageparser.h b/framework/src/domain/messageparser.h index 2c4febaf..6d52c4b2 100644 --- a/framework/src/domain/messageparser.h +++ b/framework/src/domain/messageparser.h | |||
@@ -27,17 +27,10 @@ | |||
27 | #include <QModelIndex> | 27 | #include <QModelIndex> |
28 | 28 | ||
29 | #include <memory> | 29 | #include <memory> |
30 | #include <MimeTreeParser/MessagePart> | ||
31 | 30 | ||
32 | class QAbstractItemModel; | 31 | class QAbstractItemModel; |
33 | 32 | ||
34 | class Parser; | 33 | class Parser; |
35 | class Part; | ||
36 | class Encryption; | ||
37 | class Signature; | ||
38 | typedef std::shared_ptr<Part> PartPtr; | ||
39 | class Content; | ||
40 | typedef std::shared_ptr<Content> ContentPtr; | ||
41 | class MessagePartPrivate; | 34 | class MessagePartPrivate; |
42 | 35 | ||
43 | class NewModelPrivate; | 36 | class NewModelPrivate; |
@@ -47,9 +40,6 @@ class MessageParser : public QObject | |||
47 | { | 40 | { |
48 | Q_OBJECT | 41 | Q_OBJECT |
49 | Q_PROPERTY (QVariant message READ message WRITE setMessage) | 42 | Q_PROPERTY (QVariant message READ message WRITE setMessage) |
50 | Q_PROPERTY (QString html READ html NOTIFY htmlChanged) | ||
51 | Q_PROPERTY (bool isSimpleHtml READ isSimpleHtml NOTIFY htmlChanged) | ||
52 | Q_PROPERTY (QAbstractItemModel* partTree READ partTree NOTIFY htmlChanged) | ||
53 | Q_PROPERTY (QAbstractItemModel* newTree READ newTree NOTIFY htmlChanged) | 43 | Q_PROPERTY (QAbstractItemModel* newTree READ newTree NOTIFY htmlChanged) |
54 | Q_PROPERTY (QAbstractItemModel* attachments READ attachments NOTIFY htmlChanged) | 44 | Q_PROPERTY (QAbstractItemModel* attachments READ attachments NOTIFY htmlChanged) |
55 | 45 | ||
@@ -57,12 +47,8 @@ public: | |||
57 | explicit MessageParser(QObject *parent = Q_NULLPTR); | 47 | explicit MessageParser(QObject *parent = Q_NULLPTR); |
58 | ~MessageParser(); | 48 | ~MessageParser(); |
59 | 49 | ||
60 | QString html() const; | ||
61 | bool isSimpleHtml() const; | ||
62 | |||
63 | QVariant message() const; | 50 | QVariant message() const; |
64 | void setMessage(const QVariant &to); | 51 | void setMessage(const QVariant &to); |
65 | QAbstractItemModel *partTree() const; | ||
66 | QAbstractItemModel *newTree() const; | 52 | QAbstractItemModel *newTree() const; |
67 | QAbstractItemModel *attachments() const; | 53 | QAbstractItemModel *attachments() const; |
68 | 54 | ||
@@ -73,36 +59,6 @@ private: | |||
73 | std::unique_ptr<MessagePartPrivate> d; | 59 | std::unique_ptr<MessagePartPrivate> d; |
74 | }; | 60 | }; |
75 | 61 | ||
76 | class PartModel : public QAbstractItemModel { | ||
77 | Q_OBJECT | ||
78 | public: | ||
79 | PartModel(QSharedPointer<MimeTreeParser::MessagePart> partTree, std::shared_ptr<Parser> parser); | ||
80 | |||
81 | public: | ||
82 | enum Roles { | ||
83 | Text = Qt::UserRole + 1, | ||
84 | IsHtml, | ||
85 | IsEncrypted, | ||
86 | IsAttachment, | ||
87 | HasContent, | ||
88 | Type, | ||
89 | IsHidden | ||
90 | }; | ||
91 | |||
92 | QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE; | ||
93 | QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; | ||
94 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; | ||
95 | QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; | ||
96 | int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; | ||
97 | int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; | ||
98 | |||
99 | private: | ||
100 | QSharedPointer<MimeTreeParser::MessagePart> mPartTree; | ||
101 | QMap<QByteArray, QUrl> mEmbeddedPartMap; | ||
102 | std::shared_ptr<Parser> mParser; | ||
103 | }; | ||
104 | |||
105 | |||
106 | class NewModel : public QAbstractItemModel { | 62 | class NewModel : public QAbstractItemModel { |
107 | Q_OBJECT | 63 | Q_OBJECT |
108 | public: | 64 | public: |