Various changes for IRC plugin, not yet usable.
[kdenetwork.git] / kget / mainwindow.h
blobec7c4a974230cbbe167b23d84a2201abb826c07a
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;
26 /**
27 * The main window of KGet.
29 * Can be collapsed or expanded.
31 class MainWindow : public KXmlGuiWindow
33 Q_OBJECT
34 public:
35 explicit MainWindow(bool showMainwindow = true, bool startWithoutAnimation = false, QWidget *parent = 0);
36 ~MainWindow();
38 // from the DBUS interface
39 virtual void addTransfers(const QString& src, const QString& destDir = QString(),
40 bool start = false);
41 virtual bool dropTargetVisible() const;
42 virtual void setDropTargetVisible( bool setVisible );
43 virtual void setOfflineMode( bool online );
44 virtual bool offlineMode() const;
45 virtual QVariantMap transfers() const;
46 virtual int transfersSpeed() const;
47 virtual void setSystemTrayDownloading(bool running);
49 KSystemTrayIcon *systemTray() const { return m_dock;};
51 public slots:
52 void slotQuit();
54 protected:
55 // ignore/accept quit events
56 virtual void closeEvent( QCloseEvent * );
58 // drag and drop
59 virtual void dragEnterEvent(QDragEnterEvent *);
60 virtual void dropEvent(QDropEvent *);
62 // set sensitive initial size
63 virtual QSize sizeHint() const;
65 private slots:
66 // slots connected to actions
67 void slotToggleDropTarget();
68 void slotNewTransfer();
69 void slotImportTransfers();
70 void slotExportTransfers();
71 void slotPreferences();
72 void slotDeleteGroup();
73 void slotRenameGroup();
74 void slotStartDownload();
75 void slotStopDownload();
76 void slotConfigureNotifications();
77 void slotConfigureKeys();
78 void slotConfigureToolbars();
79 void slotToggleAutoPaste();
80 void slotTrayKonquerorIntegration(bool);
81 void slotKonquerorIntegration( bool );
82 void slotShowMenubar();
83 void slotTransferGroupSettings();
85 // transfers slots
86 void slotStopAllDownload();
87 void slotStopSelectedDownload();
88 void slotStartAllDownload();
89 void slotStartSelectedDownload();
90 void slotDeleteSelected();
91 void slotTransfersOpenDest();
92 void slotTransfersOpenFile();
93 void slotTransfersShowDetails();
94 void slotTransfersCopySourceUrl();
96 // misc slots
97 void slotDelayedInit();
98 void slotSaveMyself();
99 void slotNewToolbarConfig();
100 void slotNewConfig();
101 void slotCheckClipboard();
102 void slotTransferHistory();
104 private:
105 // one-time functions
106 void setupActions();
108 // internal widgets
109 ViewsContainer * m_viewsContainer;
110 // dbus modelObserver to export the transfer percents
111 DBusModelObserver *m_dbusModelObserver;
113 // separated widgets
114 DropTarget * m_drop;
115 Tray * m_dock;
117 // actions
118 KToggleAction * m_autoPasteAction;
119 KToggleAction * m_menubarAction;
120 KToggleAction * m_konquerorIntegration;
122 // for autopaste function
123 QString lastClipboard;
124 // timer for checking clipboard - autopaste function
125 QTimer *clipboardTimer;
127 bool m_startWithoutAnimation;
130 #endif