Changeset View
Changeset View
Standalone View
Standalone View
messageviewer/src/viewer/objecttreeparser.h
Show All 38 Lines | |||||
39 | #include "messageviewer/nodehelper.h" | 39 | #include "messageviewer/nodehelper.h" | ||
40 | #include "objecttreesourceif.h" | 40 | #include "objecttreesourceif.h" | ||
41 | 41 | | |||
42 | #include <Libkleo/CryptoBackend> | 42 | #include <Libkleo/CryptoBackend> | ||
43 | #include <gpgme++/verificationresult.h> | 43 | #include <gpgme++/verificationresult.h> | ||
44 | 44 | | |||
45 | #include <QList> | 45 | #include <QList> | ||
46 | #include "objecttreeemptysource.h" | 46 | #include "objecttreeemptysource.h" | ||
47 | #include "messagepart.h" | | |||
48 | 47 | | |||
49 | class QString; | 48 | class QString; | ||
50 | 49 | | |||
51 | namespace KMime | 50 | namespace KMime | ||
52 | { | 51 | { | ||
53 | class Content; | 52 | class Content; | ||
54 | } | 53 | } | ||
55 | 54 | | |||
56 | namespace GpgME | 55 | namespace GpgME | ||
57 | { | 56 | { | ||
58 | class Error; | 57 | class Error; | ||
59 | class ImportResult; | 58 | class ImportResult; | ||
60 | } | 59 | } | ||
61 | 60 | | |||
62 | namespace MessageViewer | 61 | namespace MessageViewer | ||
63 | { | 62 | { | ||
64 | 63 | | |||
65 | class PartMetaData; | 64 | class PartMetaData; | ||
66 | class ViewerPrivate; | 65 | class ViewerPrivate; | ||
67 | class HtmlWriter; | 66 | class HtmlWriter; | ||
68 | class CSSHelper; | 67 | class CSSHelper; | ||
69 | class AttachmentStrategy; | 68 | class AttachmentStrategy; | ||
70 | class NodeHelper; | 69 | class NodeHelper; | ||
70 | class MessagePart; | ||||
71 | class MimeMessagePart; | ||||
72 | | ||||
73 | typedef QSharedPointer<MessagePart> MessagePartPtr; | ||||
74 | typedef QSharedPointer<MimeMessagePart> MimeMessagePartPtr; | ||||
71 | 75 | | |||
72 | class MESSAGEVIEWER_EXPORT ProcessResult | 76 | class MESSAGEVIEWER_EXPORT ProcessResult | ||
73 | { | 77 | { | ||
74 | public: | 78 | public: | ||
75 | explicit ProcessResult(NodeHelper *nodeHelper, KMMsgSignatureState inlineSignatureState = KMMsgNotSigned, | 79 | explicit ProcessResult(NodeHelper *nodeHelper, KMMsgSignatureState inlineSignatureState = KMMsgNotSigned, | ||
76 | KMMsgEncryptionState inlineEncryptionState = KMMsgNotEncrypted, | 80 | KMMsgEncryptionState inlineEncryptionState = KMMsgNotEncrypted, | ||
77 | bool neverDisplayInline = false, | 81 | bool neverDisplayInline = false, | ||
78 | bool isImage = false) | 82 | bool isImage = false) | ||
▲ Show 20 Lines • Show All 280 Lines • ▼ Show 20 Line(s) | |||||
359 | 363 | | |||
360 | private: | 364 | private: | ||
361 | void extractNodeInfos(KMime::Content *curNode, bool isFirstTextPart); | 365 | void extractNodeInfos(KMime::Content *curNode, bool isFirstTextPart); | ||
362 | 366 | | |||
363 | /** | 367 | /** | ||
364 | * Does the actual work for parseObjectTree. Unlike parseObjectTree(), this does not change the | 368 | * Does the actual work for parseObjectTree. Unlike parseObjectTree(), this does not change the | ||
365 | * top-level content. | 369 | * top-level content. | ||
366 | */ | 370 | */ | ||
367 | MessagePart::Ptr parseObjectTreeInternal(KMime::Content *node); | 371 | MessagePartPtr parseObjectTreeInternal(KMime::Content *node); | ||
368 | 372 | | |||
369 | MessagePart::Ptr defaultHandling(KMime::Content *node, ProcessResult &result); | 373 | MessagePartPtr defaultHandling(KMime::Content *node, ProcessResult &result); | ||
370 | 374 | | |||
371 | /** 1. Create a new partNode using 'content' data and Content-Description | 375 | /** 1. Create a new partNode using 'content' data and Content-Description | ||
372 | found in 'cntDesc'. | 376 | found in 'cntDesc'. | ||
373 | 2. Parse the 'node' to display the content. | 377 | 2. Parse the 'node' to display the content. | ||
374 | */ | 378 | */ | ||
375 | MimeMessagePart::Ptr createAndParseTempNode( KMime::Content* parentNode, const char* content, const char* cntDesc ); | 379 | MimeMessagePartPtr createAndParseTempNode( KMime::Content* parentNode, const char* content, const char* cntDesc ); | ||
376 | 380 | | |||
377 | /** Writes out the information contained in a GpgME::ImportResult */ | 381 | /** Writes out the information contained in a GpgME::ImportResult */ | ||
378 | void writeCertificateImportResult(const GpgME::ImportResult &res); | 382 | void writeCertificateImportResult(const GpgME::ImportResult &res); | ||
379 | 383 | | |||
380 | /** Returns the contents of the given multipart/encrypted | 384 | /** Returns the contents of the given multipart/encrypted | ||
381 | object. Data is decypted. May contain body parts. */ | 385 | object. Data is decypted. May contain body parts. */ | ||
382 | bool okDecryptMIME(KMime::Content &data, | 386 | bool okDecryptMIME(KMime::Content &data, | ||
383 | QByteArray &decryptedData, | 387 | QByteArray &decryptedData, | ||
384 | bool &signatureFound, | 388 | bool &signatureFound, | ||
385 | std::vector<GpgME::Signature> &signatures, | 389 | std::vector<GpgME::Signature> &signatures, | ||
386 | bool showWarning, | 390 | bool showWarning, | ||
387 | bool &passphraseError, | 391 | bool &passphraseError, | ||
388 | bool &actuallyEncrypted, | 392 | bool &actuallyEncrypted, | ||
389 | bool &decryptionStarted, | 393 | bool &decryptionStarted, | ||
390 | PartMetaData &partMetaData); | 394 | PartMetaData &partMetaData); | ||
391 | 395 | | |||
392 | bool okVerify(const QByteArray &data, const Kleo::CryptoBackend::Protocol *cryptProto, MessageViewer::PartMetaData &messagePart, QByteArray &verifiedText, std::vector<GpgME::Signature> &signatures, const QByteArray &signature, KMime::Content *sign); | 396 | bool okVerify(const QByteArray &data, const Kleo::CryptoBackend::Protocol *cryptProto, MessageViewer::PartMetaData &messagePart, QByteArray &verifiedText, std::vector<GpgME::Signature> &signatures, const QByteArray &signature, KMime::Content *sign); | ||
393 | void sigStatusToMetaData(const std::vector<GpgME::Signature> &signatures, const Kleo::CryptoBackend::Protocol *cryptoProtocol, PartMetaData &messagePart, GpgME::Key key); | 397 | void sigStatusToMetaData(const std::vector<GpgME::Signature> &signatures, const Kleo::CryptoBackend::Protocol *cryptoProtocol, PartMetaData &messagePart, GpgME::Key key); | ||
394 | 398 | | |||
395 | public:// (during refactoring) | 399 | public:// (during refactoring) | ||
396 | 400 | | |||
397 | MessagePart::Ptr processTextHtmlSubtype(KMime::Content *node, ProcessResult &result); | 401 | MessagePartPtr processTextHtmlSubtype(KMime::Content *node, ProcessResult &result); | ||
398 | MessagePart::Ptr processTextPlainSubtype(KMime::Content *node, ProcessResult &result); | 402 | MessagePartPtr processTextPlainSubtype(KMime::Content *node, ProcessResult &result); | ||
399 | MessagePart::Ptr processMailmanSubtype(KMime::Content *node, ProcessResult &result); | 403 | MessagePartPtr processMailmanSubtype(KMime::Content *node, ProcessResult &result); | ||
400 | 404 | | |||
401 | MessagePart::Ptr processMultiPartMixedSubtype(KMime::Content *node, ProcessResult &result); | 405 | MessagePartPtr processMultiPartMixedSubtype(KMime::Content *node, ProcessResult &result); | ||
402 | MessagePart::Ptr processMultiPartAlternativeSubtype(KMime::Content *node, ProcessResult &result); | 406 | MessagePartPtr processMultiPartAlternativeSubtype(KMime::Content *node, ProcessResult &result); | ||
403 | MessagePart::Ptr processMultiPartSignedSubtype(KMime::Content *node, ProcessResult &result); | 407 | MessagePartPtr processMultiPartSignedSubtype(KMime::Content *node, ProcessResult &result); | ||
404 | MessagePart::Ptr processMultiPartEncryptedSubtype(KMime::Content *node, ProcessResult &result); | 408 | MessagePartPtr processMultiPartEncryptedSubtype(KMime::Content *node, ProcessResult &result); | ||
405 | 409 | | |||
406 | MessagePart::Ptr processApplicationPkcs7MimeSubtype(KMime::Content *node, ProcessResult &result); | 410 | MessagePartPtr processApplicationPkcs7MimeSubtype(KMime::Content *node, ProcessResult &result); | ||
407 | 411 | | |||
408 | void writePartIcon(KMime::Content *msgPart, bool inlineImage = false); | 412 | void writePartIcon(KMime::Content *msgPart, bool inlineImage = false); | ||
409 | 413 | | |||
410 | QString sigStatusToString(const Kleo::CryptoBackend::Protocol *cryptProto, | 414 | QString sigStatusToString(const Kleo::CryptoBackend::Protocol *cryptProto, | ||
411 | int status_code, | 415 | int status_code, | ||
412 | GpgME::Signature::Summary summary, | 416 | GpgME::Signature::Summary summary, | ||
413 | int &frameColor, | 417 | int &frameColor, | ||
414 | bool &showKeyInfos); | 418 | bool &showKeyInfos); | ||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |