2010-08-01 16:13:27 +02:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-08-01 16:13:27 +02:00
|
|
|
|
|
|
|
Clementine is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AFCTRANSFER_H
|
|
|
|
#define AFCTRANSFER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2010-08-09 21:24:17 +02:00
|
|
|
#include <QStringList>
|
2010-08-01 16:13:27 +02:00
|
|
|
|
2010-08-09 23:32:25 +02:00
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
|
|
class ConnectedDevice;
|
2010-08-01 16:13:27 +02:00
|
|
|
class iMobileDeviceConnection;
|
|
|
|
class TaskManager;
|
|
|
|
|
2010-08-09 21:24:17 +02:00
|
|
|
class QIODevice;
|
|
|
|
|
2010-08-01 16:13:27 +02:00
|
|
|
class AfcTransfer : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
AfcTransfer(const QString& uuid, const QString& local_destination,
|
2010-08-09 23:32:25 +02:00
|
|
|
TaskManager* task_manager, boost::shared_ptr<ConnectedDevice> device);
|
|
|
|
~AfcTransfer();
|
2010-08-01 16:13:27 +02:00
|
|
|
|
2010-08-14 13:16:11 +02:00
|
|
|
bool CopyToDevice(iMobileDeviceConnection* connection);
|
2010-08-09 21:24:17 +02:00
|
|
|
|
2010-08-01 16:13:27 +02:00
|
|
|
public slots:
|
|
|
|
void CopyFromDevice();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void TaskStarted(int task_id);
|
2010-08-09 21:24:17 +02:00
|
|
|
void CopyFinished(bool success);
|
2010-08-01 16:13:27 +02:00
|
|
|
|
|
|
|
private:
|
2010-08-09 21:24:17 +02:00
|
|
|
bool CopyDirFromDevice(iMobileDeviceConnection* c, const QString& path);
|
|
|
|
bool CopyDirToDevice(iMobileDeviceConnection* c, const QString& path);
|
|
|
|
bool CopyFileFromDevice(iMobileDeviceConnection* c, const QString& path);
|
|
|
|
bool CopyFileToDevice(iMobileDeviceConnection* c, const QString& path);
|
|
|
|
|
2010-08-01 16:13:27 +02:00
|
|
|
private:
|
2010-08-09 23:32:25 +02:00
|
|
|
boost::shared_ptr<ConnectedDevice> device_;
|
2010-08-01 16:13:27 +02:00
|
|
|
QThread* original_thread_;
|
|
|
|
|
|
|
|
TaskManager* task_manager_;
|
|
|
|
QString uuid_;
|
|
|
|
QString local_destination_;
|
2010-08-09 21:24:17 +02:00
|
|
|
|
|
|
|
QStringList important_directories_;
|
2010-08-01 16:13:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // AFCTRANSFER_H
|