• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • sources
  • kde-4.12
  • kdelibs
  • plasma
containmentactionspluginsconfig.cpp
Go to the documentation of this file.
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 #include "containmentactionspluginsconfig.h"
21 #include "private/containmentactionspluginsconfig_p.h"
22 
23 #include <QHash>
24 #include <QEvent>
25 #include <QGraphicsSceneMouseEvent>
26 #include <QGraphicsSceneWheelEvent>
27 #include <QString>
28 
29 #include <kdebug.h>
30 
31 #include "containmentactions.h"
32 
33 using namespace Plasma;
34 
35 namespace Plasma
36 {
37 
38 ContainmentActionsPluginsConfig::ContainmentActionsPluginsConfig()
39  : d(new ContainmentActionsPluginsConfigPrivate(this))
40 {
41 }
42 
43 ContainmentActionsPluginsConfig::ContainmentActionsPluginsConfig(const ContainmentActionsPluginsConfig &other)
44  : d(new ContainmentActionsPluginsConfigPrivate(this))
45 {
46  d->plugins = other.d->plugins;
47 }
48 
49 ContainmentActionsPluginsConfig& ContainmentActionsPluginsConfig::operator=(const ContainmentActionsPluginsConfig &other)
50 {
51  d->plugins = other.d->plugins;
52  return *this;
53 }
54 
55 ContainmentActionsPluginsConfig::~ContainmentActionsPluginsConfig()
56 {
57  delete d;
58 }
59 
60 void ContainmentActionsPluginsConfig::clear()
61 {
62  d->plugins.clear();
63 }
64 
65 void ContainmentActionsPluginsConfig::remove(QEvent *trigger)
66 {
67  QString s = ContainmentActions::eventToString(trigger);
68  d->plugins.remove(s);
69 }
70 
71 void ContainmentActionsPluginsConfig::addPlugin(QEvent *trigger, const QString &name)
72 {
73  QString s = ContainmentActions::eventToString(trigger);
74  d->plugins.insert(s, name);
75 }
76 
77 void ContainmentActionsPluginsConfig::addPlugin(Qt::KeyboardModifiers modifiers, Qt::MouseButton button, const QString &name)
78 {
79  QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
80  event.setButton(button);
81  event.setModifiers(modifiers);
82  QString s = ContainmentActions::eventToString(&event);
83  d->plugins.insert(s, name);
84 }
85 
86 void ContainmentActionsPluginsConfig::addPlugin(Qt::KeyboardModifiers modifiers, Qt::Orientation wheelDirection, const QString &name)
87 {
88  QGraphicsSceneWheelEvent event(QEvent::GraphicsSceneWheel);
89  event.setOrientation(wheelDirection);
90  event.setModifiers(modifiers);
91  QString s = ContainmentActions::eventToString(&event);
92  d->plugins.insert(s, name);
93 }
94 
95 } // namespace Plasma
96 
Plasma::ContainmentActionsPluginsConfig::remove
void remove(QEvent *trigger)
removes trigger
Definition: containmentactionspluginsconfig.cpp:65
Plasma::ContainmentActionsPluginsConfig::operator=
ContainmentActionsPluginsConfig & operator=(const ContainmentActionsPluginsConfig &other)
Definition: containmentactionspluginsconfig.cpp:49
Plasma::ContainmentActionsPluginsConfig::addPlugin
void addPlugin(QEvent *trigger, const QString &name)
Sets trigger to plugin name if you're passing the trigger as an event, the following events are curre...
Definition: containmentactionspluginsconfig.cpp:71
Plasma::ContainmentActions::eventToString
static QString eventToString(QEvent *event)
Turns a mouse or wheel event into a string suitable for a ContainmentActions.
Definition: containmentactions.cpp:225
containmentactions.h
containmentactionspluginsconfig.h
Plasma::ContainmentActionsPluginsConfig::ContainmentActionsPluginsConfig
ContainmentActionsPluginsConfig()
Definition: containmentactionspluginsconfig.cpp:38
Plasma::ContainmentActionsPluginsConfig
A class that holds a map of triggers to plugin names.
Definition: containmentactionspluginsconfig.h:41
Plasma::ContainmentActionsPluginsConfig::clear
void clear()
clears everything
Definition: containmentactionspluginsconfig.cpp:60
Plasma::ContainmentActionsPluginsConfig::~ContainmentActionsPluginsConfig
~ContainmentActionsPluginsConfig()
Definition: containmentactionspluginsconfig.cpp:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal