FloatingToolBar inherits now from QToolBar instead of QWidget:
[kdenetwork.git] / kget / mainwindow.h
blobf92ba024847236156a7974c8c3b6dc606555d5b3
1 /* This file is part of the KDE project
3 Copyright (C) 2002 by Patrick Charbonnier <pch@freeshell.org>
4 Based On Caitoo v.0.7.3 (c) 1998 - 2000, Matej Koss
5 Copyright (C) 2006 Dario Massarin <nekkar@libero.it>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
13 #ifndef MAINWINDOW_H
14 #define MAINWINDOW_H
16 #include <ktoggleaction.h>
17 #include <kxmlguiwindow.h>
18 #include <kurl.h>
20 #include "ui/tray.h"
22 class ViewsContainer;
23 class DropTarget;
24 class DBusModelObserver;
25 class HttpServer;
27 /**
28 * The main window of KGet.
30 * Can be collapsed or expanded.
32 class MainWindow : public KXmlGuiWindow
34 Q_OBJECT
35 public:
36 explicit MainWindow(bool showMainwindow = true, bool startWithoutAnimation = false, QWidget *parent = 0);
37 ~MainWindow();
39 // from the DBUS interface
40 virtual void addTransfers(const QString& src, const QString& destDir = QString(),
41 bool start = false);
42 virtual bool dropTargetVisible() const;
43 virtual void setDropTargetVisible( bool setVisible );
44 virtual void setOfflineMode( bool online );
45 virtual bool offlineMode() const;
46 virtual QVariantMap transfers() const;
47 virtual int transfersSpeed() const;
48 virtual void setSystemTrayDownloading(bool running);
50 KSystemTrayIcon *systemTray() const { return m_dock;};
52 public slots:
53 void slotQuit();
55 protected:
56 // ignore/accept quit events
57 virtual void closeEvent( QCloseEvent * );
59 // drag and drop
60 virtual void dragEnterEvent(QDragEnterEvent *);
61 virtual void dropEvent(QDropEvent *);
63 // set sensitive initial size
64 virtual QSize sizeHint() const;
66 private slots:
67 // slots connected to actions
68 void slotToggleDropTarget();
69 void slotNewTransfer();
70 void slotImportTransfers();
71 void slotExportTransfers();
72 void slotPreferences();
73 void slotDeleteGroup();
74 void slotRenameGroup();
75 void slotSetIconGroup();
76 void slotStartDownload();
77 void slotStopDownload();
78 void slotConfigureNotifications();
79 void slotConfigureKeys();
80 void slotConfigureToolbars();
81 void slotToggleAutoPaste();
82 void slotTrayKonquerorIntegration(bool);
83 void slotKonquerorIntegration( bool );
84 void slotShowMenubar();
85 void slotTransferGroupSettings();
86 void slotTransferSettings();
88 // transfers slots
89 void slotStopAllDownload();
90 void slotStopSelectedDownload();
91 void slotStartAllDownload();
92 void slotStartSelectedDownload();
93 void slotDeleteSelected();
94 void slotRedownloadSelected();
95 void slotTransfersOpenDest();
96 void slotTransfersOpenFile();
97 void slotTransfersShowDetails();
98 void slotTransfersCopySourceUrl();
100 // misc slots
101 void slotDelayedInit();
102 void slotSaveMyself();
103 void slotNewToolbarConfig();
104 void slotNewConfig();
105 void slotCheckClipboard();
106 void slotTransferHistory();
108 private:
109 // one-time functions
110 void setupActions();
112 // internal widgets
113 ViewsContainer * m_viewsContainer;
114 // dbus modelObserver to export the transfer percents
115 DBusModelObserver *m_dbusModelObserver;
117 // separated widgets
118 DropTarget * m_drop;
119 Tray * m_dock;
121 // actions
122 KToggleAction * m_autoPasteAction;
123 KToggleAction * m_menubarAction;
124 KToggleAction * m_konquerorIntegration;
126 // for autopaste function
127 QString lastClipboard;
128 // timer for checking clipboard - autopaste function
129 QTimer *clipboardTimer;
131 bool m_startWithoutAnimation;
133 HttpServer *m_webinterface;
136 #endif