KParts

listingnotificationextension.h
1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2012 Dawit Alemayehu <adawit@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KPARTS_LISTINGNOTIFICATIONEXTENSION_H
9#define KPARTS_LISTINGNOTIFICATIONEXTENSION_H
10
11#include <kparts/kparts_export.h>
12
13#include <QObject>
14#include <memory>
15
16class KFileItemList;
17
18namespace KParts
19{
20class ReadOnlyPart;
21class ListingNotificationExtensionPrivate;
22
23/**
24 * @class ListingNotificationExtension listingnotificationextension.h <KParts/ListingNotificationExtension>
25 *
26 * @short An extension for receiving listing change notification.
27 *
28 * This extension is intended for implementation by parts that provide listing
29 * services, e.g. file management and is intended to notify about changes to
30 * a given listing. For example, if file management part implemented this extension
31 * it would emit @ref itemsDeleted and @ref itemsAdded signal whenever new files
32 * or folders are deleted and added to a directory respectively.
33 *
34 * @since 4.9.2
35 */
36class KPARTS_EXPORT ListingNotificationExtension : public QObject
37{
38 Q_OBJECT
39
40public:
41 /**
42 * Supported notification event types.
43 * @see NotificationEventTypes
44 */
46 None = 0x00,
47 ItemsAdded = 0x01, /*!< New items added to the listing. */
48 ItemsDeleted = 0x02, /*!< Items deleted from the listing. */
49 };
50
51 /**
52 * Stores a combination of #NotificationEventType values.
53 */
55
56 /*! Constructor */
58
59 /*! Destructor */
61
62 /**
63 * Returns the OR'ed value of the notification types supported by the part
64 * that implements this extension.
65 *
66 * By default this function returns None.
67 */
68 virtual NotificationEventTypes supportedNotificationEventTypes() const;
69
70 /**
71 * Queries @p obj for a child object which inherits from this class.
72 */
73 static ListingNotificationExtension *childObject(QObject *obj);
74
75Q_SIGNALS:
76 /**
77 * This signal is emitted when one of the notification events listed
78 * in @ref NotificationEventType occur.
79 */
81
82private:
83 std::unique_ptr<ListingNotificationExtension> const d;
84};
85
87
88}
89
90#endif /* KPARTS_LISTINGNOTIFICATIONEXTENSION_H */
An extension for receiving listing change notification.
void listingEvent(KParts::ListingNotificationExtension::NotificationEventType, const KFileItemList &)
This signal is emitted when one of the notification events listed in NotificationEventType occur.
NotificationEventType
Supported notification event types.
Base class for any "viewer" part.
The KParts namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:42:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.