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 | |
6 | SPDX-License-Identifier: LGPL-2.0-or-later |
7 | */ |
8 | |
9 | #ifndef MKDIRJOB_H |
10 | #define MKDIRJOB_H |
11 | |
12 | #include "kiocore_export.h" |
13 | #include "simplejob.h" |
14 | |
15 | namespace KIO |
16 | { |
17 | class MkdirJobPrivate; |
18 | /*! |
19 | * \class KIO::MkdirJob |
20 | * \inheaderfile KIO/MkdirJob |
21 | * \inmodule KIOCore |
22 | * |
23 | * A KIO job that creates a directory |
24 | * \sa KIO::mkdir() |
25 | */ |
26 | class KIOCORE_EXPORT MkdirJob : public SimpleJob |
27 | { |
28 | Q_OBJECT |
29 | |
30 | public: |
31 | ~MkdirJob() override; |
32 | |
33 | Q_SIGNALS: |
34 | /*! |
35 | * Signals a redirection. |
36 | * Use to update the URL shown to the user. |
37 | * The redirection itself is handled internally. |
38 | * |
39 | * \a job the job that is redirected |
40 | * |
41 | * \a url the new url |
42 | */ |
43 | void redirection(KIO::Job *job, const QUrl &url); |
44 | |
45 | /*! |
46 | * Signals a permanent redirection. |
47 | * The redirection itself is handled internally. |
48 | * |
49 | * \a job the job that is redirected |
50 | * |
51 | * \a fromUrl the original URL |
52 | * |
53 | * \a toUrl the new URL |
54 | */ |
55 | void permanentRedirection(KIO::Job *job, const QUrl &fromUrl, const QUrl &toUrl); |
56 | |
57 | protected Q_SLOTS: |
58 | void slotFinished() override; |
59 | |
60 | protected: |
61 | KIOCORE_NO_EXPORT explicit MkdirJob(MkdirJobPrivate &dd); |
62 | |
63 | private: |
64 | Q_DECLARE_PRIVATE(MkdirJob) |
65 | }; |
66 | |
67 | /*! |
68 | * \relates KIO::MkdirJob |
69 | * |
70 | * Creates a single directory. |
71 | * |
72 | * \a url The URL of the directory to create. |
73 | * |
74 | * \a permissions The permissions to set after creating the |
75 | * directory (unix-style), -1 for default permissions. |
76 | * Returns a pointer to the job handling the operation. |
77 | */ |
78 | KIOCORE_EXPORT MkdirJob *mkdir(const QUrl &url, int permissions = -1); |
79 | |
80 | } |
81 | |
82 | #endif /* MKDIRJOB_H */ |
83 | |