1 /****************************************************************************
3 ** Copyright (C) 2007-2012 Urs Wolfer <uwolfer @ kde.org>
5 ** This file is part of KDE.
7 ** This program is free software; you can redistribute it and/or modify
8 ** it under the terms of the GNU General Public License as published by
9 ** the Free Software Foundation; either version 2 of the License, or
10 ** (at your option) any later version.
12 ** This program is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ** GNU General Public License for more details.
17 ** You should have received a copy of the GNU General Public License
18 ** along with this program; see the file COPYING. If not, write to
19 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 ** Boston, MA 02110-1301, USA.
22 ****************************************************************************/
27 #include "remoteview.h"
28 #include "vncclientthread.h"
33 #include "vnchostpreferences.h"
39 #include <rfb/rfbclient.h>
42 class VncView: public RemoteView
47 explicit VncView(QWidget *parent = 0, const KUrl &url = KUrl(), KConfigGroup configGroup = KConfigGroup());
50 QSize framebufferSize();
51 QSize sizeHint() const;
52 QSize minimumSizeHint() const;
56 bool supportsScaling() const;
57 bool supportsLocalCursor() const;
60 HostPreferences* hostPreferences();
63 void setViewOnly(bool viewOnly);
64 void showDotCursor(DotCursorState state);
65 void enableScaling(bool scale);
67 virtual void updateConfiguration();
70 void scaleResize(int w, int h);
73 void paintEvent(QPaintEvent *event);
74 bool event(QEvent *event);
75 void resizeEvent(QResizeEvent *event);
76 bool eventFilter(QObject *obj, QEvent *event);
79 VncClientThread vncThread;
80 QClipboard *m_clipboard;
83 QMap<unsigned int, bool> m_mods;
84 int m_x, m_y, m_w, m_h;
87 bool m_firstPasswordTry;
88 bool m_dontSendClipboard;
89 qreal m_horizontalFactor;
90 qreal m_verticalFactor;
92 VncHostPreferences *m_hostPreferences;
95 bool m_forceLocalCursor;
97 void keyEventHandler(QKeyEvent *e);
98 void unpressModifiers();
99 void wheelEventHandler(QWheelEvent *event);
100 void mouseEventHandler(QMouseEvent *event);
103 void updateImage(int x, int y, int w, int h);
104 void setCut(const QString &text);
105 void requestPassword();
106 void outputErrorMessage(const QString &message);
107 void clipboardDataChanged();