1 | /* |
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2000 Stephan Kulow <coolo@kde.org> |
4 | SPDX-FileCopyrightText: 2000-2009 David Faure <faure@kde.org> |
5 | SPDX-FileCopyrightText: 2014 Mathias Tillman <master.homer@gmail.com> |
6 | |
7 | SPDX-License-Identifier: LGPL-2.0-or-later |
8 | */ |
9 | |
10 | #ifndef FILESYSTEMFREESPACEJOB_H |
11 | #define FILESYSTEMFREESPACEJOB_H |
12 | |
13 | #include "kiocore_export.h" |
14 | #include "simplejob.h" |
15 | |
16 | namespace KIO |
17 | { |
18 | class FileSystemFreeSpaceJobPrivate; |
19 | /** |
20 | * @class KIO::FileSystemFreeSpaceJob filesystemfreespacejob.h <KIO/FileSystemFreeSpaceJob> |
21 | * |
22 | * A KIO job that retrieves the total and available size of a filesystem. |
23 | * @since 5.3 |
24 | */ |
25 | class KIOCORE_EXPORT FileSystemFreeSpaceJob : public SimpleJob |
26 | { |
27 | Q_OBJECT |
28 | |
29 | public: |
30 | ~FileSystemFreeSpaceJob() override; |
31 | |
32 | /** |
33 | * Get total amount of space |
34 | * @since 6.0 |
35 | */ |
36 | KIO::filesize_t size() const; |
37 | |
38 | /** |
39 | * Get available amount of space |
40 | * @since 6.0 |
41 | */ |
42 | KIO::filesize_t availableSize() const; |
43 | |
44 | public: |
45 | KIOCORE_NO_EXPORT explicit FileSystemFreeSpaceJob(FileSystemFreeSpaceJobPrivate &dd); |
46 | |
47 | private: |
48 | void slotFinished() override; |
49 | Q_DECLARE_PRIVATE(FileSystemFreeSpaceJob) |
50 | }; |
51 | |
52 | /** |
53 | * Get a filesystem's total and available space. |
54 | * |
55 | * @param url Url to the filesystem. |
56 | * @return the job handling the operation. |
57 | */ |
58 | KIOCORE_EXPORT FileSystemFreeSpaceJob *fileSystemFreeSpace(const QUrl &url); |
59 | |
60 | } |
61 | |
62 | #endif /* FILESYSTEMFREESPACEJOB_H */ |
63 | |