~vcs-imports/bibletime/trunk

« back to all changes in this revision

Viewing changes to bibletime/frontend/kio_ftptransport.h

  • Committer: mgruner
  • Date: 2007-05-08 15:51:07 UTC
  • Revision ID: vcs-imports@canonical.com-20070508155107-0rj7jdmm5ivf8685
-imported source and data files to new svn module
-this is where KDE4-based development will take place

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// C++ Interface: %{MODULE}
 
3
//
 
4
// Description:
 
5
//
 
6
//
 
7
// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
 
8
//
 
9
// Copyright: See COPYING file that comes with this distribution
 
10
//
 
11
//
 
12
#ifndef INSTALLATIONMANAGERKIO_FTPTRANSPORT_H
 
13
#define INSTALLATIONMANAGERKIO_FTPTRANSPORT_H
 
14
 
 
15
//Bible
 
16
//Sword includes
 
17
#include <ftptrans.h>
 
18
 
 
19
//Qt includes
 
20
#include <qobject.h>
 
21
#include <qmap.h>
 
22
 
 
23
//KDE includes
 
24
#include <kio/job.h>
 
25
 
 
26
//Std C++ includes
 
27
#include <vector>
 
28
 
 
29
 
 
30
namespace BookshelfManager {
 
31
 
 
32
class BTInstallMgr;
 
33
 
 
34
/**
 
35
* This is a reimplementation of Sword's FTP transport class which uses KDE's network functions.
 
36
 
37
* @author Joachim Ansorg
 
38
*/
 
39
class KIO_FTPTransport : public QObject, public sword::FTPTransport {
 
40
        Q_OBJECT
 
41
public:
 
42
        KIO_FTPTransport(const char *host, sword::StatusReporter *statusReporter = 0);
 
43
        virtual ~KIO_FTPTransport();
 
44
        virtual char getURL(const char *destPath, const char *sourceURL);
 
45
        virtual std::vector<struct ftpparse> getDirList(const char *dirURL);
 
46
 
 
47
protected slots:
 
48
        void slotCopyResult(KIO::Job*);
 
49
        //  void slotCopyPercent(KIO::Job*, unsigned long);
 
50
        void slotTotalSize(KIO::Job *, KIO::filesize_t);
 
51
        void slotCopyProgress(KIO::Job *, KIO::filesize_t);
 
52
        void slotDirListingCanceled();
 
53
 
 
54
private:
 
55
        QMap<int, int> m_copyResults;
 
56
        QMap<int, std::vector< struct ftpparse > > m_dirListResults;
 
57
        bool m_listingCancelled;
 
58
        int m_totalSize; //size of currently downloaded file
 
59
};
 
60
 
 
61
}
 
62
 
 
63
#endif