kget
bt::TorrentInterface Class Reference
#include <torrentinterface.h>

Detailed Description
Interface for an object which controls one torrent
This class is the interface for an object which controls the up- and download of one torrent.
Definition at line 187 of file torrentinterface.h.
Public Types | |
| enum | ChangeOutputFlags { MOVE_FILES = 1, FULL_PATH = 2 } |
Signals | |
| void | aboutToBeStarted (bt::TorrentInterface *me, bool &ret) |
| void | corruptedDataFound (bt::TorrentInterface *me) |
| void | diskSpaceLow (bt::TorrentInterface *me, bool toStop) |
| void | finished (bt::TorrentInterface *me) |
| void | maxRatioChanged (bt::TorrentInterface *me) |
| void | missingFilesMarkedDND (bt::TorrentInterface *me) |
| void | needDataCheck (bt::TorrentInterface *me) |
| void | seedingAutoStopped (bt::TorrentInterface *me, bt::AutoStopReason reason) |
| void | statusChanged (bt::TorrentInterface *me) |
| void | stoppedByError (bt::TorrentInterface *me, QString msg) |
| void | torrentStopped (bt::TorrentInterface *me) |
Public Member Functions | |
| virtual void | addPeerSource (PeerSource *ps)=0 |
| virtual bool | addWebSeed (const KUrl &url)=0 |
| virtual bool | announceAllowed ()=0 |
| virtual const bt::BitSet & | availableChunksBitSet () const =0 |
| virtual bool | changeOutputDir (const QString &new_dir, int flags)=0 |
| virtual void | changeTextCodec (QTextCodec *tc)=0 |
| virtual bool | changeTorDir (const QString &new_dir)=0 |
| virtual bool | checkDiskSpace (bool emit_sig=true)=0 |
| virtual void | deleteDataFiles ()=0 |
| virtual void | dndMissingFiles ()=0 |
| virtual const bt::BitSet & | downloadedChunksBitSet () const =0 |
| virtual const bt::BitSet & | excludedChunksBitSet () const =0 |
| virtual void | getAssuredSpeeds (Uint32 &up, Uint32 &down)=0 |
| virtual QString | getDataDir () const =0 |
| virtual const DHTNode & | getDHTNode (Uint32 i) const =0 |
| virtual int | getETA ()=0 |
| virtual const bt::SHA1Hash & | getInfoHash () const =0 |
| virtual float | getMaxSeedTime () const =0 |
| virtual float | getMaxShareRatio () const =0 |
| virtual Uint32 | getNumDHTNodes () const =0 |
| virtual Uint32 | getNumFiles () const =0 |
| virtual Uint32 | getNumWebSeeds () const =0 |
| virtual const bt::PeerID & | getOwnPeerID () const =0 |
| virtual int | getPriority () const =0 |
| virtual Uint32 | getRunningTimeDL () const =0 |
| virtual Uint32 | getRunningTimeUL () const =0 |
| virtual QString | getShortErrorMessage () const =0 |
| const TorrentStats & | getStats () const |
| virtual const QTextCodec * | getTextCodec () const =0 |
| virtual Uint32 | getTimeToNextTrackerUpdate () const =0 |
| virtual QString | getTorDir () const =0 |
| virtual const TorrentFileInterface & | getTorrentFile (Uint32 index) const =0 |
| virtual TorrentFileInterface & | getTorrentFile (Uint32 index)=0 |
| virtual const TrackersList * | getTrackersList () const =0 |
| virtual TrackersList * | getTrackersList ()=0 |
| virtual void | getTrafficLimits (Uint32 &up, Uint32 &down)=0 |
| virtual const WebSeedInterface * | getWebSeed (Uint32 i) const =0 |
| virtual void | handleError (const QString &err)=0 |
| virtual bool | hasMissingFiles (QStringList &sl)=0 |
| virtual bool | isCheckingData (bool &finished) const =0 |
| virtual bool | isFeatureEnabled (TorrentFeature tf)=0 |
| virtual bool | isMovingFiles () const =0 |
| virtual bool | isMultimedia () const =0 |
| virtual void | markExistingFilesAsDownloaded ()=0 |
| virtual bool | moveTorrentFiles (const QMap< TorrentFileInterface *, QString > &files)=0 |
| virtual const bt::BitSet & | onlySeedChunksBitSet () const =0 |
| virtual bool | overMaxRatio ()=0 |
| virtual bool | overMaxSeedTime ()=0 |
| virtual bool | readyForPreview () const =0 |
| virtual void | recreateMissingFiles ()=0 |
| virtual void | removePeerSource (PeerSource *ps)=0 |
| virtual bool | removeWebSeed (const KUrl &url)=0 |
| virtual void | rollback ()=0 |
| virtual void | scrapeTracker ()=0 |
| virtual void | setAssuredSpeeds (Uint32 up, Uint32 down)=0 |
| virtual void | setFeatureEnabled (TorrentFeature tf, bool on)=0 |
| virtual void | setMaxSeedTime (float hours)=0 |
| virtual void | setMaxShareRatio (float ratio)=0 |
| virtual void | setMonitor (MonitorInterface *tmo)=0 |
| virtual void | setPriority (int p)=0 |
| virtual void | setTrafficLimits (Uint32 up, Uint32 down)=0 |
| virtual void | start ()=0 |
| virtual void | startDataCheck (bt::DataCheckerListener *lst)=0 |
| virtual QString | statusToString () const =0 |
| virtual void | stop (bool user, bt::WaitJob *wjob=0)=0 |
| TorrentInterface () | |
| virtual void | update ()=0 |
| virtual bool | updateNeeded () const =0 |
| virtual void | updateTracker ()=0 |
| virtual | ~TorrentInterface () |
Protected Attributes | |
| TorrentStats | stats |
Member Enumeration Documentation
Constructor & Destructor Documentation
| bt::TorrentInterface::TorrentInterface | ( | ) |
Definition at line 34 of file torrentinterface.cpp.
| bt::TorrentInterface::~TorrentInterface | ( | ) | [virtual] |
Definition at line 38 of file torrentinterface.cpp.
Member Function Documentation
| void bt::TorrentInterface::aboutToBeStarted | ( | bt::TorrentInterface * | me, | |
| bool & | ret | |||
| ) | [signal] |
Emitted just before the torrent is started, this should be used to do some checks on the files in the cache.
- Parameters:
-
me The torrent which emitted the signal ret The return value
| virtual void bt::TorrentInterface::addPeerSource | ( | PeerSource * | ps | ) | [pure virtual] |
| virtual bool bt::TorrentInterface::addWebSeed | ( | const KUrl & | url | ) | [pure virtual] |
Add a webseed (return false, if there is already a webseed with the same url).
Implemented in bt::TorrentControl.
| virtual bool bt::TorrentInterface::announceAllowed | ( | ) | [pure virtual] |
| virtual const bt::BitSet& bt::TorrentInterface::availableChunksBitSet | ( | ) | const [pure virtual] |
| virtual bool bt::TorrentInterface::changeOutputDir | ( | const QString & | new_dir, | |
| int | flags | |||
| ) | [pure virtual] |
Change to a new data dir.
If this fails we will fall back on the old directory.
- Parameters:
-
new_dir The new directory flags The OR of ChangeOutputFlags
- Returns:
- true upon succes
Implemented in bt::TorrentControl.
| virtual void bt::TorrentInterface::changeTextCodec | ( | QTextCodec * | tc | ) | [pure virtual] |
| virtual bool bt::TorrentInterface::changeTorDir | ( | const QString & | new_dir | ) | [pure virtual] |
Change to a new torX dir.
If this fails we will fall back on the old directory.
- Parameters:
-
new_dir The new directory
- Returns:
- true upon succes
Implemented in bt::TorrentControl.
| virtual bool bt::TorrentInterface::checkDiskSpace | ( | bool | emit_sig = true |
) | [pure virtual] |
| void bt::TorrentInterface::corruptedDataFound | ( | bt::TorrentInterface * | me | ) | [signal] |
A corrupted chunk has been found during upload.
- Parameters:
-
me The torrent which emitted the signal
| virtual void bt::TorrentInterface::deleteDataFiles | ( | ) | [pure virtual] |
Delete the data files of the torrent, they will be lost permanently.
Implemented in bt::TorrentControl.
| void bt::TorrentInterface::diskSpaceLow | ( | bt::TorrentInterface * | me, | |
| bool | toStop | |||
| ) | [signal] |
Disk is running out of space.
- Parameters:
-
me The torrent which emitted the signal toStop should this torrent be stopped or not
| virtual void bt::TorrentInterface::dndMissingFiles | ( | ) | [pure virtual] |
| virtual const bt::BitSet& bt::TorrentInterface::downloadedChunksBitSet | ( | ) | const [pure virtual] |
| virtual const bt::BitSet& bt::TorrentInterface::excludedChunksBitSet | ( | ) | const [pure virtual] |
| void bt::TorrentInterface::finished | ( | bt::TorrentInterface * | me | ) | [signal] |
Emitted when we have finished downloading.
- Parameters:
-
me The object who emitted the signal
Get the assured speeds.
| virtual QString bt::TorrentInterface::getDataDir | ( | ) | const [pure virtual] |
Get a DHT node.
| virtual int bt::TorrentInterface::getETA | ( | ) | [pure virtual] |
Returns estimated time left for finishing download.
Returned value is in seconds. Uses TimeEstimator class to calculate this value.
Implemented in bt::TorrentControl.
| virtual const bt::SHA1Hash& bt::TorrentInterface::getInfoHash | ( | ) | const [pure virtual] |
| virtual float bt::TorrentInterface::getMaxSeedTime | ( | ) | const [pure virtual] |
| virtual float bt::TorrentInterface::getMaxShareRatio | ( | ) | const [pure virtual] |
| virtual Uint32 bt::TorrentInterface::getNumDHTNodes | ( | ) | const [pure virtual] |
| virtual Uint32 bt::TorrentInterface::getNumFiles | ( | ) | const [pure virtual] |
Get the number of files in a multifile torrent (0 if we do not have a multifile torrent).
Implemented in bt::TorrentControl.
| virtual Uint32 bt::TorrentInterface::getNumWebSeeds | ( | ) | const [pure virtual] |
| virtual const bt::PeerID& bt::TorrentInterface::getOwnPeerID | ( | ) | const [pure virtual] |
| virtual int bt::TorrentInterface::getPriority | ( | ) | const [pure virtual] |
| virtual Uint32 bt::TorrentInterface::getRunningTimeDL | ( | ) | const [pure virtual] |
Get the download running time of this torrent in seconds.
- Returns:
- Uint32 - time in seconds
Implemented in bt::TorrentControl.
| virtual Uint32 bt::TorrentInterface::getRunningTimeUL | ( | ) | const [pure virtual] |
Get the upload running time of this torrent in seconds.
- Returns:
- Uint32 - time in seconds
Implemented in bt::TorrentControl.
| virtual QString bt::TorrentInterface::getShortErrorMessage | ( | ) | const [pure virtual] |
| const TorrentStats& bt::TorrentInterface::getStats | ( | ) | const [inline] |
| virtual const QTextCodec* bt::TorrentInterface::getTextCodec | ( | ) | const [pure virtual] |
| virtual Uint32 bt::TorrentInterface::getTimeToNextTrackerUpdate | ( | ) | const [pure virtual] |
| virtual QString bt::TorrentInterface::getTorDir | ( | ) | const [pure virtual] |
Get the torX directory of this torrent.
Temporary stuff like the index file get stored there.
Implemented in bt::TorrentControl.
| virtual const TorrentFileInterface& bt::TorrentInterface::getTorrentFile | ( | Uint32 | index | ) | const [pure virtual] |
Const version of the previous one.
- Parameters:
-
index The index of the file
- Returns:
- The TorrentFileInterface (isNull() will be true in case of error)
| virtual TorrentFileInterface& bt::TorrentInterface::getTorrentFile | ( | Uint32 | index | ) | [pure virtual] |
Get the index'th file of a multifile torrent.
- Parameters:
-
index The index
- Returns:
- The TorrentFileInterface (isNull() will be true in case of error)
| virtual const TrackersList* bt::TorrentInterface::getTrackersList | ( | ) | const [pure virtual] |
| virtual TrackersList* bt::TorrentInterface::getTrackersList | ( | ) | [pure virtual] |
Get the traffic limits.
| virtual const WebSeedInterface* bt::TorrentInterface::getWebSeed | ( | Uint32 | i | ) | const [pure virtual] |
Get a webseed (returns 0 if index is invalid).
| virtual void bt::TorrentInterface::handleError | ( | const QString & | err | ) | [pure virtual] |
Handle an error.
| virtual bool bt::TorrentInterface::hasMissingFiles | ( | QStringList & | sl | ) | [pure virtual] |
Test all files and see if they are not missing.
If so put them in a list
Implemented in bt::TorrentControl.
| virtual bool bt::TorrentInterface::isCheckingData | ( | bool & | finished | ) | const [pure virtual] |
Are we doing a data check on this torrent.
- Parameters:
-
finished This will be set to true if the data check is finished
| virtual bool bt::TorrentInterface::isFeatureEnabled | ( | TorrentFeature | tf | ) | [pure virtual] |
| virtual bool bt::TorrentInterface::isMovingFiles | ( | ) | const [pure virtual] |
| virtual bool bt::TorrentInterface::isMultimedia | ( | ) | const [pure virtual] |
| virtual void bt::TorrentInterface::markExistingFilesAsDownloaded | ( | ) | [pure virtual] |
| void bt::TorrentInterface::maxRatioChanged | ( | bt::TorrentInterface * | me | ) | [signal] |
Emitted when maximum share ratio for this torrent is changed.
- Parameters:
-
me The object which emitted the signal.
| void bt::TorrentInterface::missingFilesMarkedDND | ( | bt::TorrentInterface * | me | ) | [signal] |
Emitted when missing files have been marked as dnd.
The intention of this signal is to update the GUI.
- Parameters:
-
me The torrent which emitted the signal
| virtual bool bt::TorrentInterface::moveTorrentFiles | ( | const QMap< TorrentFileInterface *, QString > & | files | ) | [pure virtual] |
Move a torrent file to a new location.
- Parameters:
-
files Map of files and their new location
- Returns:
- true upon success
Implemented in bt::TorrentControl.
| void bt::TorrentInterface::needDataCheck | ( | bt::TorrentInterface * | me | ) | [signal] |
Signal emitted when the torrent needs a data check.
- Parameters:
-
me The torrent
| virtual const bt::BitSet& bt::TorrentInterface::onlySeedChunksBitSet | ( | ) | const [pure virtual] |
| virtual bool bt::TorrentInterface::overMaxRatio | ( | ) | [pure virtual] |
| virtual bool bt::TorrentInterface::overMaxSeedTime | ( | ) | [pure virtual] |
Checks if a seeding torrent has reached it's max seed timery / will be ret.
Implemented in bt::TorrentControl.
| virtual bool bt::TorrentInterface::readyForPreview | ( | ) | const [pure virtual] |
Checks if torrent is multimedial and chunks needed for preview are downloaded This only works for single file torrents.
- Returns:
- true if it is
Implemented in bt::TorrentControl.
| virtual void bt::TorrentInterface::recreateMissingFiles | ( | ) | [pure virtual] |
| virtual void bt::TorrentInterface::removePeerSource | ( | PeerSource * | ps | ) | [pure virtual] |
| virtual bool bt::TorrentInterface::removeWebSeed | ( | const KUrl & | url | ) | [pure virtual] |
| virtual void bt::TorrentInterface::rollback | ( | ) | [pure virtual] |
Roll back the previous changeDataDir call.
Does nothing if there was no previous changeDataDir call.
Implemented in bt::TorrentControl.
| virtual void bt::TorrentInterface::scrapeTracker | ( | ) | [pure virtual] |
| void bt::TorrentInterface::seedingAutoStopped | ( | bt::TorrentInterface * | me, | |
| bt::AutoStopReason | reason | |||
| ) | [signal] |
Emitted then torrent is stopped from seeding by KTorrent.
Happens when torrent has reached maximum share ratio and maybe we'll add something more...
- Parameters:
-
me The object which emitted the signal. reason The reason why it was aut stopped
Set the assured speeds.
| virtual void bt::TorrentInterface::setFeatureEnabled | ( | TorrentFeature | tf, | |
| bool | on | |||
| ) | [pure virtual] |
| virtual void bt::TorrentInterface::setMaxSeedTime | ( | float | hours | ) | [pure virtual] |
| virtual void bt::TorrentInterface::setMaxShareRatio | ( | float | ratio | ) | [pure virtual] |
| virtual void bt::TorrentInterface::setMonitor | ( | MonitorInterface * | tmo | ) | [pure virtual] |
| virtual void bt::TorrentInterface::setPriority | ( | int | p | ) | [pure virtual] |
Set the traffic limits for this torrent.
| virtual void bt::TorrentInterface::start | ( | ) | [pure virtual] |
| virtual void bt::TorrentInterface::startDataCheck | ( | bt::DataCheckerListener * | lst | ) | [pure virtual] |
| void bt::TorrentInterface::statusChanged | ( | bt::TorrentInterface * | me | ) | [signal] |
Emitted whenever the status of the torrent changes.
- Parameters:
-
me the torrent
| virtual QString bt::TorrentInterface::statusToString | ( | ) | const [pure virtual] |
| virtual void bt::TorrentInterface::stop | ( | bool | user, | |
| bt::WaitJob * | wjob = 0 | |||
| ) | [pure virtual] |
Stop the download, closes all connections.
- Parameters:
-
user whether or not the user did this explicitly wjob WaitJob, used when KT is shutting down, so that we can wait for all stopped events to reach the tracker
Implemented in bt::TorrentControl.
| void bt::TorrentInterface::stoppedByError | ( | bt::TorrentInterface * | me, | |
| QString | msg | |||
| ) | [signal] |
| void bt::TorrentInterface::torrentStopped | ( | bt::TorrentInterface * | me | ) | [signal] |
| virtual void bt::TorrentInterface::update | ( | ) | [pure virtual] |
| virtual bool bt::TorrentInterface::updateNeeded | ( | ) | const [pure virtual] |
| virtual void bt::TorrentInterface::updateTracker | ( | ) | [pure virtual] |
Update the tracker, this should normally handled internally.
We leave it public so that the user can do a manual announce.
Implemented in bt::TorrentControl.
Member Data Documentation
TorrentStats bt::TorrentInterface::stats [protected] |
Definition at line 565 of file torrentinterface.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference