File indexing completed on 2024-04-21 04:58:40

0001 /*
0002    This file is part of the KDE project
0003 
0004    Copyright (C) 2010 Collabora Ltd.
0005      @author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
0006    Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
0007    Copyright (C) 2001-2003 by Tim Jansen <tim@tjansen.de>
0008 
0009    This program is free software; you can redistribute it and/or
0010    modify it under the terms of the GNU General Public
0011    License as published by the Free Software Foundation; either
0012    version 2 of the License, or (at your option) any later version.
0013 
0014    This program is distributed in the hope that it will be useful,
0015    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017    General Public License for more details.
0018 
0019    You should have received a copy of the GNU General Public License
0020    along with this program; see the file COPYING.  If not, write to
0021    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0022    Boston, MA 02110-1301, USA.
0023 */
0024 
0025 #ifndef EVENTS_H
0026 #define EVENTS_H
0027 
0028 #include "framebuffer.h"
0029 #include "rfb.h"
0030 #include "krfbprivate_export.h"
0031 
0032 #include <QObject>
0033 
0034 class KRFBPRIVATE_EXPORT EventHandler : public QObject
0035 {
0036     Q_OBJECT
0037 public:
0038     explicit EventHandler(QObject *parent = nullptr);
0039     ~EventHandler() override = default;
0040     virtual void handleKeyboard(bool down, rfbKeySym key) = 0;
0041     virtual void handlePointer(int buttonMask, int x, int y) = 0;
0042 
0043     void setFrameBufferPlugin(const QSharedPointer<FrameBuffer> &frameBuffer);
0044     QSharedPointer<FrameBuffer> frameBuffer();
0045 private:
0046     // Used to track framebuffer plugin which we need for xdp event plugin
0047     QSharedPointer<FrameBuffer> fb;
0048 };
0049 
0050 #endif