libktorrent  2.1.1
trackerslist.h
1 /***************************************************************************
2  * Copyright (C) 2005 by Ivan Vasic *
3  * ivasic@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 #ifndef BTTRACKERSLIST_H
21 #define BTTRACKERSLIST_H
22 
23 #include <QUrl>
24 #include <ktorrent_export.h>
25 
26 namespace bt
27 {
28  struct TrackerTier;
29  class TrackerInterface;
30 
36  class KTORRENT_EXPORT TrackersList
37  {
38  public:
39  TrackersList();
40  virtual ~TrackersList();
41 
46  virtual TrackerInterface* getCurrentTracker() const = 0;
47 
53  virtual void setCurrentTracker(TrackerInterface* t) = 0;
54 
60  virtual void setCurrentTracker(const QUrl &url) = 0;
61 
65  virtual QList<TrackerInterface*> getTrackers() = 0;
66 
75  virtual TrackerInterface* addTracker(const QUrl &url, bool custom = true,int tier = 1) = 0;
76 
81  virtual bool removeTracker(TrackerInterface* t) = 0;
82 
87  virtual bool removeTracker(const QUrl &url) = 0;
88 
93  virtual bool canRemoveTracker(TrackerInterface* t) = 0;
94 
98  virtual void restoreDefault() = 0;
99 
103  virtual void setTrackerEnabled(const QUrl &url,bool on) = 0;
104 
109  void merge(const bt::TrackerTier* first);
110 
114  virtual bool noTrackersReachable() const = 0;
115 
116  };
117 
118 }
119 
120 #endif
bt::TrackerInterface
Definition: trackerinterface.h:57
bt::TrackerTier
Definition: torrent.h:45