Warning, file /office/calligra/libs/flake/KoInputDeviceHandlerEvent.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  * Copyright (c) 2008 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Library General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Library General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #include "KoInputDeviceHandlerEvent.h"
0021 #include "KoPointerEvent.h"
0022 #include <QApplication>
0023 
0024 class Q_DECL_HIDDEN KoInputDeviceHandlerEvent::Private
0025 {
0026 public:
0027     Private()
0028             : button(Qt::NoButton), buttons(Qt::NoButton) {}
0029 
0030     KoInputDeviceHandlerEvent::Type type;
0031     Qt::MouseButton button;
0032     Qt::MouseButtons buttons;
0033 };
0034 
0035 KoInputDeviceHandlerEvent::KoInputDeviceHandlerEvent(Type type)
0036         : QInputEvent(static_cast<QEvent::Type>(type)), m_event(0), d(new Private())
0037 {
0038     modState = QApplication::keyboardModifiers();
0039 }
0040 
0041 KoInputDeviceHandlerEvent::~KoInputDeviceHandlerEvent()
0042 {
0043     delete m_event;
0044     delete d;
0045 }
0046 
0047 Qt::MouseButton KoInputDeviceHandlerEvent::button() const
0048 {
0049     return d->button;
0050 }
0051 
0052 Qt::MouseButtons KoInputDeviceHandlerEvent::buttons() const
0053 {
0054     return d->buttons;
0055 }
0056 
0057 void KoInputDeviceHandlerEvent::setButton(Qt::MouseButton b)
0058 {
0059     d->button = b;
0060 }
0061 
0062 void KoInputDeviceHandlerEvent::setButtons(Qt::MouseButtons b)
0063 {
0064     d->buttons = b;
0065 }