SVN_SILENT
[kdenetwork.git] / krdc / mainwindow.h
blob9c119b5e08ab8866fd47d702f3ab210ea656a5ed
1 /****************************************************************************
2 **
3 ** Copyright (C) 2007 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.
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 ****************************************************************************/
24 #ifndef MAINWINDOW_H
25 #define MAINWINDOW_H
27 #include "remoteview.h"
29 #include <KXmlGuiWindow>
31 class KToggleAction;
32 class KTabWidget;
33 class KUrlNavigator;
35 class BookmarkManager;
36 class FloatingToolBar;
37 class RemoteView;
38 class QScrollArea;
40 class MainWindow : public KXmlGuiWindow
42 Q_OBJECT
43 public:
44 MainWindow(QWidget *parent = 0);
45 ~MainWindow();
47 QList<RemoteView *> remoteViewList() const;
48 int currentRemoteView() const;
50 public slots:
51 void newConnection(const KUrl &newUrl = KUrl(), bool switchFullscreenWhenConnected = false);
53 protected:
54 virtual void closeEvent(QCloseEvent *event);
56 private slots:
57 void restoreOpenSessions();
58 void quit();
59 void preferences();
60 void configureNotifications();
61 void configureKeys();
62 void configureToolbars();
63 void showMenubar();
64 void resizeTabWidget(int w, int h);
65 void statusChanged(RemoteView::RemoteStatus status);
66 void showRemoteViewToolbar();
67 void takeScreenshot();
68 void switchFullscreen();
69 void logout();
70 void viewOnly(bool viewOnly);
71 void showLocalCursor(bool showLocalCursor);
72 void specialKeyDialog();
73 void updateActionStatus();
74 void updateConfiguration();
75 void tabChanged(int index);
76 void createStartPage();
77 void newVncConnection();
78 void newNxConnection();
79 void newRdpConnection();
81 private:
82 void setupActions();
83 QScrollArea *createScrollArea(QWidget *parent, RemoteView *remoteView);
85 QWidget *m_fullscreenWindow;
86 QByteArray m_mainWindowGeometry;
88 KToggleAction *m_menubarAction;
89 KTabWidget *m_tabWidget;
90 KUrlNavigator *m_addressNavigator;
92 FloatingToolBar *m_toolBar;
94 BookmarkManager *m_bookmarkManager;
96 QList<RemoteView *> m_remoteViewList;
98 int m_topBottomBorder; // tabwidget borders
99 int m_leftRightBorder;
101 int m_currentRemoteView;
102 bool m_showStartPage;
103 bool m_switchFullscreenWhenConnected;
106 #include <QApplication>
107 #include <QDesktopWidget>
108 #include <QMouseEvent>
110 class MinimizePixel : public QWidget
112 Q_OBJECT
113 public:
114 MinimizePixel(QWidget *parent)
115 : QWidget(parent) {
116 setFixedSize(1, 1);
117 move(QApplication::desktop()->screenGeometry().width() - 1, 0);
120 signals:
121 void rightClicked();
123 protected:
124 void mousePressEvent(QMouseEvent *event) {
125 if (event->button() == Qt::RightButton)
126 emit rightClicked();
130 #endif