]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinpart_ext.h
Modernize: Use override where possible
[dolphin.git] / src / dolphinpart_ext.h
1 /* This file is part of the KDE project
2 * Copyright (c) 2012 Dawit Alemayehu <adawit@kde.org>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef DOLPHINPART_EXT_H
21 #define DOLPHINPART_EXT_H
22
23 #include <kparts/browserextension.h>
24 #include <kparts/fileinfoextension.h>
25 #include <kparts/listingfilterextension.h>
26 #include <kparts/listingnotificationextension.h>
27 #include <QUrl>
28
29 class DolphinPart;
30
31 class DolphinPartBrowserExtension : public KParts::BrowserExtension
32 {
33 Q_OBJECT
34 public:
35 DolphinPartBrowserExtension( DolphinPart* part );
36 void restoreState(QDataStream &stream) override;
37 void saveState(QDataStream &stream) override;
38
39 public Q_SLOTS:
40 void cut();
41 void copy();
42 void paste();
43 void pasteTo(const QUrl &);
44 void reparseConfiguration();
45
46 private:
47 DolphinPart* m_part;
48 };
49
50 class DolphinPartFileInfoExtension : public KParts::FileInfoExtension
51 {
52 Q_OBJECT
53
54 public:
55 DolphinPartFileInfoExtension(DolphinPart* part);
56
57 QueryModes supportedQueryModes() const override;
58 bool hasSelection() const override;
59
60 KFileItemList queryFor(QueryMode mode) const override;
61
62 private:
63 DolphinPart* m_part;
64 };
65
66 class DolphinPartListingFilterExtension : public KParts::ListingFilterExtension
67 {
68 Q_OBJECT
69
70 public:
71 DolphinPartListingFilterExtension(DolphinPart* part);
72 FilterModes supportedFilterModes() const override;
73 bool supportsMultipleFilters(FilterMode mode) const override;
74 QVariant filter(FilterMode mode) const override;
75 void setFilter(FilterMode mode, const QVariant& filter) override;
76
77 private:
78 DolphinPart* m_part;
79 };
80
81 class DolphinPartListingNotificationExtension : public KParts::ListingNotificationExtension
82 {
83 Q_OBJECT
84
85 public:
86 DolphinPartListingNotificationExtension(DolphinPart* part);
87 NotificationEventTypes supportedNotificationEventTypes() const override;
88
89 public Q_SLOTS:
90 void slotNewItems(const KFileItemList&);
91 void slotItemsDeleted(const KFileItemList&);
92 };
93
94 #endif