Messagelib

attachmentfromurlbasejob.h
1/*
2 SPDX-FileCopyrightText: 2011 Martin Bednár <serafean@gmail.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messagecore_export.h"
10
11#include "attachmentloadjob.h"
12
13#include <QUrl>
14#include <memory>
15namespace MessageCore
16{
17/**
18 * @brief The AttachmentFromUrlBaseJob class
19 */
20class MESSAGECORE_EXPORT AttachmentFromUrlBaseJob : public AttachmentLoadJob
21{
22 Q_OBJECT
23
24public:
25 explicit AttachmentFromUrlBaseJob(const QUrl &url = QUrl(), QObject *parent = nullptr);
26 ~AttachmentFromUrlBaseJob() override;
27
28 /**
29 * Returns the url that will be loaded as attachment.
30 */
31 [[nodiscard]] QUrl url() const;
32
33 /**
34 * Returns the maximum size the attachment is allowed to have.
35 */
36 [[nodiscard]] qint64 maximumAllowedSize() const;
37
38 /**
39 * Sets the @p url of the folder that will be loaded as attachment.
40 */
41 void setUrl(const QUrl &url);
42
43 /**
44 * Sets the maximum @p size the attachment is allowed to have.
45 */
46 void setMaximumAllowedSize(qint64 size);
47
48protected Q_SLOTS:
49 void doStart() override = 0;
50
51private:
52 //@cond PRIVATE
53 class AttachmentFromUrlBaseJobPrivate;
54 std::unique_ptr<AttachmentFromUrlBaseJobPrivate> const d;
55};
56}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.