LeechCraft Azoth  0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
itransfermanager.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #ifndef PLUGINS_AZOTH_INTERFACES_ITRANSFERMANAGER_H
10 #define PLUGINS_AZOTH_INTERFACES_ITRANSFERMANAGER_H
11 #include <QObject>
12 #include <QString>
13 
14 namespace LC
15 {
16 namespace Azoth
17 {
21  {
24  TDIn,
27  TDOut
28  };
29 
33  {
37  TSOffer,
38 
43 
46  TSTransfer,
47 
51  };
52 
55  enum TransferError
56  {
59  TENoError,
60 
64  TEAborted,
65 
71 
75 
79  };
80 
84  class ITransferJob
85  {
86  public:
87  virtual ~ITransferJob () {}
88 
97  virtual QString GetSourceID () const = 0;
98 
103  virtual QString GetName () const = 0;
104 
109  virtual qint64 GetSize () const = 0;
110 
115  virtual QString GetComment () const = 0;
116 
121  virtual TransferDirection GetDirection () const = 0;
122 
131  virtual void Accept (const QString& out) = 0;
132 
138  virtual void Abort () = 0;
139  protected:
147  virtual void transferProgress (qint64 done, qint64 total) = 0;
148 
156  virtual void errorAppeared (TransferError error, const QString& msg) = 0;
157 
164  virtual void stateChanged (TransferState state) = 0;
165  };
166 
170  class ITransferManager
171  {
172  public:
173  virtual ~ITransferManager () {}
174 
188  virtual bool IsAvailable () const = 0;
189 
214  virtual QObject* SendFile (const QString& id,
215  const QString& variant,
216  const QString& name,
217  const QString& comment) = 0;
218  protected:
233  virtual void fileOffered (QObject *job) = 0;
234  };
235 }
236 }
237 
238 Q_DECLARE_INTERFACE (LC::Azoth::ITransferJob,
239  "org.Deviant.LeechCraft.Azoth.ITransferJob/1.0")
240 Q_DECLARE_INTERFACE (LC::Azoth::ITransferManager,
241  "org.Deviant.LeechCraft.Azoth.ITransferManager/1.0")
242 
243 #endif
LC::Azoth::ITransferJob::GetName
virtual QString GetName() const =0
Returns the name of the file.
LC::Azoth::TSTransfer
@ TSTransfer
Definition: itransfermanager.h:58
LC::Azoth::ITransferJob::errorAppeared
virtual void errorAppeared(TransferError error, const QString &msg)=0
Notifies about error.
LC::Azoth::ITransferManager::IsAvailable
virtual bool IsAvailable() const =0
Returns whether transfer manager is available.
LC::Azoth::TEFileCorruptError
@ TEFileCorruptError
Definition: itransfermanager.h:86
LC::Azoth::ITransferJob::GetComment
virtual QString GetComment() const =0
Returns the human-readable comment.
LC::Azoth::ITransferJob::Abort
virtual void Abort()=0
Rejects or aborts a transfer.
LC::Azoth::TSFinished
@ TSFinished
Definition: itransfermanager.h:62
LC::Azoth::TEAborted
@ TEAborted
Definition: itransfermanager.h:76
LC::Azoth::TransferDirection
TransferDirection
Represents the direction of the transfer.
Definition: itransfermanager.h:32
LC::Azoth::ITransferJob::GetSourceID
virtual QString GetSourceID() const =0
Returns the ID of the other party.
LC::Azoth::TSStarting
@ TSStarting
Definition: itransfermanager.h:54
LC::Azoth::ITransferJob::transferProgress
virtual void transferProgress(qint64 done, qint64 total)=0
Notifies about transfer progress.
LC::Azoth::TDIn
@ TDIn
Definition: itransfermanager.h:42
LC::Azoth::ITransferManager::fileOffered
virtual void fileOffered(QObject *job)=0
Notifies about incoming transfer request.
LC::Azoth::ITransferJob::GetSize
virtual qint64 GetSize() const =0
Returns the size of the file.
LC::Azoth::ITransferJob::stateChanged
virtual void stateChanged(TransferState state)=0
Notifies about state changes.
LC::Azoth::ITransferJob::Accept
virtual void Accept(const QString &out)=0
Accepts an incoming transfer.
LC::Azoth::TDOut
@ TDOut
Definition: itransfermanager.h:45
LC::Azoth::TENoError
@ TENoError
Definition: itransfermanager.h:71
LC::Azoth::TransferError
TransferError
Represents the error condition of the transfer.
Definition: itransfermanager.h:67
LC::Azoth::TransferState
TransferState
Represents the state of the file transfer job.
Definition: itransfermanager.h:44
LC::Azoth::ITransferJob
This interface must be implemented by objects representing file transfer jobs.
Definition: itransfermanager.h:96
LC
Definition: activityinfo.h:13
LC::Azoth::TEFileAccessError
@ TEFileAccessError
Definition: itransfermanager.h:82
LC::Azoth::ITransferJob::~ITransferJob
virtual ~ITransferJob()
Definition: itransfermanager.h:99
LC::Azoth::ITransferJob::GetDirection
virtual TransferDirection GetDirection() const =0
Returns the direction of the transfer.
LC::Azoth::ITransferManager::~ITransferManager
virtual ~ITransferManager()
Definition: itransfermanager.h:185
LC::Azoth::ITransferManager::SendFile
virtual QObject * SendFile(const QString &id, const QString &variant, const QString &name, const QString &comment)=0
Requests a file transfer with the remote party.
LC::Azoth::TSOffer
@ TSOffer
Definition: itransfermanager.h:49
LC::Azoth::TEProtocolError
@ TEProtocolError
Definition: itransfermanager.h:90