summaryrefslogtreecommitdiff
path: root/plugins/CopyEngine/Ultracopier-0.3/factory.h
blob: bf41a272d31d437ce5f9567d907530cb0040a5c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/** \file factory.h
\brief Define the factory to create new instance
\author alpha_one_x86
\version 0.3
\date 2010 */

#include <QObject>
#include <QList>
#include <QStringList>
#include <QFileInfo>
#include <QProcess>

#include "../../../interface/PluginInterface_CopyEngine.h"
#include "StructEnumDefinition.h"
#include "ui_options.h"
#include "copyEngine.h"
#include "Environment.h"

#ifndef FACTORY_H
#define FACTORY_H

namespace Ui {
	class options;
}

/** \brief to generate copy engine instance */
class Factory : public PluginInterface_CopyEngineFactory
{
	Q_OBJECT
	Q_INTERFACES(PluginInterface_CopyEngineFactory)
public:
	Factory();
	~Factory();
	/// \brief to return the instance of the copy engine
	PluginInterface_CopyEngine * getInstance();
	/// \brief set the resources, to store options, to have facilityInterface
	void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityInterface,const bool &portableVersion);
	//get mode allowed
	/// \brief define if can copy file, folder or both
	CopyType getCopyType();
	/// \brief to return which kind of transfer list operation is supported
	TransferListOperation getTransferListOperation();
	/// \brief define if can only copy, or copy and move
	bool canDoOnlyCopy();
	/// \brief to get the supported protocols for the source
	QStringList supportedProtocolsForTheSource();
	/// \brief to get the supported protocols for the destination
	QStringList supportedProtocolsForTheDestination();
	/// \brief to get the options of the copy engine
	QWidget * options();
private:
	Ui::options *ui;
	QWidget* tempWidget;
	OptionInterface * optionsEngine;
	QStringList mountSysPoint;
	QProcess mount;
	QString StandardError;
	QString StandardOutput;
	bool errorFound;
	FacilityInterface * facilityEngine;
private slots:
	void error(QProcess::ProcessError error);
	void finished(int exitCode, QProcess::ExitStatus exitStatus);
	void readyReadStandardError();
	void readyReadStandardOutput();
	void setDoRightTransfer(bool doRightTransfer);
	void setKeepDate(bool keepDate);
	void setBlockSize(int blockSize);
	void setAutoStart(bool autoStart);
public slots:
	void resetOptions();
	void newLanguageLoaded();
signals:
	void reloadLanguage();
	#ifdef ULTRACOPIER_PLUGIN_DEBUG
	/// \brief To debug source
	void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne);
	#endif
};

#endif // FACTORY_H