ryxeo-webphotoalbum-git / tools.h @ 1b04db7c
Historique | Voir | Annoter | Télécharger (2,52 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 |
#include "qurlinfo.h" |
36 |
#include "qftp.h" |
37 |
|
38 |
class tools : public QObject |
39 |
{ |
40 |
Q_OBJECT |
41 |
public: |
42 |
explicit tools(QDir basedir, QObject *parent = 0);
|
43 |
|
44 |
signals:
|
45 |
void signalUpload(int total, int current, QString fileName); |
46 |
void signalUploadData(int,int); |
47 |
void signalUploadEnd();
|
48 |
|
49 |
public slots: |
50 |
void ftpConnect(QString serveur, QString login, QString passwd);
|
51 |
void parcoursRecursif(QString rep, QString repertoireServeur);
|
52 |
void ftpCommandFinished(int commandId, bool error); |
53 |
void ftpDone(bool error); |
54 |
void ftpStateChanged(int state); |
55 |
void uploadRecursifPHP(QString destDirBase);
|
56 |
void uploadRecursifGallery(QString destDirBase, QString urlSite);
|
57 |
void updateDataTransferProgress(qint64 readBytes,
|
58 |
qint64 totalBytes); |
59 |
void addToList(const QUrlInfo &urlInfo); |
60 |
void clear();
|
61 |
int nbTotalUpload();
|
62 |
int nbResteUpload();
|
63 |
void ftpMkdir(QString rep);
|
64 |
void ftpPut(QString source, QString ladest);
|
65 |
void ftpUnzip(QString zipUrl);
|
66 |
void ftpNextCommand();
|
67 |
void unzipFinished(bool status); |
68 |
|
69 |
private:
|
70 |
QFtp *m_ftp; |
71 |
QDir m_baseDir; |
72 |
QString m_destDirBase; |
73 |
QString m_currentProjectDir; |
74 |
QString m_typeUploadRecursif; |
75 |
QStringList m_fileListToUploadIndex; |
76 |
QMap<QString,QString> m_fileListToUpload; |
77 |
int m_currentProjectPictureNumber;
|
78 |
int m_currentFTPFileUpload;
|
79 |
QStringList m_ftpCommands; |
80 |
QWebView *m_web; |
81 |
QString m_urlSite; |
82 |
}; |
83 |
|
84 |
#endif // TOOLS_H |