Changeset View
Changeset View
Standalone View
Standalone View
framework/domain/mimetreeparser/interface.h
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
61 | { | 61 | { | ||
62 | public: | 62 | public: | ||
63 | typedef std::shared_ptr<Part> Ptr; | 63 | typedef std::shared_ptr<Part> Ptr; | ||
64 | Part(); | 64 | Part(); | ||
65 | virtual QByteArray type() const; | 65 | virtual QByteArray type() const; | ||
66 | 66 | | |||
67 | bool hasSubParts() const; | 67 | bool hasSubParts() const; | ||
68 | QVector<Part::Ptr> subParts() const; | 68 | QVector<Part::Ptr> subParts() const; | ||
69 | Part::Ptr parent() const; | 69 | Part *parent() const; | ||
70 | 70 | | |||
71 | virtual QVector<Signature> signatures() const; | 71 | virtual QVector<Signature> signatures() const; | ||
72 | virtual QVector<Encryption> encryptions() const; | 72 | virtual QVector<Encryption> encryptions() const; | ||
73 | private: | 73 | private: | ||
74 | std::unique_ptr<PartPrivate> d; | 74 | std::unique_ptr<PartPrivate> d; | ||
75 | friend class ParserPrivate; | 75 | friend class ParserPrivate; | ||
76 | friend class PartPrivate; | 76 | friend class PartPrivate; | ||
77 | }; | 77 | }; | ||
78 | 78 | | |||
79 | class Content | 79 | class Content | ||
80 | { | 80 | { | ||
81 | public: | 81 | public: | ||
82 | typedef std::shared_ptr<Content> Ptr; | 82 | typedef std::shared_ptr<Content> Ptr; | ||
83 | Content(const QByteArray &content, ContentPart *parent); | 83 | Content(const QByteArray &content, ContentPart *parent); | ||
84 | virtual ~Content(); | 84 | virtual ~Content(); | ||
85 | 85 | | |||
86 | QByteArray content() const; | 86 | QByteArray content() const; | ||
87 | 87 | | |||
88 | QByteArray charset() const; | ||||
89 | | ||||
cmollekopf: What is this used for? Is the identifier stable over different parsing runs? | |||||
yes it should be stable over the runs - It can be used for scrolling to the correct part, if a rerun is needed f.ex. knauss: yes it should be stable over the runs - It can be used for scrolling to the correct part, if a… | |||||
88 | //Use default charset | 90 | //Use default charset | ||
89 | QString encodedContent() const; | 91 | QString encodedContent() const; | ||
90 | 92 | | |||
91 | // overwrite default charset with given charset | 93 | // overwrite default charset with given charset | ||
92 | QString encodedContent(QByteArray charset) const; | 94 | QString encodedContent(QByteArray charset) const; | ||
93 | 95 | | |||
94 | virtual QVector<Signature> signatures() const; | 96 | virtual QVector<Signature> signatures() const; | ||
95 | virtual QVector<Encryption> encryptions() const; | 97 | virtual QVector<Encryption> encryptions() const; | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 159 | enum Type { | |||
158 | PlainText = 0x0001, | 160 | PlainText = 0x0001, | ||
159 | Html = 0x0002 | 161 | Html = 0x0002 | ||
160 | }; | 162 | }; | ||
161 | Q_DECLARE_FLAGS(Types, Type) | 163 | Q_DECLARE_FLAGS(Types, Type) | ||
162 | 164 | | |||
163 | ContentPart(); | 165 | ContentPart(); | ||
164 | virtual ~ContentPart(); | 166 | virtual ~ContentPart(); | ||
165 | 167 | | |||
166 | QVector<Content> content(Type ct) const; | 168 | QVector<Content::Ptr> content(Type ct) const; | ||
167 | 169 | | |||
168 | Types availableContents() const; | 170 | Types availableContents() const; | ||
169 | 171 | | |||
170 | QByteArray type() const Q_DECL_OVERRIDE; | 172 | QByteArray type() const Q_DECL_OVERRIDE; | ||
171 | 173 | | |||
172 | private: | 174 | private: | ||
173 | std::unique_ptr<ContentPartPrivate> d; | 175 | std::unique_ptr<ContentPartPrivate> d; | ||
174 | 176 | | |||
Show All 16 Lines | |||||
191 | /* | 193 | /* | ||
192 | * Open Questions: | 194 | * Open Questions: | ||
193 | * - How to make the string translateable for multiple clients, so that multiple clients can show same error messages, | 195 | * - How to make the string translateable for multiple clients, so that multiple clients can show same error messages, | ||
194 | * that helps users to understand what is going on ? | 196 | * that helps users to understand what is going on ? | ||
195 | * - Does openpgp have translations already? | 197 | * - Does openpgp have translations already? | ||
196 | */ | 198 | */ | ||
197 | class EncryptionError | 199 | class EncryptionError | ||
198 | { | 200 | { | ||
199 | public: | 201 | public: | ||
If availableContents is in Part, shouldn't content(const QByteArray&) also be there? cmollekopf: If availableContents is in Part, shouldn't content(const QByteArray&) also be there? | |||||
200 | int errorId() const; | 202 | int errorId() const; | ||
201 | QString errorString() const; | 203 | QString errorString() const; | ||
202 | }; | 204 | }; | ||
203 | 205 | | |||
204 | class EncryptionPart : public MimePart | 206 | class EncryptionPart : public MimePart | ||
205 | { | 207 | { | ||
206 | public: | 208 | public: | ||
207 | typedef std::shared_ptr<EncryptionPart> Ptr; | 209 | typedef std::shared_ptr<EncryptionPart> Ptr; | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 242 | public: | |||
254 | CertType certType() const; | 256 | CertType certType() const; | ||
255 | CertSubType certSubType() const; | 257 | CertSubType certSubType() const; | ||
256 | int keyLength() const; | 258 | int keyLength() const; | ||
257 | 259 | | |||
258 | private: | 260 | private: | ||
259 | std::unique_ptr<CertPartPrivate> d; | 261 | std::unique_ptr<CertPartPrivate> d; | ||
260 | }; | 262 | }; | ||
261 | 263 | | |||
262 | | ||||
263 | class Key | 264 | class Key | ||
264 | { | 265 | { | ||
265 | QString keyid() const; | 266 | QString keyid() const; | ||
266 | QString name() const; | 267 | QString name() const; | ||
267 | QString email() const; | 268 | QString email() const; | ||
268 | QString comment() const; | 269 | QString comment() const; | ||
269 | QVector<QString> emails() const; | 270 | QVector<QString> emails() const; | ||
270 | enum KeyTrust { | 271 | enum KeyTrust { | ||
Show All 33 Lines | |||||
304 | { | 305 | { | ||
305 | public: | 306 | public: | ||
306 | typedef std::shared_ptr<Parser> Ptr; | 307 | typedef std::shared_ptr<Parser> Ptr; | ||
307 | Parser(const QByteArray &mimeMessage); | 308 | Parser(const QByteArray &mimeMessage); | ||
308 | ~Parser(); | 309 | ~Parser(); | ||
309 | 310 | | |||
310 | Part::Ptr getPart(QUrl url); | 311 | Part::Ptr getPart(QUrl url); | ||
311 | 312 | | |||
312 | //template <typename T> QVector<T::Ptr> collect<T>(Part start, std::function<bool(const Part &)> select, std::function<bool(const T::Ptr &)> filter) const; | 313 | template <typename T> QVector<typename T::Ptr> collect(const Part::Ptr &start, std::function<bool(const Part::Ptr &)> select, std::function<bool(const typename T::Ptr &)> filter) const; | ||
313 | QVector<AttachmentPart::Ptr> collectAttachments(Part::Ptr start, std::function<bool(const Part::Ptr &)> select, std::function<bool(const AttachmentPart::Ptr &)> filter) const; | 314 | QVector<AttachmentPart::Ptr> collectAttachments(Part::Ptr start, std::function<bool(const Part::Ptr &)> select, std::function<bool(const AttachmentPart::Ptr &)> filter) const; | ||
314 | ContentPart::Ptr collectContentPart(Part::Ptr start, std::function<bool(const Part::Ptr &)> select, std::function<bool(const ContentPart::Ptr &)> filter) const; | 315 | ContentPart::Ptr collectContentPart(Part::Ptr start, std::function<bool(const Part::Ptr &)> select, std::function<bool(const ContentPart::Ptr &)> filter) const; | ||
315 | ContentPart::Ptr collectContentPart(const Part::Ptr& start) const; | 316 | ContentPart::Ptr collectContentPart(const Part::Ptr& start) const; | ||
316 | ContentPart::Ptr collectContentPart() const; | 317 | ContentPart::Ptr collectContentPart() const; | ||
317 | //template <> QVector<ContentPart::Ptr> collect<ContentPart>() const; | 318 | //template <> QVector<ContentPart::Ptr> collect<ContentPart>() const; | ||
318 | 319 | | |||
319 | //template <> static StatusObject<SignatureVerificationResult> verifySignature(const Signature signature) const; | 320 | //template <> static StatusObject<SignatureVerificationResult> verifySignature(const Signature signature) const; | ||
320 | //template <> static StatusObject<Part> decrypt(const EncryptedPart part) const; | 321 | //template <> static StatusObject<Part> decrypt(const EncryptedPart part) const; | ||
321 | 322 | | |||
322 | signals: | 323 | signals: | ||
323 | void partsChanged(); | 324 | void partsChanged(); | ||
324 | 325 | | |||
325 | private: | 326 | private: | ||
326 | std::unique_ptr<ParserPrivate> d; | 327 | std::unique_ptr<ParserPrivate> d; | ||
327 | }; | 328 | }; | ||
329 | | ||||
328 | No newline at end of file | |
What is this used for? Is the identifier stable over different parsing runs?