File indexing completed on 2025-03-09 04:54:12

0001 /*
0002     SPDX-FileCopyrightText: 2011 Martin Bednár <serafean@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "MessageCore/AttachmentFromUrlBaseJob"
0010 
0011 #include <KZip>
0012 #include <memory>
0013 namespace MessageCore
0014 {
0015 class AttachmentFromFolderJob : public AttachmentFromUrlBaseJob
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     /**
0021      * Creates a new job.
0022      *
0023      * @param url The url of the folder that will be compressed and added as attachment.
0024      * @param parent The parent object.
0025      */
0026 
0027     explicit AttachmentFromFolderJob(const QUrl &url = QUrl(), QObject *parent = nullptr);
0028 
0029     /**
0030      * Destroys the job.
0031      */
0032 
0033     ~AttachmentFromFolderJob() override;
0034 
0035     /**
0036      * Sets the @p compression method, either KZip::Deflate or KZip::NoCompression.
0037      */
0038     void setCompression(KZip::Compression compression);
0039 
0040     /**
0041      * Returns the compression method used
0042      */
0043     [[nodiscard]] KZip::Compression compression() const;
0044 
0045 protected Q_SLOTS:
0046     void doStart() override;
0047 
0048 private:
0049     //@cond PRIVATE
0050     class AttachmentLoadJobPrivate;
0051     std::unique_ptr<AttachmentLoadJobPrivate> const d;
0052 };
0053 }