Changeset View
Changeset View
Standalone View
Standalone View
messageviewer/src/viewer/messagepart.h
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
64 | class MessagePart | 64 | class MessagePart | ||
65 | { | 65 | { | ||
66 | public: | 66 | public: | ||
67 | typedef QSharedPointer<MessagePart> Ptr; | 67 | typedef QSharedPointer<MessagePart> Ptr; | ||
68 | MessagePart(ObjectTreeParser *otp, | 68 | MessagePart(ObjectTreeParser *otp, | ||
69 | PartMetaData *block, | 69 | PartMetaData *block, | ||
70 | const QString &text); | 70 | const QString &text); | ||
71 | 71 | | |||
72 | virtual ~MessagePart() {} | ||||
73 | | ||||
72 | virtual QString text() const; | 74 | virtual QString text() const; | ||
73 | void setText(const QString &text); | 75 | void setText(const QString &text); | ||
74 | virtual void html(bool decorate) const; | 76 | virtual void html(bool decorate) const; | ||
75 | 77 | | |||
76 | PartMetaData *partMetaData() const; | 78 | PartMetaData *partMetaData() const; | ||
77 | 79 | | |||
78 | protected: | 80 | protected: | ||
79 | QString mText; | 81 | QString mText; | ||
80 | ObjectTreeParser *mOtp; | 82 | ObjectTreeParser *mOtp; | ||
81 | PartMetaData *mMetaData; | 83 | PartMetaData *mMetaData; | ||
82 | }; | 84 | }; | ||
83 | 85 | | |||
84 | class CryptoMessagePart : public MessagePart | 86 | class CryptoMessagePart : public MessagePart | ||
85 | { | 87 | { | ||
86 | public: | 88 | public: | ||
87 | typedef QSharedPointer<CryptoMessagePart> Ptr; | 89 | typedef QSharedPointer<CryptoMessagePart> Ptr; | ||
88 | CryptoMessagePart(ObjectTreeParser *otp, | 90 | CryptoMessagePart(ObjectTreeParser *otp, | ||
89 | PartMetaData *block, | 91 | PartMetaData *block, | ||
90 | const QString &text, | 92 | const QString &text, | ||
91 | const Kleo::CryptoBackend::Protocol *cryptoProto, | 93 | const Kleo::CryptoBackend::Protocol *cryptoProto, | ||
92 | const QString &fromAddress, | 94 | const QString &fromAddress, | ||
93 | KMime::Content *node); | 95 | KMime::Content *node); | ||
94 | 96 | | |||
97 | virtual ~CryptoMessagePart(); | ||||
98 | | ||||
95 | void startDecryption(const QByteArray &text, const QTextCodec *aCodec); | 99 | void startDecryption(const QByteArray &text, const QTextCodec *aCodec); | ||
96 | void startDecryption(KMime::Content *data = 0); | 100 | void startDecryption(KMime::Content *data = 0); | ||
97 | void startVerification(const QByteArray &text, const QTextCodec *aCodec); | 101 | void startVerification(const QByteArray &text, const QTextCodec *aCodec); | ||
98 | void startVerificationDetached(const QByteArray& text, KMime::Content* textNode, const QByteArray& signature ); | 102 | void startVerificationDetached(const QByteArray& text, KMime::Content* textNode, const QByteArray& signature ); | ||
99 | void html(bool decorate) const Q_DECL_OVERRIDE; | 103 | void html(bool decorate) const Q_DECL_OVERRIDE; | ||
100 | 104 | | |||
101 | bool mPassphraseError; | 105 | bool mPassphraseError; | ||
102 | QByteArray mDecryptedData; | 106 | QByteArray mDecryptedData; | ||
103 | std::vector<GpgME::Signature> mSignatures; | 107 | std::vector<GpgME::Signature> mSignatures; | ||
104 | 108 | | |||
105 | private: | 109 | private: | ||
106 | /** Writes out the block that we use when the node is encrypted, | 110 | /** Writes out the block that we use when the node is encrypted, | ||
107 | but we're deferring decryption for later. */ | 111 | but we're deferring decryption for later. */ | ||
108 | void writeDeferredDecryptionBlock() const; | 112 | void writeDeferredDecryptionBlock() const; | ||
109 | 113 | | |||
110 | protected: | 114 | protected: | ||
115 | ObjectTreeParser *mSubOtp; | ||||
111 | const Kleo::CryptoBackend::Protocol *mCryptoProto; | 116 | const Kleo::CryptoBackend::Protocol *mCryptoProto; | ||
112 | QString mFromAddress; | 117 | QString mFromAddress; | ||
113 | KMime::Content *mNode, *mTextNode; | 118 | KMime::Content *mNode; | ||
114 | bool mDecryptMessage; | 119 | bool mDecryptMessage; | ||
115 | QByteArray mVerifiedText; | 120 | QByteArray mVerifiedText; | ||
116 | }; | 121 | }; | ||
117 | 122 | | |||
118 | } | 123 | } | ||
119 | #endif //_MESSAGEVIEWER_MESSAGEPART_H_ | 124 | #endif //_MESSAGEVIEWER_MESSAGEPART_H_ |