From 349e404b539c1f9d1feb54658e2e6fbbd2165462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Wed, 10 Aug 2016 13:20:11 +0200 Subject: Use new mimetreeparser interface --- framework/domain/messageparser.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'framework/domain/messageparser.h') diff --git a/framework/domain/messageparser.h b/framework/domain/messageparser.h index 3e0255df..9469f2b5 100644 --- a/framework/domain/messageparser.h +++ b/framework/domain/messageparser.h @@ -29,11 +29,11 @@ #include #include -namespace MimeTreeParser { - class NodeHelper; -}; class QAbstractItemModel; +class Parser; +class MessagePartPrivate; + class MessageParser : public QObject { Q_OBJECT @@ -43,6 +43,7 @@ class MessageParser : public QObject public: explicit MessageParser(QObject *parent = Q_NULLPTR); + ~MessageParser(); QString html() const; @@ -54,16 +55,13 @@ signals: void htmlChanged(); private: - QSharedPointer mPartTree; - QString mHtml; - QMap mEmbeddedPartMap; - std::shared_ptr mNodeHelper; + std::unique_ptr d; }; class PartModel : public QAbstractItemModel { Q_OBJECT public: - PartModel(QSharedPointer partTree, QMap embeddedPartMap); + PartModel(QSharedPointer partTree, std::shared_ptr parser); public: enum Roles { @@ -86,5 +84,6 @@ public: private: QSharedPointer mPartTree; QMap mEmbeddedPartMap; + std::shared_ptr mParser; }; -- cgit v1.2.3 From 1974c19eadd497e355ac985a00d0571f3e6c7712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Tue, 11 Oct 2016 16:18:50 +0200 Subject: create model for new mailviewer --- framework/domain/messageparser.h | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'framework/domain/messageparser.h') diff --git a/framework/domain/messageparser.h b/framework/domain/messageparser.h index 9469f2b5..b3d7537d 100644 --- a/framework/domain/messageparser.h +++ b/framework/domain/messageparser.h @@ -32,6 +32,10 @@ class QAbstractItemModel; class Parser; +class Part; +typedef std::shared_ptr PartPtr; +class Content; +typedef std::shared_ptr ContentPtr; class MessagePartPrivate; class MessageParser : public QObject @@ -40,6 +44,7 @@ class MessageParser : public QObject Q_PROPERTY (QVariant message READ message WRITE setMessage) Q_PROPERTY (QString html READ html NOTIFY htmlChanged) Q_PROPERTY (QAbstractItemModel* partTree READ partTree NOTIFY htmlChanged) + Q_PROPERTY (QAbstractItemModel* newTree READ newTree NOTIFY htmlChanged) public: explicit MessageParser(QObject *parent = Q_NULLPTR); @@ -50,6 +55,7 @@ public: QVariant message() const; void setMessage(const QVariant &to); QAbstractItemModel *partTree() const; + QAbstractItemModel *newTree() const; signals: void htmlChanged(); @@ -87,3 +93,54 @@ private: std::shared_ptr mParser; }; + +class NewContentModel : public QAbstractItemModel { + Q_OBJECT +public: + NewContentModel (const PartPtr &part); + +public: + enum Roles { + TypeRole = Qt::UserRole + 1, + ContentRole, + IsEmbededRole, + SecurityLevelRole + }; + + QHash roleNames() const Q_DECL_OVERRIDE; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + +private: + const PartPtr &mPart; +}; + +class NewModel : public QAbstractItemModel { + Q_OBJECT +public: + NewModel(std::shared_ptr parser); + +public: + enum Roles { + TypeRole = Qt::UserRole + 1, + ContentsRole, + IsEmbededRole, + SecurityLevelRole + }; + + QHash roleNames() const Q_DECL_OVERRIDE; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + +private: + std::shared_ptr mParser; + QVector mParts; + QMap> mContentMap; +}; + -- cgit v1.2.3 From 1fe0ab05ae2bfe6505736f598bd535a71fb86a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Mon, 17 Oct 2016 15:35:49 +0200 Subject: replace cid links with actuall content of the images --- framework/domain/messageparser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'framework/domain/messageparser.h') diff --git a/framework/domain/messageparser.h b/framework/domain/messageparser.h index b3d7537d..5eb355e7 100644 --- a/framework/domain/messageparser.h +++ b/framework/domain/messageparser.h @@ -97,7 +97,7 @@ private: class NewContentModel : public QAbstractItemModel { Q_OBJECT public: - NewContentModel (const PartPtr &part); + NewContentModel (const PartPtr &part, const std::shared_ptr &parser); public: enum Roles { @@ -116,6 +116,7 @@ public: private: const PartPtr &mPart; + const std::shared_ptr &mParser; }; class NewModel : public QAbstractItemModel { -- cgit v1.2.3 From d708e1310cc8e65fab078eb6b5b4a325de462a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Tue, 18 Oct 2016 15:30:11 +0200 Subject: start implementing a nested model with sig->enc->part->content --- framework/domain/messageparser.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'framework/domain/messageparser.h') diff --git a/framework/domain/messageparser.h b/framework/domain/messageparser.h index 5eb355e7..e3b81dd7 100644 --- a/framework/domain/messageparser.h +++ b/framework/domain/messageparser.h @@ -33,11 +33,15 @@ class QAbstractItemModel; class Parser; class Part; +class Encryption; +class Signature; typedef std::shared_ptr PartPtr; class Content; typedef std::shared_ptr ContentPtr; class MessagePartPrivate; +class NewModelPrivate; + class MessageParser : public QObject { Q_OBJECT @@ -123,6 +127,7 @@ class NewModel : public QAbstractItemModel { Q_OBJECT public: NewModel(std::shared_ptr parser); + ~NewModel(); public: enum Roles { @@ -140,8 +145,6 @@ public: int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; private: - std::shared_ptr mParser; - QVector mParts; - QMap> mContentMap; + std::unique_ptr d; }; -- cgit v1.2.3 From be38c2ebaa77b116028cbe34f777e3d8e5cbc776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Tue, 18 Oct 2016 20:33:00 +0200 Subject: output content from content item --- framework/domain/messageparser.h | 1 + 1 file changed, 1 insertion(+) (limited to 'framework/domain/messageparser.h') diff --git a/framework/domain/messageparser.h b/framework/domain/messageparser.h index e3b81dd7..55c884f9 100644 --- a/framework/domain/messageparser.h +++ b/framework/domain/messageparser.h @@ -133,6 +133,7 @@ public: enum Roles { TypeRole = Qt::UserRole + 1, ContentsRole, + ContentRole, IsEmbededRole, SecurityLevelRole }; -- cgit v1.2.3 From 17a926c2697143937b0c1700b1d1e8081f727059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Wed, 19 Oct 2016 15:22:31 +0200 Subject: delete useless NewContentModel --- framework/domain/messageparser.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'framework/domain/messageparser.h') diff --git a/framework/domain/messageparser.h b/framework/domain/messageparser.h index 55c884f9..559fa6f9 100644 --- a/framework/domain/messageparser.h +++ b/framework/domain/messageparser.h @@ -98,31 +98,6 @@ private: }; -class NewContentModel : public QAbstractItemModel { - Q_OBJECT -public: - NewContentModel (const PartPtr &part, const std::shared_ptr &parser); - -public: - enum Roles { - TypeRole = Qt::UserRole + 1, - ContentRole, - IsEmbededRole, - SecurityLevelRole - }; - - QHash roleNames() const Q_DECL_OVERRIDE; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; - int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - -private: - const PartPtr &mPart; - const std::shared_ptr &mParser; -}; - class NewModel : public QAbstractItemModel { Q_OBJECT public: -- cgit v1.2.3