Fix and install smb2rdc action
[kdenetwork.git] / krdc / mainwindow.h
blob3e9d5a1c2c9230edacdb1e146d2a8f8d3911dbeb
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 SystemTrayIcon;
39 class QScrollArea;
41 class MainWindow : public KXmlGuiWindow
43 Q_OBJECT
44 public:
45 MainWindow(QWidget *parent = 0);
46 ~MainWindow();
48 QList<RemoteView *> remoteViewList() const;
49 int currentRemoteView() const;
51 public slots:
52 void newConnection(const KUrl &newUrl = KUrl(), bool switchFullscreenWhenConnected = false);
54 protected:
55 virtual void closeEvent(QCloseEvent *event);
57 private slots:
58 void restoreOpenSessions();
59 void quit();
60 void preferences();
61 void configureNotifications();
62 void configureKeys();
63 void configureToolbars();
64 void showMenubar();
65 void resizeTabWidget(int w, int h);
66 void statusChanged(RemoteView::RemoteStatus status);
67 void showRemoteViewToolbar();
68 void takeScreenshot();
69 void switchFullscreen();
70 void logout();
71 void viewOnly(bool viewOnly);
72 void showLocalCursor(bool showLocalCursor);
73 void specialKeyDialog();
74 void updateActionStatus();
75 void updateConfiguration();
76 void tabChanged(int index);
77 void createStartPage();
78 void newVncConnection();
79 void newNxConnection();
80 void newRdpConnection();
82 private:
83 void setupActions();
84 QScrollArea *createScrollArea(QWidget *parent, RemoteView *remoteView);
86 QWidget *m_fullscreenWindow;
87 QByteArray m_mainWindowGeometry;
89 KToggleAction *m_menubarAction;
90 KTabWidget *m_tabWidget;
91 KUrlNavigator *m_addressNavigator;
93 FloatingToolBar *m_toolBar;
95 BookmarkManager *m_bookmarkManager;
97 QList<RemoteView *> m_remoteViewList;
99 int m_topBottomBorder; // tabwidget borders
100 int m_leftRightBorder;
102 int m_currentRemoteView;
103 bool m_showStartPage;
104 bool m_switchFullscreenWhenConnected;
106 SystemTrayIcon *m_systemTrayIcon;
109 #include <QApplication>
110 #include <QDesktopWidget>
111 #include <QMouseEvent>
113 class MinimizePixel : public QWidget
115 Q_OBJECT
116 public:
117 MinimizePixel(QWidget *parent)
118 : QWidget(parent) {
119 setFixedSize(1, 1);
120 move(QApplication::desktop()->screenGeometry().width() - 1, 0);
123 signals:
124 void rightClicked();
126 protected:
127 void mousePressEvent(QMouseEvent *event) {
128 if (event->button() == Qt::RightButton)
129 emit rightClicked();
133 #endif