Messagelib

attachmentfromurlbasejob.h
1 /*
2  SPDX-FileCopyrightText: 2011 Martin Bedn├ír <[email protected]>
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>
15 namespace MessageCore
16 {
17 /**
18  * @brief The AttachmentFromUrlBaseJob class
19  */
20 class MESSAGECORE_EXPORT AttachmentFromUrlBaseJob : public AttachmentLoadJob
21 {
22  Q_OBJECT
23 
24 public:
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  Q_REQUIRED_RESULT QUrl url() const;
32 
33  /**
34  * Returns the maximum size the attachment is allowed to have.
35  */
36  Q_REQUIRED_RESULT 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 
48 protected Q_SLOTS:
49  void doStart() override = 0;
50 
51 private:
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-2021 The KDE developers.
Generated on Sat Dec 4 2021 23:12:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.