KIO

widgetsaskuseractionhandler.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2020 Ahmad Samir <a.samirh78@gmail.com>
4
5 SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef WIDGETSASKUSERACTIONHANDLER_H
9#define WIDGETSASKUSERACTIONHANDLER_H
10
11#include "kiowidgets_export.h"
12#include <kio/askuseractioninterface.h>
13#include <kio/global.h>
14#include <kio/jobuidelegateextension.h>
15#include <kio/renamedialog.h>
16#include <kio/skipdialog.h>
17
18namespace KIO
19{
20// TODO KF6: Handle this the same way we end up handling WidgetsUntrustedProgramHandler.
21
22/**
23 * @class KIO::WidgetsAskUserActionHandler widgetsaskuseractionhandler.h <KIO/WidgetsAskUserActionHandler>
24 *
25 * This implements KIO::AskUserActionInterface.
26 * @see KIO::AskUserActionInterface()
27 *
28 * @sa KIO::JobUiDelegateExtension()
29 *
30 * @since 5.78
31 * @note This header wasn't installed until 5.98
32 */
33
34class WidgetsAskUserActionHandlerPrivate;
35
36class KIOWIDGETS_EXPORT WidgetsAskUserActionHandler : public AskUserActionInterface
37{
39public:
40 explicit WidgetsAskUserActionHandler(QObject *parent = nullptr);
41
42 ~WidgetsAskUserActionHandler() override;
43
44 /**
45 * @copydoc KIO::AskUserActionInterface::askUserRename()
46 */
47 void askUserRename(KJob *job,
48 const QString &title,
49 const QUrl &src,
50 const QUrl &dest,
52 KIO::filesize_t sizeSrc = KIO::filesize_t(-1),
53 KIO::filesize_t sizeDest = KIO::filesize_t(-1),
54 const QDateTime &ctimeSrc = {},
55 const QDateTime &ctimeDest = {},
56 const QDateTime &mtimeSrc = {},
57 const QDateTime &mtimeDest = {}) override;
58
59 /**
60 * @copydoc KIO::AskUserActionInterface::askUserSkip()
61 */
62 void askUserSkip(KJob *job, KIO::SkipDialog_Options options, const QString &error_text) override;
63
64 /**
65 * @copydoc KIO::AskUserActionInterface::askUserDelete()
66 */
67 void askUserDelete(const QList<QUrl> &urls, DeletionType deletionType, ConfirmationType confirmationType, QWidget *parent = nullptr) override;
68
69 /**
70 * @copydoc KIO::AskUserActionInterface::requestUserMessageBox()
71 */
73 const QString &text,
74 const QString &title,
75 const QString &primaryActionText,
76 const QString &secondaryActionText,
77 const QString &primaryActionIconName = {},
78 const QString &secondaryActionIconName = {},
79 const QString &dontAskAgainName = {},
80 const QString &details = {},
81 QWidget *parent = nullptr) override;
82
83 void askIgnoreSslErrors(const QVariantMap &sslErrorData, QWidget *parent) override;
84
85 void setWindow(QWidget *window);
86
87private:
88 void showSslDetails(const QVariantMap &sslErrorData, QWidget *parentWidget);
89 std::unique_ptr<WidgetsAskUserActionHandlerPrivate> d;
90};
91
92} // namespace KIO
93
94#endif // WIDGETSASKUSERACTIONHANDLER_H
AskUserActionInterface(QObject *parent=nullptr)
Constructor.
ConfirmationType
Deletion confirmation type.
void askUserSkip(KJob *job, KIO::SkipDialog_Options options, const QString &error_text) override
You need to connect to the askUserSkipResult signal to get the dialog's result.
void askUserDelete(const QList< QUrl > &urls, DeletionType deletionType, ConfirmationType confirmationType, QWidget *parent=nullptr) override
Ask for confirmation before moving urls (files/directories) to the Trash, emptying the Trash,...
void requestUserMessageBox(MessageDialogType type, const QString &text, const QString &title, const QString &primaryActionText, const QString &secondaryActionText, const QString &primaryActionIconName={}, const QString &secondaryActionIconName={}, const QString &dontAskAgainName={}, const QString &details={}, QWidget *parent=nullptr) override
This function allows for the delegation of user prompts from the KIO worker.
void askUserRename(KJob *job, const QString &title, const QUrl &src, const QUrl &dest, KIO::RenameDialog_Options options, KIO::filesize_t sizeSrc=KIO::filesize_t(-1), KIO::filesize_t sizeDest=KIO::filesize_t(-1), const QDateTime &ctimeSrc={}, const QDateTime &ctimeDest={}, const QDateTime &mtimeSrc={}, const QDateTime &mtimeDest={}) override
Constructs a modal, parent-less "rename" dialog, to prompt the user for a decision in case of conflic...
A namespace for KIO globals.
QFlags< RenameDialog_Option > RenameDialog_Options
Stores a combination of RenameDialog_Option values.
QFlags< SkipDialog_Option > SkipDialog_Options
Stores a combination of SkipDialog_Option values.
qulonglong filesize_t
64-bit file size
Definition global.h:35
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:49:37 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.