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

#include </tmp/quassel/src/client/clienttransfer.h>

Inheritance diagram for ClientTransfer:
Collaboration diagram for ClientTransfer:

Public Types

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

Public Slots

void accept (const QString &savePath) const
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

 ClientTransfer (const QUuid &uuid, QObject *parent=0)
QString savePath () const
QUuid uuid () const
State state () const
Direction direction () const
QHostAddress address () const
quint16 port () const
QString fileName () const
quint64 fileSize () const
QString nick () const
 Q_ENUMS (State) enum Direction
 Q_ENUMS (Direction) Transfer(const QUuid &uuid
virtual const QMetaObject * syncMetaObject () 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)

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 Slots

void dataReceived (PeerPtr peer, const QByteArray &data)
void onStateChanged (State state)

Private Member Functions

virtual void cleanUp ()

Private Attributes

QString _savePath
QFile * _file

Detailed Description

Definition at line 30 of file clienttransfer.h.

Member Enumeration Documentation

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

Definition at line 45 of file transfer.h.

Constructor & Destructor Documentation

ClientTransfer ( const QUuid &  uuid,
QObject *  parent = 0 
)

Member Function Documentation

QString savePath ( ) const

Definition at line 44 of file clienttransfer.cpp.

References _savePath.

Referenced by accept().

void accept ( const QString &  savePath) const
slot
void reject ( ) const
slot
void dataReceived ( PeerPtr  peer,
const QByteArray &  data 
)
privateslot

Definition at line 67 of file clienttransfer.cpp.

References _file, and _savePath.

void onStateChanged ( Transfer::State  state)
privateslot

Definition at line 88 of file clienttransfer.cpp.

References _file, Transfer::Completed, and Transfer::Failed.

void cleanUp ( )
privatevirtual

Definition at line 34 of file clienttransfer.cpp.

References _file.

QUuid uuid ( ) const
inherited
Direction direction ( ) const
inherited
QHostAddress address ( ) const
inherited
quint16 port ( ) const
inherited
QString fileName ( ) const
inherited

Referenced by Transfer::setFileName().

quint64 fileSize ( ) const
inherited
QString nick ( ) const
inherited

Referenced by Transfer::setNick().

Q_ENUMS ( State  )
inlineinherited

Definition at line 55 of file transfer.h.

Q_ENUMS ( Direction  ) const
inherited
virtual const QMetaObject* syncMetaObject ( ) const
inlinevirtualinherited

Reimplemented from SyncableObject.

Definition at line 65 of file transfer.h.

virtual void requestAccepted ( PeerPtr  peer)
inlinevirtualslotinherited

Definition at line 82 of file transfer.h.

Referenced by accept().

virtual void requestRejected ( PeerPtr  peer)
inlinevirtualslotinherited

Definition at line 83 of file transfer.h.

Referenced by reject().

void stateChanged ( State  state)
signalinherited

Referenced by Transfer::setState().

void directionChanged ( Direction  direction)
signalinherited

Referenced by Transfer::setDirection().

void addressChanged ( const QHostAddress &  address)
signalinherited

Referenced by Transfer::setAddress().

void portChanged ( quint16  port)
signalinherited

Referenced by Transfer::setPort().

void fileNameChanged ( const QString &  fileName)
signalinherited

Referenced by Transfer::setFileName().

void fileSizeChanged ( quint64  fileSize)
signalinherited

Referenced by Transfer::setFileSize().

void nickChanged ( const QString &  nick)
signalinherited

Referenced by Transfer::setNick().

void error ( const QString &  errorString)
signalinherited
void accepted ( PeerPtr  peer = 0) const
signalinherited
void rejected ( PeerPtr  peer = 0) const
signalinherited
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

QString _savePath
mutableprivate

Definition at line 52 of file clienttransfer.h.

Referenced by accept(), dataReceived(), and savePath().

QFile* _file
private

Definition at line 54 of file clienttransfer.h.

Referenced by cleanUp(), dataReceived(), and onStateChanged().

QObject* parent = 0)
inherited

Definition at line 63 of file transfer.h.

Property Documentation

QUuid uuid
readinherited

Definition at line 35 of file transfer.h.

Referenced by TransferManager::addTransfer().

Transfer::State state
readwriteinherited

Definition at line 35 of file transfer.h.

Transfer::Direction direction
readwriteinherited

Definition at line 36 of file transfer.h.

QHostAddress address
readwriteinherited

Definition at line 37 of file transfer.h.

quint16 port
readwriteinherited

Definition at line 38 of file transfer.h.

QString fileName
readwriteinherited
quint64 fileSize
readwriteinherited

Definition at line 40 of file transfer.h.

Referenced by ReceiveFileDlg::ReceiveFileDlg().

QString nick
readwriteinherited

Definition at line 41 of file transfer.h.

Referenced by ReceiveFileDlg::ReceiveFileDlg().


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