]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinpart_ext.h
Fix selection rect after porting from QFontMetrics::width()
[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
28 #include <QUrl>
29
30 class DolphinPart;
31
32 class DolphinPartBrowserExtension : public KParts::BrowserExtension
33 {
34 Q_OBJECT
35 public:
36 explicit DolphinPartBrowserExtension( DolphinPart* part );
37 void restoreState(QDataStream &stream) override;
38 void saveState(QDataStream &stream) override;
39
40 public Q_SLOTS:
41 void cut();
42 void copy();
43 void paste();
44 void pasteTo(const QUrl &);
45 void reparseConfiguration();
46
47 private:
48 DolphinPart* m_part;
49 };
50
51 class DolphinPartFileInfoExtension : public KParts::FileInfoExtension
52 {
53 Q_OBJECT
54
55 public:
56 explicit DolphinPartFileInfoExtension(DolphinPart* part);
57
58 QueryModes supportedQueryModes() const override;
59 bool hasSelection() const override;
60
61 KFileItemList queryFor(QueryMode mode) const override;
62
63 private:
64 DolphinPart* m_part;
65 };
66
67 class DolphinPartListingFilterExtension : public KParts::ListingFilterExtension
68 {
69 Q_OBJECT
70
71 public:
72 explicit DolphinPartListingFilterExtension(DolphinPart* part);
73 FilterModes supportedFilterModes() const override;
74 bool supportsMultipleFilters(FilterMode mode) const override;
75 QVariant filter(FilterMode mode) const override;
76 void setFilter(FilterMode mode, const QVariant& filter) override;
77
78 private:
79 DolphinPart* m_part;
80 };
81
82 class DolphinPartListingNotificationExtension : public KParts::ListingNotificationExtension
83 {
84 Q_OBJECT
85
86 public:
87 explicit DolphinPartListingNotificationExtension(DolphinPart* part);
88 NotificationEventTypes supportedNotificationEventTypes() const override;
89
90 public Q_SLOTS:
91 void slotNewItems(const KFileItemList&);
92 void slotItemsDeleted(const KFileItemList&);
93 };
94
95 #endif