Changeset View
Changeset View
Standalone View
Standalone View
src/service/plugins/gtk-eventspy/GtkEventSpy.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2019 Méven Car (meven.car@kdemail.net) | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2 of | ||||
7 | * the License, or (at your option) any later version. | ||||
8 | * | ||||
9 | * This program 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 | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
16 | */ | ||||
17 | | ||||
18 | #ifndef PLUGINS_EVENT_SPY_PLUGIN_H | ||||
19 | #define PLUGINS_EVENT_SPY_PLUGIN_H | ||||
20 | | ||||
21 | #include <memory> | ||||
22 | #include <Plugin.h> | ||||
23 | | ||||
24 | #include <QStringList> | ||||
25 | | ||||
26 | class KDirWatch; | ||||
27 | | ||||
28 | class GtkEventSpyPlugin : public Plugin | ||||
29 | { | ||||
30 | Q_OBJECT | ||||
31 | | ||||
32 | public: | ||||
33 | explicit GtkEventSpyPlugin(QObject *parent = nullptr, | ||||
34 | const QVariantList &args = QVariantList()); | ||||
35 | ~GtkEventSpyPlugin() override; | ||||
36 | | ||||
37 | bool init(QHash<QString, QObject *> &modules) override; | ||||
38 | | ||||
39 | private Q_SLOTS: | ||||
40 | void fileUpdated(const QString &file); | ||||
41 | void addDocument(const QUrl &url, const QString &application); | ||||
42 | | ||||
43 | private: | ||||
44 | QObject *m_resources; | ||||
45 | std::unique_ptr<KDirWatch> m_dirWatcher; | ||||
46 | QDateTime m_lastUpdate; | ||||
47 | }; | ||||
48 | | ||||
49 | #endif // PLUGINS_EVENT_SPY_PLUGIN_H |