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"
28 #include "vncclientthread.h"
35 #include <rfb/rfbclient.h>
38 class VncView: public RemoteView
43 explicit VncView(QWidget *parent = 0, const KUrl &url = KUrl(), RemoteView::Quality quality = RemoteView::Medium);
46 QSize framebufferSize();
47 QSize sizeHint() const;
48 QSize minimumSizeHint() const;
52 bool supportsScaling() const;
53 bool supportsLocalCursor() const;
55 void setQuality(int q);
56 void setViewOnly(bool viewOnly);
57 void showDotCursor(DotCursorState state);
58 void sendKey(Qt::Key key);
60 virtual void updateConfiguration();
63 void enableScaling(bool scale);
64 void scaleResize(int w, int h);
65 void forceFullRepaint();
68 void paintEvent(QPaintEvent *event);
69 bool event(QEvent *event);
70 void resizeEvent(QResizeEvent *event);
71 bool eventFilter(QObject *obj, QEvent *event);
74 VncClientThread vncThread;
75 QClipboard *m_clipboard;
78 QMap<unsigned int, bool> m_mods;
79 int m_x, m_y, m_w, m_h;
80 int cursor_x, cursor_y;
83 bool m_firstPasswordTry;
84 bool m_authenticaionCanceled;
85 bool m_dontSendClipboard;
86 qreal m_horizontalFactor;
87 qreal m_verticalFactor;
89 bool m_forceLocalCursor;
90 bool force_full_repaint;
91 RemoteView::Quality quality;
93 void keyEventHandler(QKeyEvent *e);
94 void unpressModifiers();
95 void wheelEventHandler(QWheelEvent *event);
98 void mouseEventHandler(QMouseEvent *event = 0);
100 void updateImage(int x, int y, int w, int h);
101 void setCut(const QString &text);
102 void requestPassword();
103 void outputErrorMessage(const QString &message);
104 void clipboardSelectionChanged();
105 void clipboardDataChanged();