20 #ifndef BTTORRENTFILEINTERFACE_H
21 #define BTTORRENTFILEINTERFACE_H
25 #include <ktorrent_export.h>
26 #include <util/constants.h>
82 QString
getUserModifiedPath()
const {
return user_modified_path.isEmpty() ? path : user_modified_path;}
103 bool isNull()
const {
return path.isNull();}
118 virtual void setPriority(Priority newpriority = NORMAL_PRIORITY) = 0;
145 bool isVideo()
const {
return filetype == VIDEO;}
148 bool isAudio()
const {
return filetype == AUDIO;}
154 Uint32 num_chunks_downloaded;
156 Uint64 first_chunk_off;
157 Uint64 last_chunk_size;
159 bool emit_status_changed;
161 mutable FileType filetype;
164 QString path_on_disk;
165 QString user_modified_path;
166 mutable QString mount_point;
167 QList<QByteArray> unencoded_path;
float getDownloadPercentage() const
Get the % of the file which is downloaded.
virtual void setEmitDownloadStatusChanged(bool show)=0
Wheather to emit signal when dl status changes or not.
QString getPathOnDisk() const
Get the path of a file on disk.
Interface for a file in a multifile torrent.
virtual void setPriority(Priority newpriority=NORMAL_PRIORITY)=0
Sets the priority of the torrent.
void setMountPoint(const QString &path)
Set the mount point.
void setUserModifiedPath(const QString &p)
Set the user modified path.
bool isPreExistingFile() const
Did this file exist before the torrent was loaded by KT.
bool isPreviewAvailable() const
See if preview is available.
Uint32 getLastChunk() const
Get the last chunk of the file.
TorrentFileInterface(Uint32 index, const QString &path, Uint64 size)
void setUnencodedPath(const QList< QByteArray > up)
Set the unencoded path.
void changeTextCodec(QTextCodec *codec)
Change the text codec.
virtual void emitDownloadStatusChanged()=0
Emits signal dlStatusChanged. Use it only with FileSelectDialog!
Uint32 getFirstChunk() const
Get the index of the first chunk in which this file lies.
void setPathOnDisk(const QString &p)
virtual Priority getPriority() const
Gets the current priority of the torrent.
Uint64 getSize() const
Get the size of the file.
bool isAudio() const
Is this an audio file.
QString getUserModifiedPath() const
Get user modified path (if isn't changed, the normal path is returned)
QString getPath() const
Get the path of the file.
Uint64 getLastChunkSize() const
Get how many bytes the files takes up of the last chunk.
virtual bool doNotDownload() const =0
Whether or not we have to not download this file.
Uint64 getFirstChunkOffset() const
Get the offset at which the file starts in the first chunk.
void setPreExisting(bool pe)
Set whether this file is preexisting.
QString getMountPoint() const
Get the mount point of the file on disk.
bool isVideo() const
Is this a video.
virtual void setDoNotDownload(bool dnd)=0
Set whether we have to not download this file.
virtual bool isMultimedia() const =0
Checks if this file is multimedial.
bool isNull() const
See if the TorrentFile is null.
Uint32 getIndex() const
Get the index of the file.