summaryrefslogtreecommitdiffstats
path: root/kmail/partNode.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /kmail/partNode.h
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/partNode.h')
-rw-r--r--kmail/partNode.h69
1 files changed, 59 insertions, 10 deletions
diff --git a/kmail/partNode.h b/kmail/partNode.h
index d53977035..ddc76aa62 100644
--- a/kmail/partNode.h
+++ b/kmail/partNode.h
@@ -45,9 +45,13 @@
#include <kio/global.h>
#include <kdebug.h>
+#include <map>
+
class KMMimePartTreeItem;
class KMMimePartTree;
+class KMReaderWin;
+
/*
===========================================================================
@@ -67,14 +71,22 @@ class partNode
int calcNodeIdOrFindNode( int& curId, const partNode* calcNode,
int findId, partNode** findNode );
-public:
- static partNode * fromMessage( const KMMessage * msg );
-
- partNode( DwBodyPart* dwPart,
+ partNode( KMReaderWin * win, DwBodyPart* dwPart,
int explicitType = DwMime::kTypeUnknown,
int explicitSubType = DwMime::kSubtypeUnknown,
bool deleteDwBodyPart = false );
+public:
+
+ struct AttachmentDisplayInfo
+ {
+ TQString label;
+ TQString icon;
+ bool displayInHeader;
+ };
+
+ static partNode * fromMessage( const KMMessage * msg, KMReaderWin * win=0 );
+
partNode( bool deleteDwBodyPart,
DwBodyPart* dwPart );
@@ -151,6 +163,11 @@ public:
return mSignatureState;
}
+ // path is a hierarchical path to this partNode. It is designed to
+ // be stable under decryption, where new child nodes are
+ // added. Treat it as an opaque string.
+ TQCString path() const;
+
int nodeId() const; // node ids start at 1 (this is the top level root node)
partNode* findId( int id ); // returns the node which has the given id (or 0, resp.)
@@ -202,7 +219,7 @@ public:
mMimePartTreeItem = item;
}
- KMMimePartTreeItem* mimePartTreeItem() {
+ KMMimePartTreeItem* mimePartTreeItem() const {
return mMimePartTreeItem;
}
@@ -217,23 +234,52 @@ public:
*/
bool isFirstTextPart() const;
+ bool isToltecMessage() const;
+
+ /**
+ * @return true if this node is a child or an encapsulated message
+ */
+ bool isInEncapsulatedMessage() const;
+
bool hasContentDispositionInline() const;
TQString contentTypeParameter( const char * name ) const;
const TQString& trueFromAddress() const;
+ const partNode * topLevelParent() const;
partNode * parentNode() const { return mRoot; }
partNode * nextSibling() const { return mNext; }
partNode * firstChild() const { return mChild; }
partNode * next( bool allowChildren=true ) const;
int childCount() const;
+ int totalChildCount() const;
bool processed() const { return mWasProcessed; }
- KMail::Interface::BodyPartMemento * bodyPartMemento() const { return mBodyPartMemento; };
- void setBodyPartMemento( KMail::Interface::BodyPartMemento * memento ) {
- mBodyPartMemento = memento;
- };
+ KMail::Interface::BodyPartMemento * bodyPartMemento( const TQCString & which ) const;
+ void setBodyPartMemento( const TQCString & which, KMail::Interface::BodyPartMemento * memento );
+
+ // A flag to remember if the node was embedded. This is useful for attachment nodes, the reader
+ // needs to know if they were displayed inline or not.
+ bool isDisplayedEmbedded() const;
+ void setDisplayedEmbedded( bool displayedEmbedded );
+
+ // Same as above, but this time determines if the node was hidden or not
+ bool isDisplayedHidden() const;
+ void setDisplayedHidden( bool displayedHidden );
+
+ // Get a href in the form attachment:<nodeId>?place=<place>, used by ObjectTreeParser and
+ // UrlHandlerManager.
+ TQString asHREF( const TQString &place ) const;
+
+ AttachmentDisplayInfo attachmentDisplayInfo() const;
+
+private:
+ KMReaderWin * reader() const {
+ return mReader ? mReader : mRoot ? mRoot->reader() : 0 ;
+ }
+ KMail::Interface::BodyPartMemento * internalBodyPartMemento( const TQCString & ) const;
+ void internalSetBodyPartMemento( const TQCString & which, KMail::Interface::BodyPartMemento * memento );
private:
partNode* mRoot;
@@ -253,7 +299,10 @@ private:
bool mEncodedOk;
bool mDeleteDwBodyPart;
KMMimePartTreeItem* mMimePartTreeItem;
- KMail::Interface::BodyPartMemento * mBodyPartMemento;
+ std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
+ KMReaderWin * mReader;
+ bool mDisplayedEmbedded;
+ bool mDisplayedHidden;
};
#endif