Messagelib

attachmentloadjob.h
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messagecore_export.h"
10
11#include "attachmentpart.h"
12
13#include <KJob>
14
15namespace MessageCore
16{
17/**
18 * @short A base class for jobs to load attachments from different sources.
19 *
20 * @author Constantin Berzan <exit3219@gmail.com>
21 */
22class MESSAGECORE_EXPORT AttachmentLoadJob : public KJob
23{
24 Q_OBJECT
25
26public:
27 /**
28 * Creates a new attachment load job.
29 *
30 * @param parent The parent object.
31 */
32 explicit AttachmentLoadJob(QObject *parent = nullptr);
33
34 /**
35 * Destroys the attachment load job.
36 */
38
39 /**
40 * Starts the attachment load job.
41 */
42 void start() override;
43
44 /**
45 * Returns the loaded attachment.
46 */
47 [[nodiscard]] AttachmentPart::Ptr attachmentPart() const;
48
49protected:
50 /**
51 * Subclasses use this method to set the loaded @p part.
52 */
53 void setAttachmentPart(const AttachmentPart::Ptr &part);
54
55protected Q_SLOTS:
56 virtual void doStart() = 0;
57
58private:
59 //@cond PRIVATE
60 class AttachmentLoadJobPrivate;
61 std::unique_ptr<AttachmentLoadJobPrivate> const d;
62 //@endcond
63};
64}
A base class for jobs to load attachments from different sources.
~AttachmentLoadJob() override
Destroys the attachment load job.
Q_SCRIPTABLE Q_NOREPLY void start()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.