merge in my changes from soc-krdc branch
[kdenetwork.git] / krdc / kremoteview.cpp
blob5b135ed25162e6599c83427de0672e003564e958
1 /***************************************************************************
2 kremoteview.cpp - widget that shows the remote framebuffer
3 -------------------
4 begin : Wed Dec 26 00:21:14 CET 2002
5 copyright : (C) 2002-2003 by Tim Jansen
6 email : tim@tjansen.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #include "kremoteview.h"
20 KRemoteView::KRemoteView(QWidget *parent) :
21 QWidget(parent),
22 m_status(Disconnected)
26 KRemoteView::RemoteStatus KRemoteView::status() {
27 return m_status;
30 void KRemoteView::setStatus(KRemoteView::RemoteStatus s) {
31 if (m_status == s)
32 return;
34 if (((1+(int)m_status) != (int)s) &&
35 (s != Disconnected)) {
36 // follow state transition rules
38 if (s == Disconnecting) {
39 if (m_status == Disconnected)
40 return;
42 else {
43 Q_ASSERT(((int) s) >= 0);
44 if (((int)m_status) > ((int)s) ) {
45 m_status = Disconnected;
46 emit statusChanged(Disconnected);
48 // smooth state transition
49 int origState = (int)m_status;
50 for (int i = origState; i < (int)s; i++) {
51 m_status = (RemoteStatus) i;
52 emit statusChanged((RemoteStatus) i);
56 m_status = s;
57 emit statusChanged(m_status);
60 KRemoteView::~KRemoteView() {
63 bool KRemoteView::supportsScaling() const {
64 return false;
67 bool KRemoteView::supportsLocalCursor() const {
68 return false;
71 void KRemoteView::showDotCursor(DotCursorState) {
74 KRemoteView::DotCursorState KRemoteView::dotCursorState() const {
75 return CursorOff;
78 bool KRemoteView::scaling() const {
79 return false;
82 void KRemoteView::enableScaling(bool) {
85 void KRemoteView::switchFullscreen(bool) {
88 #include "kremoteview.moc"