KIO

kdirlister.h
1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org>
4 SPDX-FileCopyrightText: 2001, 2002, 2004-2006 Michael Brade <brade@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef kdirlister_h
10#define kdirlister_h
11
12#include "kiowidgets_export.h"
13#include <kcoredirlister.h>
14
15class QWidget;
16class KDirListerPrivate;
17
18/**
19 * @class KDirLister kdirlister.h <KDirLister>
20 *
21 * Subclass of KCoreDirLister which uses QWidgets to show error messages
22 * and to associate jobs with windows.
23 */
24class KIOWIDGETS_EXPORT KDirLister : public KCoreDirLister
25{
26 Q_OBJECT
27
28public:
29 /**
30 * Create a directory lister.
31 */
32 explicit KDirLister(QObject *parent = nullptr);
33
34 /**
35 * Destroy the directory lister.
36 */
37 ~KDirLister() override;
38
39 /**
40 * Check whether auto error handling is enabled.
41 * If enabled, it will show an error dialog to the user when an
42 * error occurs. It is turned on by default.
43 * @return true if auto error handling is enabled, false otherwise
44 * @see setAutoErrorHandlingEnabled()
45 */
46 bool autoErrorHandlingEnabled() const; // KF6 remove, already provided by KCoreDirLister
47
48 /**
49 * Pass the main window this object is associated with
50 * this is used for caching authentication data
51 * @param window the window to associate with, @c nullptr to disassociate
52 */
53 void setMainWindow(QWidget *window);
54
55 /**
56 * Returns the main window associated with this object.
57 * @return the associated main window, or @c nullptr if there is none
58 */
59 QWidget *mainWindow();
60
61protected:
62 /**
63 * Reimplemented to associate a window with new jobs
64 * @reimp
65 */
66 void jobStarted(KIO::ListJob *) override;
67
68private:
69 friend class KDirListerPrivate;
70 std::unique_ptr<KDirListerPrivate> d;
71};
72
73#endif
Helper class for the kiojob used to list and update a directory.
virtual void jobStarted(KIO::ListJob *)
Reimplemented by KDirLister to associate windows with jobs.
Subclass of KCoreDirLister which uses QWidgets to show error messages and to associate jobs with wind...
Definition kdirlister.h:25
A ListJob is allows you to get the get the content of a directory.
Definition listjob.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:52 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.