Warning, file /office/calligra/libs/flake/KoInputDeviceHandlerEvent.h 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 #ifndef KOINPUTDEVICEHANDLEREVENT_H
0021 #define KOINPUTDEVICEHANDLEREVENT_H
0022 
0023 #include "flake_export.h"
0024 
0025 #include <QInputEvent>
0026 
0027 class KoPointerEvent;
0028 
0029 /**
0030  * Base class for events from custom input devices.
0031  */
0032 class FLAKE_EXPORT KoInputDeviceHandlerEvent : public QInputEvent
0033 {
0034 public:
0035     enum Type {
0036         ButtonPressed = QEvent::User + 2008,  ///< a button was pressed
0037         ButtonReleased, ///< a button was released
0038         PositionChanged   ///< the position has changed
0039     };
0040 
0041     /// Constructs a new device event of the given type
0042     explicit KoInputDeviceHandlerEvent(Type type);
0043 
0044     ~KoInputDeviceHandlerEvent() override;
0045 
0046     /// Creates and returns a KoPointerEvent for tools to consume
0047     virtual KoPointerEvent * pointerEvent() = 0;
0048 
0049     /// The device button which caused the event, Qt::NoButton if it is a move event
0050     Qt::MouseButton button() const;
0051     /// The device button state when the event was generated
0052     Qt::MouseButtons buttons() const;
0053 
0054     /// Sets the device button causing the event
0055     void setButton(Qt::MouseButton);
0056     /// Sets the device button state
0057     void setButtons(Qt::MouseButtons);
0058 
0059 protected:
0060     KoPointerEvent *m_event;
0061 
0062 private:
0063     class Private;
0064     Private * const d;
0065 };
0066 
0067 #endif // KOINPUTDEVICEHANDLEREVENT_H