libktorrent  2.2.0
webseedinterface.h
1 /***************************************************************************
2  * Copyright (C) 2008 by Joris Guisson and Ivan Vasic *
3  * joris.guisson@gmail.com *
4  * ivasic@gmail.com *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20  ***************************************************************************/
21 #ifndef BTWEBSEEDINTERFACE_H
22 #define BTWEBSEEDINTERFACE_H
23 
24 #include <QUrl>
25 #include <ktorrent_export.h>
26 #include <util/constants.h>
27 
28 namespace bt
29 {
30 
34  class KTORRENT_EXPORT WebSeedInterface
35  {
36  public:
37  WebSeedInterface(const QUrl &url,bool user);
38  virtual ~WebSeedInterface();
39 
41  virtual void setEnabled(bool on);
42 
44  bool isEnabled() const {return enabled;}
45 
47  const QUrl &getUrl() const {return url;}
48 
50  Uint64 getTotalDownloaded() const {return total_downloaded;}
51 
53  QString getStatus() const {return status;}
54 
56  virtual Uint32 getDownloadRate() const = 0;
57 
59  bool isUserCreated() const {return user;}
60 
61  protected:
62  QUrl url;
63  Uint64 total_downloaded;
64  QString status;
65  bool user;
66  bool enabled;
67  };
68 
69 }
70 
71 #endif