-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqtorrentobject.h
executable file
·74 lines (59 loc) · 2.3 KB
/
qtorrentobject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef QTORRENTOBJECT_H
#define QTORRENTOBJECT_H
#include <QObject>
#include <QDate>
#include "ArgoLoader.h"
class QTorrentObject : public QObject
{
Q_OBJECT
public:
explicit QTorrentObject(QObject *parent = 0);
QTorrentObject(const QString& name, int totalBytes);
QTorrentObject(const QTorrentObject& obj);
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(int speed READ speed WRITE setSpeed NOTIFY speedChanged)
Q_PROPERTY(int totalBytes READ totalBytes WRITE setTotalBytes NOTIFY totalBytesChanged)
Q_PROPERTY(int bytesDownloaded READ bytesDownloaded WRITE setBytesDownloaded NOTIFY bytesDownloadedChanged)
Q_PROPERTY(QDateTime dateTimeAdded READ dateTimeAdded WRITE setdateTimeAdded NOTIFY dateTimeAddedChanged)
Q_PROPERTY(QString torrentStatus READ torrentStatus WRITE setTorrentStatus NOTIFY torrentStatusChanged)
// Getters/Setters
int bytesDownloaded() const;
void setBytesDownloaded(int bytesDownloaded);
int piecesDownloaded() const;
void setPiecesDownloaded(int piecesDownloaded);
int totalBytes() const;
void setTotalBytes(int totalBytes);
int totalPieces() const;
void setTotalPieces(int totalPieces);
void setPieceSize(int pieceSize);
int speed() const;
void setSpeed(int speed);
QString name() const;
void setName(const QString &name);
const Argo::SHA1Hash& hash() const;
void setHash(const Argo::SHA1Hash &hash);
QDateTime dateTimeAdded() const;
void setdateTimeAdded(const QDateTime &dateTimeAdded);
void setTorrentStatus(const QString& status);
QString torrentStatus() const;
signals:
void nameChanged(QString newName);
void speedChanged(int newSpeed);
void totalBytesChanged(int newTotalBytes);
void bytesDownloadedChanged(int newBytesDownloaded);
void dateTimeAddedChanged(QDateTime newdateTimeAdded);
void torrentStatusChanged(QString status);
public slots:
private:
QString m_name;
int m_speed;
int m_totalBytes;
int m_total_pieces;
int m_have_pieces;
int m_bytesDownloaded;
int m_pieceSize;
QDateTime m_dateTimeAdded;
Argo::SHA1Hash m_hash;
QString m_status;
};
#endif // QTORRENTOBJECT_H