Changeset View
Changeset View
Standalone View
Standalone View
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (c) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or modify it | ||||
5 | under the terms of the GNU Library General Public License as published by | ||||
6 | the Free Software Foundation; either version 2 of the License, or (at your | ||||
7 | option) any later version. | ||||
8 | | ||||
9 | This library is distributed in the hope that it will be useful, but WITHOUT | ||||
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||||
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public | ||||
12 | License for more details. | ||||
13 | | ||||
14 | You should have received a copy of the GNU Library General Public License | ||||
15 | along with this library; see the file COPYING.LIB. If not, write to the | ||||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||||
17 | 02110-1301, USA. | ||||
18 | */ | ||||
19 | | ||||
20 | #ifndef GNUPGWKSMESSAGEPART_H_ | ||||
21 | #define GNUPGWKSMESSAGEPART_H_ | ||||
22 | | ||||
23 | #include <QString> | ||||
24 | | ||||
25 | namespace MimeTreeParser { | ||||
26 | namespace Interface { | ||||
27 | class BodyPart; | ||||
28 | class ObjectTreeSource; | ||||
29 | } | ||||
30 | } | ||||
31 | | ||||
32 | namespace KMime { | ||||
33 | class Content; | ||||
34 | } | ||||
35 | | ||||
36 | class GnuPGWKSMessagePart | ||||
37 | { | ||||
38 | public: | ||||
39 | enum ConfirmationType { | ||||
40 | UnknownType, | ||||
41 | ConfirmationRequest, | ||||
42 | ConfirmationResponse | ||||
43 | }; | ||||
44 | | ||||
45 | GnuPGWKSMessagePart(MimeTreeParser::Interface::BodyPart *part); | ||||
46 | | ||||
47 | virtual ~GnuPGWKSMessagePart() = default; | ||||
48 | | ||||
49 | ConfirmationType confirmationType() const; | ||||
50 | QString sender() const; | ||||
51 | QString address() const; | ||||
52 | QString fingerprint() const; | ||||
53 | QString nonce() const; | ||||
54 | KMime::Content *node() const; | ||||
55 | MimeTreeParser::Interface::BodyPart *part() const; | ||||
56 | | ||||
57 | protected: | ||||
58 | void parseContent(KMime::Content *node); | ||||
59 | ConfirmationType stringToType(const QStringRef &str); | ||||
60 | | ||||
61 | MimeTreeParser::Interface::BodyPart *mPart; | ||||
62 | QString mSender; | ||||
63 | QString mAddress; | ||||
64 | QString mFingerprint; | ||||
65 | QString mNonce; | ||||
66 | ConfirmationType mType; | ||||
67 | }; | ||||
68 | | ||||
69 | #endif |