X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=blobdiff_plain;f=src%2Fgui%2FMainWindow.h;h=a4335ac683f3d850994612d46fd20c6afe64fcbb;hp=f4d43b1a4af26ef782a28c746985bfdd95156351;hb=1d97c0a567b80cf9fc67791669debfe3aa9c4c84;hpb=d27c2db830de9a65d6a419479ee598cbf3697746 diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index f4d43b1..a4335ac 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -1,11 +1,9 @@ /*************************************************************************** - * Copyright (C) 2009 by Lassi Väätämöinen * - * lassi.vaatamoinen@ixonos.com * + * Copyright (C) 2010 by Ixonos Plc * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * the Free Software Foundation; version 2 of the License. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -22,56 +20,76 @@ #include #include +#include +#include +#include "PluginInterface.h" #include "QBittorrentSession.h" class QTabWidget; class DownloadView; class SeedView; class PreferencesDialog; +class PluginInterface; /** @author Lassi Väätämöinen */ -class MainWindow : public QMainWindow +class MainWindow : public QMainWindow, public qtrapids::PluginHostInterface { - Q_OBJECT + Q_OBJECT -public: + public: MainWindow(); + virtual ~MainWindow(); + + // Implemented from PluginHostInterface + virtual bool setGui(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE, qtrapids::PluginInterface* plugin = NULL); + virtual void addPluginWidget(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual void addToolbar(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual void addToolItem(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual void addMenu(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual void addMenuItem(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE); + virtual bool eventRequest(QVariant param, PluginRequest req = UNKNOWN_REQUEST); + + signals: + void itemSelected(bool enabled); + + public slots: + private slots: + void on_openAction_clicked(); + void on_removeAction_clicked(); + void on_quitAction_clicked(); + void on_preferencesAction_clicked(); + void on_aboutAction_clicked(); + void on_aboutQtAction_clicked(); + void on_tabWidget_tabCloseRequested(int index); + void on_downloadItemSelectionChanged(); + void on_seedItemSelectionChanged(); + void handleToolBarAction(QAction* action); + void on_torrentFileSelected(const QString& file); + void on_alert(std::auto_ptr al); + + private: + void LoadPlugins(); + void RestoreSettings(); + void StartTorrentFromBufferData(char const* data, int size); + + private: + QTabWidget *tabWidget_; + DownloadView *dlView_; + SeedView *seedView_; + QWidget *searchWidget_; + PreferencesDialog *preferencesDialog_; + QSettings settings_; + QList pluginDirs_; + QStringList pluginFileNames_; + //std::vector< std::auto_ptr const > torrentHandles_; + + qtrapids::QBittorrentSession btSession_; + - ~MainWindow(); - -signals: - void itemSelected(bool enabled); - -public slots: -private slots: - void on_openAction_clicked(); - void on_removeAction_clicked(); - void on_quitAction_clicked(); - void on_preferencesAction_clicked(); - void on_aboutAction_clicked(); - void on_aboutQtAction_clicked(); - void on_downloadItemSelectionChanged(); - void on_seedItemSelectionChanged(); - void handleToolBarAction(QAction* action); - void on_torrentFileSelected(const QString& file); - void on_alert(std::auto_ptr al); - -private: - QTabWidget *tabWidget_; - DownloadView *dlView_; - SeedView *seedView_; - PreferencesDialog *preferencesDialog_; - QSettings settings_; - - //std::vector< std::auto_ptr const > torrentHandles_; - - qtrapids::QBittorrentSession btSession_; - - - //bool IsNewTorrent(std::auto_ptr handlePtr); + //bool IsNewTorrent(std::auto_ptr handlePtr); }; #endif