35 #include "kmmsgpart.h"
36 #include "kmmsgbase.h"
37 #include "kmmessage.h"
39 #include "interfaces/bodypart.h"
41 #include <mimelib/mimepp.h>
42 #include <mimelib/body.h>
43 #include <mimelib/utility.h>
45 #include <tdeio/global.h>
50 class KMMimePartTreeItem;
71 int calcNodeIdOrFindNode(
int& curId,
const partNode* calcNode,
72 int findId, partNode** findNode );
75 int explicitType = DwMime::kTypeUnknown,
76 int explicitSubType = DwMime::kSubtypeUnknown,
77 bool deleteDwBodyPart =
false );
81 struct AttachmentDisplayInfo
90 partNode(
bool deleteDwBodyPart,
95 void dump(
int chars=0 )
const;
97 void buildObjectTree(
bool processSiblings=
true );
99 DwBodyPart* dwPart()
const {
103 void setDwPart( DwBodyPart* part ) {
108 KMMessagePart& msgPart()
const {
116 const TQCString & encodedBody();
118 void setType(
int type ) {
122 void setSubType(
int subType ) {
130 TQCString typeString()
const;
132 int subType()
const {
136 TQCString subTypeString()
const;
138 bool hasType(
int type ) {
139 return mType == type;
142 bool hasSubType(
int subType ) {
143 return mSubType == subType;
146 void setEncryptionState( KMMsgEncryptionState state ) {
147 mEncryptionState = state;
149 KMMsgEncryptionState encryptionState()
const {
150 return mEncryptionState;
154 KMMsgEncryptionState overallEncryptionState()
const ;
157 KMMsgSignatureState overallSignatureState()
const ;
159 void setSignatureState( KMMsgSignatureState state ) {
160 mSignatureState = state;
162 KMMsgSignatureState signatureState()
const {
163 return mSignatureState;
169 TQCString path()
const;
173 partNode* findId(
int id );
175 partNode* findType(
int type,
int subType,
bool deep=
true,
bool wide=
true );
177 partNode* findTypeNot(
int type,
int subType,
bool deep=
true,
180 partNode* findNodeForDwPart( DwBodyPart* part );
182 void fillMimePartTree( KMMimePartTreeItem* parentItem,
183 KMMimePartTree* mimePartTree,
184 TQString labelDescr = TQString(),
185 TQString labelCntType = TQString(),
186 TQString labelEncoding = TQString(),
187 TDEIO::filesize_t size=0,
188 bool revertOrder =
false );
190 void adjustDefaultType( partNode* node );
192 void setNext( partNode* next ) {
195 mNext->mRoot = mRoot;
196 adjustDefaultType( mNext );
200 void setFirstChild( partNode* child ) {
203 mChild->mRoot =
this;
204 adjustDefaultType( mChild );
208 void setProcessed(
bool processed,
bool recurse ) {
209 mWasProcessed = processed;
212 mChild->setProcessed( processed,
true );
214 mNext->setProcessed( processed,
true );
218 void setMimePartTreeItem( KMMimePartTreeItem* item ) {
219 mMimePartTreeItem = item;
222 KMMimePartTreeItem* mimePartTreeItem()
const {
223 return mMimePartTreeItem;
226 void setFromAddress(
const TQString& address ) {
227 mFromAddress = address;
230 bool isAttachment()
const;
231 bool isHeuristicalAttachment()
const;
235 bool isFirstTextPart()
const;
237 bool isToltecMessage()
const;
242 bool isInEncapsulatedMessage()
const;
244 bool hasContentDispositionInline()
const;
246 TQString contentTypeParameter(
const char * name )
const;
248 const TQString& trueFromAddress()
const;
250 const partNode * topLevelParent()
const;
251 partNode * parentNode()
const {
return mRoot; }
252 partNode * nextSibling()
const {
return mNext; }
253 partNode * firstChild()
const {
return mChild; }
254 partNode * next(
bool allowChildren=
true )
const;
255 int childCount()
const;
256 int totalChildCount()
const;
257 bool processed()
const {
return mWasProcessed; }
264 bool isDisplayedEmbedded()
const;
265 void setDisplayedEmbedded(
bool displayedEmbedded );
268 bool isDisplayedHidden()
const;
269 void setDisplayedHidden(
bool displayedHidden );
273 TQString asHREF(
const TQString &place )
const;
275 AttachmentDisplayInfo attachmentDisplayInfo()
const;
279 return mReader ? mReader : mRoot ? mRoot->reader() : 0 ;
291 mutable KMMessagePart mMsgPart;
292 TQCString mEncodedBody;
293 TQString mFromAddress;
296 KMMsgEncryptionState mEncryptionState;
297 KMMsgSignatureState mSignatureState;
298 mutable bool mMsgPartOk;
300 bool mDeleteDwBodyPart;
301 KMMimePartTreeItem* mMimePartTreeItem;
302 std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
304 bool mDisplayedEmbedded;
305 bool mDisplayedHidden;
static void bodyPart(DwBodyPart *aDwBodyPart, KMMessagePart *aPart, bool withBody=true)
Fill the KMMessagePart structure for a given DwBodyPart.
This class implements a "reader window", that is a window used for reading or viewing messages.
interface of classes that implement status for BodyPartFormatters.