ryxeo-webphotoalbum-git / tools.h @ 83a77071
Historique | Voir | Annoter | Télécharger (2,48 ko)
1 |
/** Classe tools: regroupe ce qui est mutualisable entre assistant et appli
|
---|---|
2 |
* @see https://redmine.ryxeo.com/projects/
|
3 |
* @author 2012 Eric Seigne <eric.seigne@ryxeo.com>
|
4 |
* @see The GNU Public License (GNU/GPL) v3
|
5 |
*
|
6 |
*
|
7 |
*
|
8 |
* This program is free software; you can redistribute it and/or modify
|
9 |
* it under the terms of the GNU General Public License as published by
|
10 |
* the Free Software Foundation; either version 3 of the License, or
|
11 |
* (at your option) any later version.
|
12 |
*
|
13 |
* This program is distributed in the hope that it will be useful, but
|
14 |
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
15 |
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
16 |
* for more details.
|
17 |
*
|
18 |
* You should have received a copy of the GNU General Public License along
|
19 |
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
20 |
*/
|
21 |
|
22 |
|
23 |
#ifndef TOOLS_H
|
24 |
#define TOOLS_H
|
25 |
|
26 |
#include <QFtp> |
27 |
#include <QObject> |
28 |
#include <QStringList> |
29 |
#include <QMap> |
30 |
#include <QDebug> |
31 |
#include <QApplication> |
32 |
#include <QDir> |
33 |
#include <QThread> |
34 |
#include <QWebView> |
35 |
|
36 |
class tools : public QObject |
37 |
{ |
38 |
Q_OBJECT |
39 |
public: |
40 |
explicit tools(QDir basedir, QObject *parent = 0);
|
41 |
|
42 |
signals:
|
43 |
void signalUpload(int total, int current, QString fileName); |
44 |
void signalUploadData(int,int); |
45 |
void signalUploadEnd();
|
46 |
|
47 |
public slots: |
48 |
void ftpConnect(QString serveur, QString login, QString passwd);
|
49 |
void parcoursRecursif(QString rep, QString repertoireServeur);
|
50 |
void ftpCommandFinished(int commandId, bool error); |
51 |
void ftpDone(bool error); |
52 |
void ftpStateChanged(int state); |
53 |
void uploadRecursifPHP(QString destDirBase);
|
54 |
void uploadRecursifGallery(QString destDirBase, QString urlSite);
|
55 |
void updateDataTransferProgress(qint64 readBytes,
|
56 |
qint64 totalBytes); |
57 |
void addToList(const QUrlInfo &urlInfo); |
58 |
void clear();
|
59 |
int nbTotalUpload();
|
60 |
int nbResteUpload();
|
61 |
void ftpMkdir(QString rep);
|
62 |
void ftpPut(QString source, QString ladest);
|
63 |
void ftpUnzip(QString zipUrl);
|
64 |
void ftpNextCommand();
|
65 |
void unzipFinished(bool status); |
66 |
|
67 |
private:
|
68 |
QFtp *m_ftp; |
69 |
QDir m_baseDir; |
70 |
QString m_destDirBase; |
71 |
QString m_currentProjectDir; |
72 |
QString m_typeUploadRecursif; |
73 |
QStringList m_fileListToUploadIndex; |
74 |
QMap<QString,QString> m_fileListToUpload; |
75 |
int m_currentProjectPictureNumber;
|
76 |
int m_currentFTPFileUpload;
|
77 |
QStringList m_ftpCommands; |
78 |
QWebView *m_web; |
79 |
QString m_urlSite; |
80 |
}; |
81 |
|
82 |
#endif // TOOLS_H |