Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Transfer Class Reference

#include </tmp/quassel/src/common/transfer.h>

Inheritance diagram for Transfer:
Collaboration diagram for Transfer:

Public Types

enum  State {
  New, Pending, Connecting, Transferring,
  Paused, Completed, Failed, Rejected
}

Public Slots

virtual void accept (const QString &savePath) const
virtual void reject () const
virtual void requestAccepted (PeerPtr peer)
virtual void requestRejected (PeerPtr peer)
virtual void setInitialized ()
void requestUpdate (const QVariantMap &properties)
virtual void update (const QVariantMap &properties)

Signals

void stateChanged (State state)
void directionChanged (Direction direction)
void addressChanged (const QHostAddress &address)
void portChanged (quint16 port)
void fileNameChanged (const QString &fileName)
void fileSizeChanged (quint64 fileSize)
void nickChanged (const QString &nick)
void error (const QString &errorString)
void accepted (PeerPtr peer=0) const
void rejected (PeerPtr peer=0) const
void initDone ()
void updatedRemotely ()
void updated ()

Public Member Functions

 Q_ENUMS (State) enum Direction
 Q_ENUMS (Direction) Transfer(const QUuid &uuid
 Transfer (Direction direction, const QString &nick, const QString &fileName, const QHostAddress &address, quint16 port, quint64 size=0, QObject *parent=0)
virtual const QMetaObject * syncMetaObject () const
QUuid uuid () const
State state () const
Direction direction () const
QString fileName () const
QHostAddress address () const
quint16 port () const
quint64 fileSize () const
QString nick () const
virtual QVariantMap toVariantMap ()
 Stores the object's state into a QVariantMap.
virtual void fromVariantMap (const QVariantMap &properties)
 Initialize the object's state from a given QVariantMap.
virtual bool isInitialized () const
void setAllowClientUpdates (bool allow)
bool allowClientUpdates () const

Public Attributes

QObject * parent = 0)

Protected Slots

void setState (State state)
void setError (const QString &errorString)
virtual void dataReceived (PeerPtr, const QByteArray &data)
virtual void cleanUp ()=0

Protected Member Functions

void sync_call__ (SignalProxy::ProxyMode modeType, const char *funcname,...) const
void renameObject (const QString &newName)

Properties

QUuid uuid
State state
Direction direction
QHostAddress address
quint16 port
QString fileName
quint64 fileSize
QString nick

Private Member Functions

void init ()
void setDirection (Direction direction)
void setAddress (const QHostAddress &address)
void setPort (quint16 port)
void setFileName (const QString &fileName)
void setFileSize (quint64 fileSize)
void setNick (const QString &nick)

Private Attributes

State _state
Direction _direction
QString _fileName
QHostAddress _address
quint16 _port
quint64 _fileSize
QString _nick
QUuid _uuid

Static Private Attributes

static const int _classNameOffset__ = QByteArray(staticMetaObject.className()).length() + 2

Detailed Description

Definition at line 30 of file transfer.h.

Member Enumeration Documentation

enum State
Enumerator:
New 
Pending 
Connecting 
Transferring 
Paused 
Completed 
Failed 
Rejected 

Definition at line 45 of file transfer.h.

Constructor & Destructor Documentation

Transfer ( Direction  direction,
const QString &  nick,
const QString &  fileName,
const QHostAddress &  address,
quint16  port,
quint64  size = 0,
QObject *  parent = 0 
)

Definition at line 24 of file transfer.cpp.

Member Function Documentation

Q_ENUMS ( State  )
inline

Definition at line 55 of file transfer.h.

Q_ENUMS ( Direction  ) const
virtual const QMetaObject* syncMetaObject ( ) const
inlinevirtual

Reimplemented from SyncableObject.

Definition at line 65 of file transfer.h.

QUuid uuid ( ) const
Direction direction ( ) const
QString fileName ( ) const

Referenced by setFileName().

QHostAddress address ( ) const
quint16 port ( ) const
quint64 fileSize ( ) const
QString nick ( ) const

Referenced by setNick().

virtual void accept ( const QString &  savePath) const
inlinevirtualslot

Definition at line 78 of file transfer.h.

Referenced by ReceiveFileDlg::on_buttonBox_clicked().

virtual void reject ( ) const
inlinevirtualslot

Definition at line 79 of file transfer.h.

virtual void requestAccepted ( PeerPtr  peer)
inlinevirtualslot

Definition at line 82 of file transfer.h.

Referenced by ClientTransfer::accept().

virtual void requestRejected ( PeerPtr  peer)
inlinevirtualslot

Definition at line 83 of file transfer.h.

Referenced by ClientTransfer::reject().

void stateChanged ( State  state)
signal

Referenced by setState().

void directionChanged ( Direction  direction)
signal

Referenced by setDirection().

void addressChanged ( const QHostAddress &  address)
signal

Referenced by setAddress().

void portChanged ( quint16  port)
signal

Referenced by setPort().

void fileNameChanged ( const QString &  fileName)
signal

Referenced by setFileName().

void fileSizeChanged ( quint64  fileSize)
signal

Referenced by setFileSize().

void nickChanged ( const QString &  nick)
signal

Referenced by setNick().

void error ( const QString &  errorString)
signal
void accepted ( PeerPtr  peer = 0) const
signal
void rejected ( PeerPtr  peer = 0) const
signal
void setError ( const QString &  errorString)
protectedslot
virtual void dataReceived ( PeerPtr  ,
const QByteArray &  data 
)
inlineprotectedvirtualslot

Definition at line 104 of file transfer.h.

Referenced by CoreTransfer::relayData().

virtual void cleanUp ( )
protectedpure virtualslot

Referenced by setError().

void init ( )
private
void setDirection ( Direction  direction)
private

Definition at line 86 of file transfer.cpp.

References _direction, ARG, direction(), directionChanged(), and SYNC.

void setAddress ( const QHostAddress &  address)
private

Definition at line 102 of file transfer.cpp.

References _address, address(), addressChanged(), ARG, and SYNC.

void setPort ( quint16  port)
private

Definition at line 118 of file transfer.cpp.

References _port, ARG, port(), portChanged(), and SYNC.

void setFileName ( const QString &  fileName)
private

Definition at line 134 of file transfer.cpp.

References _fileName, ARG, fileName(), fileNameChanged(), and SYNC.

void setFileSize ( quint64  fileSize)
private

Definition at line 150 of file transfer.cpp.

References _fileSize, ARG, fileSize(), fileSizeChanged(), and SYNC.

void setNick ( const QString &  nick)
private

Definition at line 166 of file transfer.cpp.

References _nick, ARG, nick(), nickChanged(), and SYNC.

QVariantMap toVariantMap ( )
virtualinherited

Stores the object's state into a QVariantMap.

The default implementation takes dynamic properties as well as getters that have names starting with "init" and stores them in a QVariantMap. Override this method in derived classes in order to store the object state in a custom form.

Note
This is used by SignalProxy to transmit the state of the object to clients that request the initial object state. Later updates use a different mechanism and assume that the state is completely covered by properties and init* getters. DO NOT OVERRIDE THIS unless you know exactly what you do!
Returns
The object's state in a QVariantMap

Definition at line 91 of file syncableobject.cpp.

References SignalProxy::ExtendedMetaObject::methodBaseName(), and SignalProxy::ExtendedMetaObject::methodName().

Referenced by BufferViewSettingsPage::cloneConfig(), AliasesModel::commit(), IgnoreListModel::commit(), ClientBufferViewConfig::ensureDecoration(), IrcConnectionWizard::finishClicked(), SignalProxy::initData(), CoreNetworkConfig::save(), BufferViewSettingsPage::save(), and ClientBufferViewManager::setInitialized().

void fromVariantMap ( const QVariantMap &  properties)
virtualinherited

Initialize the object's state from a given QVariantMap.

See Also
toVariantMap() for important information concerning this method.

Definition at line 135 of file syncableobject.cpp.

References SyncableObject::setInitValue().

Referenced by BufferViewConfig::BufferViewConfig(), BufferViewSettingsPage::cloneConfig(), Network::newIrcChannel(), Network::newIrcUser(), SignalProxy::setInitData(), and SyncableObject::update().

void setAllowClientUpdates ( bool  allow)
inlineinherited
bool allowClientUpdates ( ) const
inlineinherited

Definition at line 82 of file syncableobject.h.

References SyncableObject::_allowClientUpdates.

Referenced by SyncableObject::requestUpdate().

void update ( const QVariantMap &  properties)
virtualslotinherited
void sync_call__ ( SignalProxy::ProxyMode  modeType,
const char *  funcname,
  ... 
) const
protectedinherited
void renameObject ( const QString &  newName)
protectedinherited
void initDone ( )
signalinherited
void updatedRemotely ( )
signalinherited
void updated ( )
signalinherited

Member Data Documentation

const int _classNameOffset__ = QByteArray(staticMetaObject.className()).length() + 2
staticprivate

Definition at line 33 of file transfer.h.

QObject* parent = 0)

Definition at line 63 of file transfer.h.

State _state
private

Definition at line 119 of file transfer.h.

Referenced by setState().

Direction _direction
private

Definition at line 120 of file transfer.h.

Referenced by setDirection().

QString _fileName
private

Definition at line 121 of file transfer.h.

Referenced by setFileName().

QHostAddress _address
private

Definition at line 122 of file transfer.h.

Referenced by setAddress().

quint16 _port
private

Definition at line 123 of file transfer.h.

Referenced by setPort().

quint64 _fileSize
private

Definition at line 124 of file transfer.h.

Referenced by setFileSize().

QString _nick
private

Definition at line 125 of file transfer.h.

Referenced by setNick().

QUuid _uuid
private

Definition at line 126 of file transfer.h.

Referenced by init().

Property Documentation

QUuid uuid
read

Definition at line 35 of file transfer.h.

Referenced by TransferManager::addTransfer().

Transfer::State state
readwrite

Definition at line 35 of file transfer.h.

Transfer::Direction direction
readwrite

Definition at line 36 of file transfer.h.

QHostAddress address
readwrite

Definition at line 37 of file transfer.h.

quint16 port
readwrite

Definition at line 38 of file transfer.h.

QString fileName
readwrite
quint64 fileSize
readwrite

Definition at line 40 of file transfer.h.

Referenced by ReceiveFileDlg::ReceiveFileDlg().

QString nick
readwrite

Definition at line 41 of file transfer.h.

Referenced by ReceiveFileDlg::ReceiveFileDlg().


The documentation for this class was generated from the following files: