File indexing completed on 2024-10-06 03:39:25

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2000 Stephan Kulow <coolo@kde.org>
0004     SPDX-FileCopyrightText: 2000-2009 David Faure <faure@kde.org>
0005     SPDX-FileCopyrightText: 2014 Mathias Tillman <master.homer@gmail.com>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #ifndef FILESYSTEMFREESPACEJOB_H
0011 #define FILESYSTEMFREESPACEJOB_H
0012 
0013 #include "kiocore_export.h"
0014 #include "simplejob.h"
0015 
0016 namespace KIO
0017 {
0018 class FileSystemFreeSpaceJobPrivate;
0019 /**
0020  * @class KIO::FileSystemFreeSpaceJob filesystemfreespacejob.h <KIO/FileSystemFreeSpaceJob>
0021  *
0022  * A KIO job that retrieves the total and available size of a filesystem.
0023  * @since 5.3
0024  */
0025 class KIOCORE_EXPORT FileSystemFreeSpaceJob : public SimpleJob
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     ~FileSystemFreeSpaceJob() override;
0031 
0032     /**
0033      * Get total amount of space
0034      * @since 6.0
0035      */
0036     KIO::filesize_t size() const;
0037 
0038     /**
0039      * Get available amount of space
0040      * @since 6.0
0041      */
0042     KIO::filesize_t availableSize() const;
0043 
0044 public:
0045     KIOCORE_NO_EXPORT explicit FileSystemFreeSpaceJob(FileSystemFreeSpaceJobPrivate &dd);
0046 
0047 private:
0048     void slotFinished() override;
0049     Q_DECLARE_PRIVATE(FileSystemFreeSpaceJob)
0050 };
0051 
0052 /**
0053  * Get a filesystem's total and available space.
0054  *
0055  * @param url Url to the filesystem.
0056  * @return the job handling the operation.
0057  */
0058 KIOCORE_EXPORT FileSystemFreeSpaceJob *fileSystemFreeSpace(const QUrl &url);
0059 
0060 }
0061 
0062 #endif /* FILESYSTEMFREESPACEJOB_H */