Added build script of Debian
[qtrapids] / src / gui / MainWindow.h
index 9ac916d..a4335ac 100644 (file)
@@ -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        *
@@ -32,6 +30,7 @@ class QTabWidget;
 class DownloadView;
 class SeedView;
 class PreferencesDialog;
+class PluginInterface; 
 
 /**
        @author Lassi Väätämöinen <lassi.vaatamoinen@ixonos.com>
@@ -39,19 +38,19 @@ class PreferencesDialog;
 class MainWindow : public QMainWindow, public qtrapids::PluginHostInterface
 {
        Q_OBJECT
-                       
-       public:
-           MainWindow();
 
-           virtual ~MainWindow();
+       public:
+    MainWindow();
+    virtual ~MainWindow();
                
                // Implemented from PluginHostInterface
-               virtual bool setGui(qtrapids::PluginInterface* from, QWidget* widget);
-               virtual void addPluginWidget(qtrapids::PluginInterface* from, QWidget* widget);
-               virtual void addToolbar(qtrapids::PluginInterface* from, QWidget* widget);
-               virtual void addToolItem(qtrapids::PluginInterface* from, QWidget* widget);
-               virtual void addMenu(qtrapids::PluginInterface* from, QWidget* widget);
-               virtual void addMenuItem(qtrapids::PluginInterface* from, QWidget* widget);
+               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);
@@ -64,6 +63,7 @@ class MainWindow : public QMainWindow, public qtrapids::PluginHostInterface
                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);
@@ -72,18 +72,24 @@ class MainWindow : public QMainWindow, public qtrapids::PluginHostInterface
        
        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_;
-               QDir pluginsDir_;
+               QList<QDir> pluginDirs_;
                QStringList pluginFileNames_;
+               //std::vector< std::auto_ptr<QTorrentHandle> const > torrentHandles_;
                
                qtrapids::QBittorrentSession btSession_;
                
+
+               //bool IsNewTorrent(std::auto_ptr<QTorrentHandle> handlePtr);
 };
 
 #endif