Changeset View
Changeset View
Standalone View
Standalone View
krfb/eventsmanager.h
- This file was added.
1 | /* This file is part of the KDE project | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk> | ||||
3 | @author George Goldberg <george.goldberg@collabora.co.uk> | ||||
4 | | ||||
5 | This program is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU General Public | ||||
7 | License as published by the Free Software Foundation; either | ||||
8 | version 2 of the License, or (at your option) any later version. | ||||
9 | | ||||
10 | This program is distributed in the hope that it will be useful, | ||||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
13 | General Public License for more details. | ||||
14 | | ||||
15 | You should have received a copy of the GNU General Public License | ||||
16 | along with this program; see the file COPYING. If not, write to | ||||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
18 | Boston, MA 02110-1301, USA. | ||||
19 | */ | ||||
20 | | ||||
21 | #ifndef KRFB_EVENTSMANAGER_H | ||||
22 | #define KRFB_EVENTSMANAGER_H | ||||
23 | | ||||
24 | #include "events.h" | ||||
25 | | ||||
26 | #include "krfbprivate_export.h" | ||||
27 | | ||||
28 | #include <QtCore/QMap> | ||||
29 | #include <QtCore/QObject> | ||||
30 | #include <QtCore/QSharedPointer> | ||||
31 | #include <QtCore/QWeakPointer> | ||||
32 | | ||||
33 | #include <QWidget> | ||||
34 | | ||||
35 | class EventsPlugin; | ||||
36 | class KPluginFactory; | ||||
37 | | ||||
38 | class KRFBPRIVATE_EXPORT EventsManager : public QObject | ||||
39 | { | ||||
40 | Q_OBJECT | ||||
41 | friend class EventsManagerStatic; | ||||
42 | | ||||
43 | public: | ||||
44 | static EventsManager *instance(); | ||||
45 | | ||||
46 | virtual ~EventsManager(); | ||||
47 | | ||||
48 | QSharedPointer<EventHandler> eventHandler(); | ||||
49 | | ||||
50 | private: | ||||
51 | Q_DISABLE_COPY(EventsManager) | ||||
52 | | ||||
53 | EventsManager(); | ||||
54 | | ||||
55 | void loadPlugins(); | ||||
56 | | ||||
57 | QMap<QString, EventsPlugin *> m_plugins; | ||||
58 | QList<QWeakPointer<EventHandler> > m_eventHandlers; | ||||
59 | }; | ||||
60 | | ||||
61 | | ||||
62 | #endif // Header guard |