1/*
2 * Copyright (c) 2009 Chani Armitage <chani@kde.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (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 Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef PLASMA_CONTAINMENTACTIONSPLUGINSCONFIG_H
21#define PLASMA_CONTAINMENTACTIONSPLUGINSCONFIG_H
22
23#include <plasma/plasma_export.h>
24
25#include <Qt>
26
27class QString;
28class QEvent;
29
30namespace Plasma
31{
32
33class ContainmentActionsPluginsConfigPrivate;
34
35/**
36 * @class ContainmentActionsPluginsConfig plasma/containmentactionspluginsconfig.h <Plasma/ContainmentActionsPluginsConfig>
37 *
38 * @short A class that holds a map of triggers to plugin names
39 * @since 4.4
40 */
41class PLASMA_EXPORT ContainmentActionsPluginsConfig
42{
43
44public:
45 ContainmentActionsPluginsConfig();
46 ContainmentActionsPluginsConfig(const ContainmentActionsPluginsConfig &other);
47 ~ContainmentActionsPluginsConfig();
48 ContainmentActionsPluginsConfig& operator=(const ContainmentActionsPluginsConfig &other);
49
50 /**
51 * clears everything
52 */
53 void clear();
54
55 /**
56 * removes @p trigger
57 * @see addPlugin for an explanation of the @p trigger
58 */
59 void remove(QEvent *trigger);
60
61 /**
62 * Sets @p trigger to plugin @p name
63 * if you're passing the trigger as an event, the following events are currently understood:
64 * -mouse press and release events: button and modifiers
65 * -mouse wheel events: direction and modifiers
66 * both traditional and graphicsscene events are supported.
67 */
68 void addPlugin(QEvent *trigger, const QString &name);
69
70 /**
71 * Sets trigger described by @p modifiers and @p button to plugin @p name
72 */
73 void addPlugin(Qt::KeyboardModifiers modifiers, Qt::MouseButton button, const QString &name);
74
75 /**
76 * Sets trigger described by @p modifiers and @p wheelDirection to plugin @p name
77 */
78 void addPlugin(Qt::KeyboardModifiers modifiers, Qt::Orientation wheelDirection, const QString &name);
79
80private:
81 ContainmentActionsPluginsConfigPrivate *const d;
82
83 friend class ContainmentActionsPluginsConfigPrivate;
84 friend class Containment;
85};
86
87} // namespace Plasma
88
89#endif
90
91