summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Knauß <[email protected]>2016-03-26 15:35:15 +0100
committerSandro Knauß <[email protected]>2016-03-27 01:19:37 +0100
commita828ebd1e34834bb6f8073f0b62ccefabb8eac7e (patch)
treee673f8af736121bd3304f068a4e778c3b6c16c9f
parent0ea79a3c703ccee755ed3a4f6f21397c55a52fb5 (diff)
Add source to BodyPart, so that plugins can reach the source of ObjectTreeParser
-rw-r--r--mimetreeparser/src/interfaces/bodypart.h3
-rw-r--r--mimetreeparser/src/viewer/objecttreeparser.h1
-rw-r--r--mimetreeparser/src/viewer/partnodebodypart.cpp5
-rw-r--r--mimetreeparser/src/viewer/partnodebodypart.h1
4 files changed, 10 insertions, 0 deletions
diff --git a/mimetreeparser/src/interfaces/bodypart.h b/mimetreeparser/src/interfaces/bodypart.h
index da69237..a8b45a5 100644
--- a/mimetreeparser/src/interfaces/bodypart.h
+++ b/mimetreeparser/src/interfaces/bodypart.h
@@ -47,6 +47,8 @@ namespace MessageViewer
class NodeHelper;
class ObjectTreeParser;
class ProcessResult;
+class ObjectTreeSourceIf;
+
namespace Interface
{
@@ -195,6 +197,7 @@ public:
* For making it easier to refactor, add objectTreeParser
*/
virtual MessageViewer::ObjectTreeParser *objectTreeParser() const = 0;
+ virtual MessageViewer::ObjectTreeSourceIf *source() const = 0;
virtual MessageViewer::ProcessResult *processResult() const = 0;
};
diff --git a/mimetreeparser/src/viewer/objecttreeparser.h b/mimetreeparser/src/viewer/objecttreeparser.h
index d78d365..ac6a607 100644
--- a/mimetreeparser/src/viewer/objecttreeparser.h
+++ b/mimetreeparser/src/viewer/objecttreeparser.h
@@ -463,6 +463,7 @@ private:
bool mDeleteNodeHelper;
bool mPrinting;
+ friend class PartNodeBodyPart;
friend class MessagePart;
friend class CryptoMessagePart;
friend class CertMessagePart;
diff --git a/mimetreeparser/src/viewer/partnodebodypart.cpp b/mimetreeparser/src/viewer/partnodebodypart.cpp
index d0cb96a..295b434 100644
--- a/mimetreeparser/src/viewer/partnodebodypart.cpp
+++ b/mimetreeparser/src/viewer/partnodebodypart.cpp
@@ -118,3 +118,8 @@ void PartNodeBodyPart::setDefaultDisplay(Interface::BodyPart::Display d)
{
mDefaultDisplay = d;
}
+
+ObjectTreeSourceIf *PartNodeBodyPart::source() const
+{
+ return mObjectTreeParser->mSource;
+} \ No newline at end of file
diff --git a/mimetreeparser/src/viewer/partnodebodypart.h b/mimetreeparser/src/viewer/partnodebodypart.h
index 2488047..50fc1c6 100644
--- a/mimetreeparser/src/viewer/partnodebodypart.h
+++ b/mimetreeparser/src/viewer/partnodebodypart.h
@@ -97,6 +97,7 @@ public:
return mProcessResult;
}
+ ObjectTreeSourceIf *source() const Q_DECL_OVERRIDE;
private:
KMime::Content *mTopLevelContent;
KMime::Content *mContent;