1 /***************************************************************************
2 *                                                                         *
3 *   This program is free software; you can redistribute it and/or modify  *
4 *   it under the terms of the GNU General Public License as published by  *
5 *   the Free Software Foundation; either version 3 of the License, or     *
6 *   (at your option) any later version.                                   *
7 *                                                                         *
8 ***************************************************************************/
9 
10 #pragma once
11 
12 #include <QDialog>
13 #include <QEvent>
14 
15 #include "dcpp/stdinc.h"
16 #include "dcpp/SearchManager.h"
17 
18 #include "ui_UIMagnet.h"
19 
20 class Magnet :
21         public QDialog,
22         private Ui::UIMagnet
23 {
24 Q_OBJECT
25 public:
26     explicit Magnet(QWidget *parent = 0);
27     virtual ~Magnet();
28 
29     void setLink(const QString&);
30     enum {
31       MAGNET_ACTION_SHOW_UI = 0,
32       MAGNET_ACTION_SEARCH = 1,
33       MAGNET_ACTION_DOWNLOAD = 2
34     };
35 
36 private slots:
37     void search();
38     void download();
39     void slotBrowse();
40     void showUI(const QString &, const qulonglong &, const QString &);
41     void search(const QString &, const qulonglong &, const QString &);
42     void searchTTH(const QString&);
43     void searchFile(const QString&);
44     void download(const QString &, const qulonglong &, const QString &);
45 };
46