• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

krdc

  • sources
  • kde-4.12
  • kdenetwork
  • krdc
  • vnc
vncview.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2007 - 2013 Urs Wolfer <uwolfer @ kde.org>
4 **
5 ** This file is part of KDE.
6 **
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.
11 **
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.
16 **
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.
21 **
22 ****************************************************************************/
23 
24 #include "vncview.h"
25 
26 #include <QApplication>
27 #include <QImage>
28 #include <QPainter>
29 #include <QMouseEvent>
30 
31 #ifdef QTONLY
32  #include <QMessageBox>
33  #include <QInputDialog>
34  #define KMessageBox QMessageBox
35  #define error(parent, message, caption) \
36  critical(parent, caption, message)
37 #else
38  #include "settings.h"
39  #include <KActionCollection>
40  #include <KMainWindow>
41  #include <KMessageBox>
42  #include <KPasswordDialog>
43  #include <KXMLGUIClient>
44 #endif
45 
46 // Definition of key modifier mask constants
47 #define KMOD_Alt_R 0x01
48 #define KMOD_Alt_L 0x02
49 #define KMOD_Meta_L 0x04
50 #define KMOD_Control_L 0x08
51 #define KMOD_Shift_L 0x10
52 
53 VncView::VncView(QWidget *parent, const KUrl &url, KConfigGroup configGroup)
54  : RemoteView(parent),
55  m_initDone(false),
56  m_buttonMask(0),
57  m_repaint(false),
58  m_quitFlag(false),
59  m_firstPasswordTry(true),
60  m_dontSendClipboard(false),
61  m_horizontalFactor(1.0),
62  m_verticalFactor(1.0),
63  m_forceLocalCursor(false)
64 {
65  m_url = url;
66  m_host = url.host();
67  m_port = url.port();
68 
69  // BlockingQueuedConnection can cause deadlocks when exiting, handled in startQuitting()
70  connect(&vncThread, SIGNAL(imageUpdated(int,int,int,int)), this, SLOT(updateImage(int,int,int,int)), Qt::BlockingQueuedConnection);
71  connect(&vncThread, SIGNAL(gotCut(QString)), this, SLOT(setCut(QString)), Qt::BlockingQueuedConnection);
72  connect(&vncThread, SIGNAL(passwordRequest(bool)), this, SLOT(requestPassword(bool)), Qt::BlockingQueuedConnection);
73  connect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString)));
74 
75  m_clipboard = QApplication::clipboard();
76  connect(m_clipboard, SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
77 
78 #ifndef QTONLY
79  m_hostPreferences = new VncHostPreferences(configGroup, this);
80 #else
81  Q_UNUSED(configGroup);
82 #endif
83 }
84 
85 VncView::~VncView()
86 {
87  if (!m_quitFlag) startQuitting();
88 }
89 
90 bool VncView::eventFilter(QObject *obj, QEvent *event)
91 {
92  if (m_viewOnly) {
93  if (event->type() == QEvent::KeyPress ||
94  event->type() == QEvent::KeyRelease ||
95  event->type() == QEvent::MouseButtonDblClick ||
96  event->type() == QEvent::MouseButtonPress ||
97  event->type() == QEvent::MouseButtonRelease ||
98  event->type() == QEvent::Wheel ||
99  event->type() == QEvent::MouseMove)
100  return true;
101  }
102 
103  return RemoteView::eventFilter(obj, event);
104 }
105 
106 QSize VncView::framebufferSize()
107 {
108  return m_frame.size();
109 }
110 
111 QSize VncView::sizeHint() const
112 {
113  return size();
114 }
115 
116 QSize VncView::minimumSizeHint() const
117 {
118  return size();
119 }
120 
121 void VncView::scaleResize(int w, int h)
122 {
123  RemoteView::scaleResize(w, h);
124 
125  kDebug(5011) << w << h;
126  if (m_scale) {
127  m_verticalFactor = (qreal) h / m_frame.height();
128  m_horizontalFactor = (qreal) w / m_frame.width();
129 
130 #ifndef QTONLY
131  if (Settings::keepAspectRatio()) {
132  m_verticalFactor = m_horizontalFactor = qMin(m_verticalFactor, m_horizontalFactor);
133  }
134 #else
135  m_verticalFactor = m_horizontalFactor = qMin(m_verticalFactor, m_horizontalFactor);
136 #endif
137 
138  const qreal newW = m_frame.width() * m_horizontalFactor;
139  const qreal newH = m_frame.height() * m_verticalFactor;
140  setMaximumSize(newW, newH); //This is a hack to force Qt to center the view in the scroll area
141  resize(newW, newH);
142  }
143 }
144 
145 void VncView::updateConfiguration()
146 {
147  RemoteView::updateConfiguration();
148 
149  // Update the scaling mode in case KeepAspectRatio changed
150  scaleResize(parentWidget()->width(), parentWidget()->height());
151 }
152 
153 void VncView::startQuitting()
154 {
155  kDebug(5011) << "about to quit";
156 
157  setStatus(Disconnecting);
158 
159  m_quitFlag = true;
160 
161  vncThread.stop();
162 
163  unpressModifiers();
164 
165  // Disconnect all signals so that we don't get any more callbacks from the client thread
166  vncThread.disconnect();
167 
168  vncThread.quit();
169 
170  const bool quitSuccess = vncThread.wait(500);
171  if (!quitSuccess) {
172  // happens when vncThread wants to call a slot via BlockingQueuedConnection,
173  // needs an event loop in this thread so execution continues after 'emit'
174  QEventLoop loop;
175  if (!loop.processEvents()) {
176  kDebug(5011) << "BUG: deadlocked, but no events to deliver?";
177  }
178  vncThread.wait(500);
179  }
180 
181  kDebug(5011) << "Quit VNC thread success:" << quitSuccess;
182 
183  setStatus(Disconnected);
184 }
185 
186 bool VncView::isQuitting()
187 {
188  return m_quitFlag;
189 }
190 
191 bool VncView::start()
192 {
193  vncThread.setHost(m_host);
194  vncThread.setPort(m_port);
195  RemoteView::Quality quality;
196 #ifdef QTONLY
197  quality = (RemoteView::Quality)((QCoreApplication::arguments().count() > 2) ?
198  QCoreApplication::arguments().at(2).toInt() : 2);
199 #else
200  quality = m_hostPreferences->quality();
201 #endif
202 
203  vncThread.setQuality(quality);
204 
205  // set local cursor on by default because low quality mostly means slow internet connection
206  if (quality == RemoteView::Low) {
207  showDotCursor(RemoteView::CursorOn);
208 #ifndef QTONLY
209  // KRDC does always just have one main window, so at(0) is safe
210  KXMLGUIClient *mainWindow = dynamic_cast<KXMLGUIClient*>(KMainWindow::memberList().at(0));
211  if (mainWindow)
212  mainWindow->actionCollection()->action("show_local_cursor")->setChecked(true);
213 #endif
214  }
215 
216  setStatus(Connecting);
217 
218  vncThread.start();
219  return true;
220 }
221 
222 bool VncView::supportsScaling() const
223 {
224  return true;
225 }
226 
227 bool VncView::supportsLocalCursor() const
228 {
229  return true;
230 }
231 
232 void VncView::requestPassword(bool includingUsername)
233 {
234  kDebug(5011) << "request password";
235 
236  setStatus(Authenticating);
237 
238  if (m_firstPasswordTry && !m_url.userName().isNull()) {
239  vncThread.setUsername(m_url.userName());
240  }
241 
242 #ifndef QTONLY
243  // just try to get the passwort from the wallet the first time, otherwise it will loop (see issue #226283)
244  if (m_firstPasswordTry && m_hostPreferences->walletSupport()) {
245  QString walletPassword = readWalletPassword();
246 
247  if (!walletPassword.isNull()) {
248  vncThread.setPassword(walletPassword);
249  m_firstPasswordTry = false;
250  return;
251  }
252  }
253 #endif
254 
255  if (m_firstPasswordTry && !m_url.password().isNull()) {
256  vncThread.setPassword(m_url.password());
257  m_firstPasswordTry = false;
258  return;
259  }
260 
261 #ifdef QTONLY
262  bool ok;
263  if (includingUsername) {
264  QString username = QInputDialog::getText(this, //krazy:exclude=qclasses (code not used in kde build)
265  tr("Username required"),
266  tr("Please enter the username for the remote desktop:"),
267  QLineEdit::Normal, m_url.userName(), &ok); //krazy:exclude=qclasses
268  if (ok)
269  vncThread.setUsername(username);
270  else
271  startQuitting();
272  }
273 
274  QString password = QInputDialog::getText(this, //krazy:exclude=qclasses
275  tr("Password required"),
276  tr("Please enter the password for the remote desktop:"),
277  QLineEdit::Password, QString(), &ok); //krazy:exclude=qclasses
278  m_firstPasswordTry = false;
279  if (ok)
280  vncThread.setPassword(password);
281  else
282  startQuitting();
283 #else
284  KPasswordDialog dialog(this, includingUsername ? KPasswordDialog::ShowUsernameLine : KPasswordDialog::NoFlags);
285  dialog.setPrompt(m_firstPasswordTry ? i18n("Access to the system requires a password.")
286  : i18n("Authentication failed. Please try again."));
287  if (includingUsername) dialog.setUsername(m_url.userName());
288  if (dialog.exec() == KPasswordDialog::Accepted) {
289  m_firstPasswordTry = false;
290  vncThread.setPassword(dialog.password());
291  if (includingUsername) vncThread.setUsername(dialog.username());
292  } else {
293  kDebug(5011) << "password dialog not accepted";
294  startQuitting();
295  }
296 #endif
297 }
298 
299 void VncView::outputErrorMessage(const QString &message)
300 {
301  kDebug(5011) << message;
302 
303  if (message == "INTERNAL:APPLE_VNC_COMPATIBILTY") {
304  setCursor(localDotCursor());
305  m_forceLocalCursor = true;
306  return;
307  }
308 
309  startQuitting();
310 
311  KMessageBox::error(this, message, i18n("VNC failure"));
312 
313  emit errorMessage(i18n("VNC failure"), message);
314 }
315 
316 #ifndef QTONLY
317 HostPreferences* VncView::hostPreferences()
318 {
319  return m_hostPreferences;
320 }
321 #endif
322 
323 void VncView::updateImage(int x, int y, int w, int h)
324 {
325 // kDebug(5011) << "got update" << width() << height();
326 
327  m_x = x;
328  m_y = y;
329  m_w = w;
330  m_h = h;
331 
332  if (m_horizontalFactor != 1.0 || m_verticalFactor != 1.0) {
333  // If the view is scaled, grow the update rectangle to avoid artifacts
334  m_x-=1;
335  m_y-=1;
336  m_w+=2;
337  m_h+=2;
338  }
339 
340  m_frame = vncThread.image();
341 
342  if (!m_initDone) {
343  if (!vncThread.username().isEmpty()) {
344  m_url.setUserName(vncThread.username());
345  }
346  setAttribute(Qt::WA_StaticContents);
347  setAttribute(Qt::WA_OpaquePaintEvent);
348  installEventFilter(this);
349 
350  setCursor(((m_dotCursorState == CursorOn) || m_forceLocalCursor) ? localDotCursor() : Qt::BlankCursor);
351 
352  setMouseTracking(true); // get mouse events even when there is no mousebutton pressed
353  setFocusPolicy(Qt::WheelFocus);
354  setStatus(Connected);
355  emit connected();
356 
357  if (m_scale) {
358 #ifndef QTONLY
359  kDebug(5011) << "Setting initial size w:" <<m_hostPreferences->width() << " h:" << m_hostPreferences->height();
360  emit framebufferSizeChanged(m_hostPreferences->width(), m_hostPreferences->height());
361  scaleResize(m_hostPreferences->width(), m_hostPreferences->height());
362  kDebug() << "m_frame.size():" << m_frame.size() << "size()" << size();
363 #else
364 //TODO: qtonly alternative
365 #endif
366  }
367 
368  m_initDone = true;
369 
370 #ifndef QTONLY
371  if (m_hostPreferences->walletSupport()) {
372  saveWalletPassword(vncThread.password());
373  }
374 #endif
375  }
376 
377  if ((y == 0 && x == 0) && (m_frame.size() != size())) {
378  kDebug(5011) << "Updating framebuffer size";
379  if (m_scale) {
380  setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
381  if (parentWidget())
382  scaleResize(parentWidget()->width(), parentWidget()->height());
383  } else {
384  kDebug(5011) << "Resizing: " << m_frame.width() << m_frame.height();
385  resize(m_frame.width(), m_frame.height());
386  setMaximumSize(m_frame.width(), m_frame.height()); //This is a hack to force Qt to center the view in the scroll area
387  setMinimumSize(m_frame.width(), m_frame.height());
388  emit framebufferSizeChanged(m_frame.width(), m_frame.height());
389  }
390  }
391 
392  m_repaint = true;
393  repaint(qRound(m_x * m_horizontalFactor), qRound(m_y * m_verticalFactor), qRound(m_w * m_horizontalFactor), qRound(m_h * m_verticalFactor));
394  m_repaint = false;
395 }
396 
397 void VncView::setViewOnly(bool viewOnly)
398 {
399  RemoteView::setViewOnly(viewOnly);
400 
401  m_dontSendClipboard = viewOnly;
402 
403  if (viewOnly)
404  setCursor(Qt::ArrowCursor);
405  else
406  setCursor(m_dotCursorState == CursorOn ? localDotCursor() : Qt::BlankCursor);
407 }
408 
409 void VncView::showDotCursor(DotCursorState state)
410 {
411  RemoteView::showDotCursor(state);
412 
413  setCursor(state == CursorOn ? localDotCursor() : Qt::BlankCursor);
414 }
415 
416 void VncView::enableScaling(bool scale)
417 {
418  RemoteView::enableScaling(scale);
419 
420  if (scale) {
421  setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
422  setMinimumSize(1, 1);
423  if (parentWidget())
424  scaleResize(parentWidget()->width(), parentWidget()->height());
425  } else {
426  m_verticalFactor = 1.0;
427  m_horizontalFactor = 1.0;
428 
429  setMaximumSize(m_frame.width(), m_frame.height()); //This is a hack to force Qt to center the view in the scroll area
430  setMinimumSize(m_frame.width(), m_frame.height());
431  resize(m_frame.width(), m_frame.height());
432  }
433 }
434 
435 void VncView::setCut(const QString &text)
436 {
437  m_dontSendClipboard = true;
438  m_clipboard->setText(text, QClipboard::Clipboard);
439  m_dontSendClipboard = false;
440 }
441 
442 void VncView::paintEvent(QPaintEvent *event)
443 {
444 // kDebug(5011) << "paint event: x: " << m_x << ", y: " << m_y << ", w: " << m_w << ", h: " << m_h;
445  if (m_frame.isNull() || m_frame.format() == QImage::Format_Invalid) {
446  kDebug(5011) << "no valid image to paint";
447  RemoteView::paintEvent(event);
448  return;
449  }
450 
451  event->accept();
452 
453  QPainter painter(this);
454 
455  if (m_repaint) {
456 // kDebug(5011) << "normal repaint";
457  painter.drawImage(QRect(qRound(m_x*m_horizontalFactor), qRound(m_y*m_verticalFactor),
458  qRound(m_w*m_horizontalFactor), qRound(m_h*m_verticalFactor)),
459  m_frame.copy(m_x, m_y, m_w, m_h).scaled(qRound(m_w*m_horizontalFactor),
460  qRound(m_h*m_verticalFactor),
461  Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
462  } else {
463 // kDebug(5011) << "resize repaint";
464  QRect rect = event->rect();
465  if (rect.width() != width() || rect.height() != height()) {
466 // kDebug(5011) << "Partial repaint";
467  const int sx = rect.x()/m_horizontalFactor;
468  const int sy = rect.y()/m_verticalFactor;
469  const int sw = rect.width()/m_horizontalFactor;
470  const int sh = rect.height()/m_verticalFactor;
471  painter.drawImage(rect,
472  m_frame.copy(sx, sy, sw, sh).scaled(rect.width(), rect.height(),
473  Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
474  } else {
475 // kDebug(5011) << "Full repaint" << width() << height() << m_frame.width() << m_frame.height();
476  painter.drawImage(QRect(0, 0, width(), height()),
477  m_frame.scaled(m_frame.width() * m_horizontalFactor, m_frame.height() * m_verticalFactor,
478  Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
479  }
480  }
481 
482  RemoteView::paintEvent(event);
483 }
484 
485 void VncView::resizeEvent(QResizeEvent *event)
486 {
487  RemoteView::resizeEvent(event);
488  update();
489 }
490 
491 bool VncView::event(QEvent *event)
492 {
493  switch (event->type()) {
494  case QEvent::KeyPress:
495  case QEvent::KeyRelease:
496 // kDebug(5011) << "keyEvent";
497  keyEventHandler(static_cast<QKeyEvent*>(event));
498  return true;
499  break;
500  case QEvent::MouseButtonDblClick:
501  case QEvent::MouseButtonPress:
502  case QEvent::MouseButtonRelease:
503  case QEvent::MouseMove:
504 // kDebug(5011) << "mouseEvent";
505  mouseEventHandler(static_cast<QMouseEvent*>(event));
506  return true;
507  break;
508  case QEvent::Wheel:
509 // kDebug(5011) << "wheelEvent";
510  wheelEventHandler(static_cast<QWheelEvent*>(event));
511  return true;
512  break;
513  default:
514  return RemoteView::event(event);
515  }
516 }
517 
518 void VncView::mouseEventHandler(QMouseEvent *e)
519 {
520  if (e->type() != QEvent::MouseMove) {
521  if ((e->type() == QEvent::MouseButtonPress) ||
522  (e->type() == QEvent::MouseButtonDblClick)) {
523  if (e->button() & Qt::LeftButton)
524  m_buttonMask |= 0x01;
525  if (e->button() & Qt::MidButton)
526  m_buttonMask |= 0x02;
527  if (e->button() & Qt::RightButton)
528  m_buttonMask |= 0x04;
529  } else if (e->type() == QEvent::MouseButtonRelease) {
530  if (e->button() & Qt::LeftButton)
531  m_buttonMask &= 0xfe;
532  if (e->button() & Qt::MidButton)
533  m_buttonMask &= 0xfd;
534  if (e->button() & Qt::RightButton)
535  m_buttonMask &= 0xfb;
536  }
537  }
538 
539  vncThread.mouseEvent(qRound(e->x() / m_horizontalFactor), qRound(e->y() / m_verticalFactor), m_buttonMask);
540 }
541 
542 void VncView::wheelEventHandler(QWheelEvent *event)
543 {
544  int eb = 0;
545  if (event->delta() < 0)
546  eb |= 0x10;
547  else
548  eb |= 0x8;
549 
550  const int x = qRound(event->x() / m_horizontalFactor);
551  const int y = qRound(event->y() / m_verticalFactor);
552 
553  vncThread.mouseEvent(x, y, eb | m_buttonMask);
554  vncThread.mouseEvent(x, y, m_buttonMask);
555 }
556 
557 void VncView::keyEventHandler(QKeyEvent *e)
558 {
559  // strip away autorepeating KeyRelease; see bug #206598
560  if (e->isAutoRepeat() && (e->type() == QEvent::KeyRelease))
561  return;
562 
563 // parts of this code are based on http://italc.sourcearchive.com/documentation/1.0.9.1/vncview_8cpp-source.html
564  rfbKeySym k = e->nativeVirtualKey();
565 
566  // we do not handle Key_Backtab separately as the Shift-modifier
567  // is already enabled
568  if (e->key() == Qt::Key_Backtab) {
569  k = XK_Tab;
570  }
571 
572  const bool pressed = (e->type() == QEvent::KeyPress);
573 
574  // handle modifiers
575  if (k == XK_Shift_L || k == XK_Control_L || k == XK_Meta_L || k == XK_Alt_L) {
576  if (pressed) {
577  m_mods[k] = true;
578  } else if (m_mods.contains(k)) {
579  m_mods.remove(k);
580  } else {
581  unpressModifiers();
582  }
583  }
584 
585  if (k) {
586  vncThread.keyEvent(k, pressed);
587  }
588 }
589 
590 void VncView::unpressModifiers()
591 {
592  const QList<unsigned int> keys = m_mods.keys();
593  QList<unsigned int>::const_iterator it = keys.constBegin();
594  while (it != keys.end()) {
595  vncThread.keyEvent(*it, false);
596  it++;
597  }
598  m_mods.clear();
599 }
600 
601 void VncView::clipboardDataChanged()
602 {
603  kDebug(5011);
604 
605  if (m_status != Connected)
606  return;
607 
608  if (m_clipboard->ownsClipboard() || m_dontSendClipboard)
609  return;
610 
611  const QString text = m_clipboard->text(QClipboard::Clipboard);
612 
613  vncThread.clientCut(text);
614 }
615 
616 #include "moc_vncview.cpp"
RemoteView::Low
Definition: remoteview.h:71
VncView::sizeHint
QSize sizeHint() const
Definition: vncview.cpp:111
VncView::paintEvent
void paintEvent(QPaintEvent *event)
Definition: vncview.cpp:442
VncView::scaleResize
void scaleResize(int w, int h)
Definition: vncview.cpp:121
VncClientThread::mouseEvent
void mouseEvent(int x, int y, int buttonMask)
Definition: vncclientthread.cpp:658
RemoteView::Quality
Quality
Definition: remoteview.h:67
RemoteView::showDotCursor
virtual void showDotCursor(DotCursorState state)
Sets the state of the dot cursor, if supported by the backend.
Definition: remoteview.cpp:165
VncClientThread::setQuality
void setQuality(RemoteView::Quality quality)
Definition: vncclientthread.cpp:387
vncview.h
VncClientThread::password
const QString password() const
Definition: vncclientthread.h:122
VncClientThread::setUsername
void setUsername(const QString &username)
Definition: vncclientthread.h:125
VncView::startQuitting
void startQuitting()
Initiate the disconnection.
Definition: vncview.cpp:153
QWidget
RemoteView::localDotCursor
QCursor localDotCursor() const
Definition: remoteview.cpp:250
VncClientThread::keyEvent
void keyEvent(int key, bool pressed)
Definition: vncclientthread.cpp:667
RemoteView::readWalletPassword
QString readWalletPassword(bool fromUserNameOnly=false)
Definition: remoteview.cpp:199
VncView::minimumSizeHint
QSize minimumSizeHint() const
Definition: vncview.cpp:116
VncView::hostPreferences
HostPreferences * hostPreferences()
Returns the current host preferences of this view.
Definition: vncview.cpp:317
QObject
VncView::setViewOnly
void setViewOnly(bool viewOnly)
Enables/disables the view-only mode.
Definition: vncview.cpp:397
RemoteView::connected
void connected()
Emitted when the view connected successfully.
RemoteView::CursorOn
Always show local cursor (and the remote one).
Definition: remoteview.h:85
VncHostPreferences
Definition: vnchostpreferences.h:30
RemoteView::m_port
int m_port
Definition: remoteview.h:399
RemoteView::m_host
QString m_host
Definition: remoteview.h:398
RemoteView
Generic widget that displays a remote framebuffer.
Definition: remoteview.h:59
Settings::keepAspectRatio
static bool keepAspectRatio()
Get KeepAspectRatio.
Definition: settings.h:220
VncView::VncView
VncView(QWidget *parent=0, const KUrl &url=KUrl(), KConfigGroup configGroup=KConfigGroup())
Definition: vncview.cpp:53
RemoteView::Disconnecting
Definition: remoteview.h:113
VncView::resizeEvent
void resizeEvent(QResizeEvent *event)
Definition: vncview.cpp:485
RemoteView::framebufferSizeChanged
void framebufferSizeChanged(int w, int h)
Emitted when the size of the remote screen changes.
VncView::event
bool event(QEvent *event)
Definition: vncview.cpp:491
VncView::framebufferSize
QSize framebufferSize()
Returns the resolution of the remote framebuffer.
Definition: vncview.cpp:106
RemoteView::m_scale
bool m_scale
Definition: remoteview.h:402
HostPreferences::height
int height()
Saved height.
Definition: hostpreferences.cpp:93
VncView::supportsLocalCursor
bool supportsLocalCursor() const
Checks whether the backend supports the concept of local cursors.
Definition: vncview.cpp:227
RemoteView::Connecting
Definition: remoteview.h:109
RemoteView::errorMessage
void errorMessage(const QString &title, const QString &message)
Emitted when the view has a specific error.
RemoteView::setViewOnly
virtual void setViewOnly(bool viewOnly)
Enables/disables the view-only mode.
Definition: remoteview.cpp:138
RemoteView::url
KUrl url()
Definition: remoteview.cpp:193
VncClientThread::username
const QString username() const
Definition: vncclientthread.h:128
VncClientThread::setHost
void setHost(const QString &host)
Definition: vncclientthread.cpp:375
VncClientThread::image
const QImage image(int x=0, int y=0, int w=0, int h=0)
Definition: vncclientthread.cpp:425
RemoteView::saveWalletPassword
void saveWalletPassword(const QString &password, bool fromUserNameOnly=false)
Definition: remoteview.cpp:235
RemoteView::m_status
RemoteStatus m_status
The status of the remote view.
Definition: remoteview.h:380
VncClientThread::setPassword
void setPassword(const QString &password)
Definition: vncclientthread.h:119
VncView::showDotCursor
void showDotCursor(DotCursorState state)
Sets the state of the dot cursor, if supported by the backend.
Definition: vncview.cpp:409
RemoteView::viewOnly
virtual bool viewOnly()
Checks whether the view is in view-only mode.
Definition: remoteview.cpp:133
HostPreferences
Definition: hostpreferences.h:42
VncView::isQuitting
bool isQuitting()
Checks whether the view is currently quitting.
Definition: vncview.cpp:186
VncClientThread::clientCut
void clientCut(const QString &text)
Definition: vncclientthread.cpp:676
RemoteView::Authenticating
Definition: remoteview.h:110
RemoteView::scaleResize
virtual void scaleResize(int w, int h)
Called when the visible place changed so remote view can resize itself.
Definition: remoteview.cpp:189
settings.h
VncView::eventFilter
bool eventFilter(QObject *obj, QEvent *event)
Definition: vncview.cpp:90
VncView::supportsScaling
bool supportsScaling() const
Checks whether the backend supports scaling.
Definition: vncview.cpp:222
RemoteView::enableScaling
virtual void enableScaling(bool scale)
Called to enable or disable scaling.
Definition: remoteview.cpp:180
VncView::updateConfiguration
virtual void updateConfiguration()
Called when the configuration is changed.
Definition: vncview.cpp:145
RemoteView::updateConfiguration
virtual void updateConfiguration()
Called when the configuration is changed.
Definition: remoteview.cpp:125
VncClientThread::setPort
void setPort(int port)
Definition: vncclientthread.cpp:381
VncView::enableScaling
void enableScaling(bool scale)
Called to enable or disable scaling.
Definition: vncview.cpp:416
VncHostPreferences::quality
RemoteView::Quality quality()
Definition: vnchostpreferences.cpp:138
RemoteView::m_viewOnly
bool m_viewOnly
Definition: remoteview.h:400
RemoteView::setStatus
virtual void setStatus(RemoteStatus s)
Set the status of the connection.
Definition: remoteview.cpp:62
VncClientThread::stop
void stop()
Definition: vncclientthread.cpp:445
HostPreferences::width
int width()
Saved width.
Definition: hostpreferences.cpp:104
RemoteView::m_url
KUrl m_url
Definition: remoteview.h:404
RemoteView::m_dotCursorState
DotCursorState m_dotCursorState
Definition: remoteview.h:412
RemoteView::DotCursorState
DotCursorState
Describes the state of a local cursor, if there is such a concept in the backend. ...
Definition: remoteview.h:84
VncView::start
bool start()
Initialize the view (for example by showing configuration dialogs to the user) and start connecting...
Definition: vncview.cpp:191
RemoteView::Disconnected
Definition: remoteview.h:114
HostPreferences::walletSupport
bool walletSupport()
Definition: hostpreferences.cpp:82
RemoteView::Connected
Definition: remoteview.h:112
VncView::~VncView
~VncView()
Definition: vncview.cpp:85
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:54:04 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

krdc

Skip menu "krdc"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal