Messagelib

attachmentfrommimecontentjob.h
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "messagecore_private_export.h"
10 
11 #include "attachmentloadjob.h"
12 #include <memory>
13 namespace KMime
14 {
15 class Content;
16 }
17 
18 namespace MessageCore
19 {
20 /**
21  * @short A job to load an attachment from a mime content.
22  *
23  * @author Constantin Berzan <[email protected]>
24  */
25 class MESSAGECORE_TESTS_EXPORT AttachmentFromMimeContentJob : public AttachmentLoadJob
26 {
27  Q_OBJECT
28 
29 public:
30  /**
31  * Creates a new job.
32  *
33  * @param content The mime content to load the attachment from.
34  * @param parent The parent object.
35  */
36  explicit AttachmentFromMimeContentJob(const KMime::Content *content, QObject *parent = nullptr);
37 
38  /**
39  * Destroys the job.
40  */
41  ~AttachmentFromMimeContentJob() override;
42 
43  /**
44  * Sets the mime @p content to load the attachment from.
45  */
46  void setMimeContent(const KMime::Content *content);
47 
48  /**
49  * Returns the mime content to load the attachment from.
50  */
51  Q_REQUIRED_RESULT const KMime::Content *mimeContent() const;
52 
53 protected Q_SLOTS:
54  void doStart() override;
55 
56 private:
57  //@cond PRIVATE
58  class AttachmentFromMimeContentJobPrivate;
59  std::unique_ptr<AttachmentFromMimeContentJobPrivate> const d;
60  //@endcond
61 };
62 }
A job to load an attachment from a mime content.
A base class for jobs to load attachments from different sources.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:08:16 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.