libktorrent  2.2.0
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 
32  int trackers_count;
33  int errors;
34  int timeout_errors;
35  int warnings;
36  };
37 
43  class KTORRENT_EXPORT TrackersList
44  {
45  public:
46  TrackersList();
47  virtual ~TrackersList();
48 
53  virtual TrackerInterface* getCurrentTracker() const = 0;
54 
60  virtual void setCurrentTracker(TrackerInterface* t) = 0;
61 
67  virtual void setCurrentTracker(const QUrl &url) = 0;
68 
72  virtual QList<TrackerInterface*> getTrackers() = 0;
73 
82  virtual TrackerInterface* addTracker(const QUrl &url, bool custom = true,int tier = 1) = 0;
83 
88  virtual bool removeTracker(TrackerInterface* t) = 0;
89 
94  virtual bool removeTracker(const QUrl &url) = 0;
95 
100  virtual bool canRemoveTracker(TrackerInterface* t) = 0;
101 
105  virtual void restoreDefault() = 0;
106 
110  virtual void setTrackerEnabled(const QUrl &url,bool on) = 0;
111 
116  void merge(const bt::TrackerTier* first);
117 
121  virtual bool noTrackersReachable() const = 0;
122 
127  };
128 
129 }
130 
131 #endif
bt::TrackersList::setCurrentTracker
virtual void setCurrentTracker(TrackerInterface *t)=0
bt::TrackersList::addTracker
virtual TrackerInterface * addTracker(const QUrl &url, bool custom=true, int tier=1)=0
bt::TrackersList::restoreDefault
virtual void restoreDefault()=0
bt::TrackersList::removeTracker
virtual bool removeTracker(TrackerInterface *t)=0
bt::TrackersList::setCurrentTracker
virtual void setCurrentTracker(const QUrl &url)=0
bt::TrackerInterface
Definition: trackerinterface.h:39
bt::TrackersList
Definition: trackerslist.h:44
bt::TrackersList::setTrackerEnabled
virtual void setTrackerEnabled(const QUrl &url, bool on)=0
bt::TrackersList::merge
void merge(const bt::TrackerTier *first)
bt::TrackersList::canRemoveTracker
virtual bool canRemoveTracker(TrackerInterface *t)=0
bt::TrackersList::getTrackers
virtual QList< TrackerInterface * > getTrackers()=0
bt::TrackersList::getTrackersStatusInfo
virtual TrackersStatusInfo getTrackersStatusInfo() const =0
bt::TrackerTier
Definition: torrent.h:45
bt::TrackersStatusInfo
Definition: trackerslist.h:31
bt::TrackersList::getCurrentTracker
virtual TrackerInterface * getCurrentTracker() const =0
bt::TrackersList::noTrackersReachable
virtual bool noTrackersReachable() const =0
bt::TrackersList::removeTracker
virtual bool removeTracker(const QUrl &url)=0