1 /***************************************************************************
2 * Copyright (C) 2005-2013 by the Quassel Project *
3 * devel@quassel-irc.org *
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) version 3. *
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. *
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 ***************************************************************************/
24 #include <QHostAddress>
27 #include "syncableobject.h"
29 class Transfer : public SyncableObject
34 Q_PROPERTY(QUuid uuid READ uuid);
35 Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged);
36 Q_PROPERTY(Direction direction READ direction WRITE setDirection NOTIFY directionChanged);
37 Q_PROPERTY(QHostAddress address READ address WRITE setAddress NOTIFY addressChanged);
38 Q_PROPERTY(quint16 port READ port WRITE setPort NOTIFY portChanged);
39 Q_PROPERTY(QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged);
40 Q_PROPERTY(quint64 fileSize READ fileSize WRITE setFileSize NOTIFY fileSizeChanged);
60 Transfer(const QUuid &uuid, QObject *parent = 0); // for creating a syncable object client-side
61 Transfer(Direction direction, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size = 0, QObject *parent = 0);
65 Direction direction() const;
66 QString fileName() const;
67 QHostAddress address() const;
69 quint64 fileSize() const;
72 void stateChanged(State state);
73 void directionChanged(Direction direction);
74 void addressChanged(const QHostAddress &address);
75 void portChanged(quint16 port);
76 void fileNameChanged(const QString &fileName);
77 void fileSizeChanged(quint64 fileSize);
80 void setState(State state);
83 void setDirection(Direction direction);
84 void setAddress(const QHostAddress &address);
85 void setPort(quint16 port);
86 void setFileName(const QString &fileName);
87 void setFileSize(quint64 fileSize);
93 QHostAddress _address;