KIO::JobUiDelegateExtension Class

class KIO::JobUiDelegateExtension
Header: #include <KIO/JobUiDelegateExtension>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KF6::KIOCore)
Since: 5.0
Inherited By:

KIO::JobUiDelegate

Public Types

enum ClipboardUpdaterMode { UpdateContent, OverwriteContent, RemoveContent }
enum ConfirmationType { DefaultConfirmation, ForceConfirmation }
enum DeletionType { Delete, Trash, EmptyTrash }

Public Functions

virtual bool askDeleteConfirmation(const QList<QUrl> &urls, KIO::JobUiDelegateExtension::DeletionType deletionType, KIO::JobUiDelegateExtension::ConfirmationType confirmationType) = 0
virtual KIO::ClipboardUpdater *createClipboardUpdater(KIO::Job *job, KIO::JobUiDelegateExtension::ClipboardUpdaterMode mode)
virtual void updateUrlInClipboard(const QUrl &src, const QUrl &dest)

Protected Functions

(since 5.0) KIO::JobUiDelegateExtension *defaultJobUiDelegateExtension()
(since 5.0) void setDefaultJobUiDelegateExtension(KIO::JobUiDelegateExtension *extension)

Detailed Description

An abstract class defining interaction with users from KIO jobs:

  • asking for confirmation before deleting files or directories

Member Type Documentation

enum JobUiDelegateExtension::ClipboardUpdaterMode

ConstantValue
KIO::JobUiDelegateExtension::UpdateContent0
KIO::JobUiDelegateExtension::OverwriteContent1
KIO::JobUiDelegateExtension::RemoveContent2

enum JobUiDelegateExtension::ConfirmationType

ForceConfirmation: always ask the user for confirmation DefaultConfirmation: don't ask the user if he/she said "don't ask again".

Used by askDeleteConfirmation.

ConstantValue
KIO::JobUiDelegateExtension::DefaultConfirmation0
KIO::JobUiDelegateExtension::ForceConfirmation1

enum JobUiDelegateExtension::DeletionType

The type of deletion: real deletion, moving the files to the trash or emptying the trash Used by askDeleteConfirmation.

ConstantValue
KIO::JobUiDelegateExtension::Delete0
KIO::JobUiDelegateExtension::Trash1
KIO::JobUiDelegateExtension::EmptyTrash2

Member Function Documentation

[protected] JobUiDelegateExtension::JobUiDelegateExtension()

Constructor

[pure virtual] bool JobUiDelegateExtension::askDeleteConfirmation(const QList<QUrl> &urls, KIO::JobUiDelegateExtension::DeletionType deletionType, KIO::JobUiDelegateExtension::ConfirmationType confirmationType)

Ask for confirmation before deleting/trashing urls.

Note that this method is not called automatically by KIO jobs. It's the application's responsibility to ask the user for confirmation before calling KIO::del() or KIO::trash().

urls the urls about to be deleted/trashed

deletionType the type of deletion (Delete for real deletion, Trash otherwise)

confirmationType see ConfirmationType. Normally set to DefaultConfirmation.

Note: the window passed to setWindow is used as the parent for the message box.

Returns true if confirmed

[virtual] KIO::ClipboardUpdater *JobUiDelegateExtension::createClipboardUpdater(KIO::Job *job, KIO::JobUiDelegateExtension::ClipboardUpdaterMode mode)

Creates a clipboard updater as a child of the given job.

[virtual] void JobUiDelegateExtension::updateUrlInClipboard(const QUrl &src, const QUrl &dest)

Update URL in clipboard, if present

Related Non-Members

[since 5.0] KIO::JobUiDelegateExtension *defaultJobUiDelegateExtension()

Returns the default job UI delegate extension to be used by all KIO jobs (in which HideProgressInfo is not set) Can return nullptr, if no kio GUI library is loaded.

This function was introduced in 5.0.

See also setDefaultJobUiDelegateExtension().

[since 5.0] void setDefaultJobUiDelegateExtension(KIO::JobUiDelegateExtension *extension)

Internal. Allows the KIO widgets library to register its widget-based job UI delegate extension automatically.

This function was introduced in 5.0.

See also defaultJobUiDelegateExtension().