KParts

listingnotificationextension.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 2012 Dawit Alemayehu <[email protected]>
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 
16 class KFileItemList;
17 
18 namespace KParts
19 {
20 class ReadOnlyPart;
21 class 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  */
36 class KPARTS_EXPORT ListingNotificationExtension : public QObject
37 {
38  Q_OBJECT
39 
40 public:
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 */
60  ~ListingNotificationExtension() override;
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 
75 Q_SIGNALS:
76  /**
77  * This signal is emitted when one of the notification events listed
78  * in @ref NotificationEventType occur.
79  */
81 
82 private:
83  std::unique_ptr<ListingNotificationExtension> const d;
84 };
85 
86 Q_DECLARE_OPERATORS_FOR_FLAGS(ListingNotificationExtension::NotificationEventTypes)
87 
88 }
89 
90 #endif /* KPARTS_LISTINGNOTIFICATIONEXTENSION_H */
NotificationEventType
Supported notification event types.
An extension for receiving listing change notification.
Base class for any "viewer" part.
Definition: readonlypart.h:51
The KParts namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 03:47:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.