1 /****************************************************************************
3 ** Copyright (C) 2007-2008 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"
32 class KConfigGroup {};
33 class VncClientThread;
36 class VncView: public RemoteView
41 explicit VncView(QWidget *parent = 0, const KUrl &url = KUrl(), RemoteView::Quality quality = RemoteView::Medium, int listen_port = 0);
44 QSize framebufferSize() const;
45 QSize sizeHint() const;
46 QSize minimumSizeHint() const;
47 bool isQuitting() const;
48 qreal zoomFactor() const { return m_horizontalFactor;} //assumes fixed aspect ratio
49 void reloadSettings();
51 bool supportsScaling() const;
52 bool supportsLocalCursor() const;
54 void setQuality(int q);
55 void setViewOnly(bool viewOnly);
56 void showDotCursor(DotCursorState state);
57 void useFastTransformations(bool enabled);
58 QPoint cursorPosition() const { return QPoint(m_cursor_x, m_cursor_y); }
59 void setDisplayOff(bool off) { m_display_off = off; }
62 void setZoomLevel(int level = -1); //'level' doesn't correspond to actual magnification, though mapping is done here
63 void sendKey(Qt::Key key);
64 void sendKeySequence(QKeySequence keys);
68 void paintEvent(QPaintEvent *event);
69 bool event(QEvent *event);
70 void resizeEvent(QResizeEvent *event);
71 bool eventFilter(QObject *obj, QEvent *event);
72 void inputMethodEvent(QInputMethodEvent *event);
75 void mouseEventHandler(QMouseEvent *event = 0);
77 void updateImage(int x, int y, int w, int h);
78 void setCut(const QString &text);
79 void requestPassword();
80 void outputErrorMessage(const QString &message);
81 void clipboardSelectionChanged();
82 void clipboardDataChanged();
85 VncClientThread *m_vncThread;
86 QClipboard *m_clipboard;
89 QMap<unsigned int, bool> m_mods;
90 int m_x, m_y, m_w, m_h;
91 int m_cursor_x, m_cursor_y;
93 bool m_firstPasswordTry;
94 bool m_dontSendClipboard;
95 qreal m_horizontalFactor;
96 qreal m_verticalFactor;
98 bool m_forceLocalCursor;
99 int m_left_zoom, m_right_zoom;
100 bool m_disable_tapping;
101 RemoteView::Quality m_quality;
103 Qt::TransformationMode m_transformation_mode;
106 void keyEventHandler(QKeyEvent *e);
107 void unpressModifiers();
108 void wheelEventHandler(QWheelEvent *event);