kmobiletools
p2kimpl.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef P2KIMPL_H
00021 #define P2KIMPL_H
00022
00023 #include <kio/global.h>
00024 #include <kio/job.h>
00025 #include <kurl.h>
00026 #include <dcopobject.h>
00027
00028 #include <qobject.h>
00029 #include <qstring.h>
00030
00031 #include <Q3ValueList>
00032
00033 #include <p2kmoto.h>
00034
00035 class P2KWrapper;
00036 class P2KImpl : public QObject
00037 {
00038 Q_OBJECT
00039 public:
00040 P2KImpl();
00041
00042 void createTopLevelEntry(KIO::UDSEntry& entry) const;
00043
00044 bool listRoot(const KUrl &url, Q3ValueList<KIO::UDSEntry> &list);
00045 bool listDirectory(const KUrl &url, Q3ValueList<KIO::UDSEntry> &list);
00046 bool statEntry(const KUrl &url, KIO::UDSEntry &entry);
00047 P2KWrapper* wrapper() { return p2kWrapper; }
00048
00049 int lastErrorCode() const { return m_lastErrorCode; }
00050 QString lastErrorMessage() const { return m_lastErrorMessage; }
00051
00052 private slots:
00053 void slotEntries(KIO::Job *job, const KIO::UDSEntryList &list);
00054 void slotResult(KIO::Job *job);
00055
00056 private:
00057 void createEntry(KIO::UDSEntry& entry, const QString &directory, const QString &file, bool isDrive=false);
00058 void createEntry(KIO::UDSEntry& entry, const QString &directory, p2k_fileInfo &file);
00059 void createEntry(KIO::UDSEntry& entry, const KUrl &url, p2k_fileInfo &file);
00060
00061 bool m_lastListingEmpty;
00062
00065 int m_lastErrorCode;
00066 QString m_lastErrorMessage;
00067 P2KWrapper *p2kWrapper;
00068 public slots:
00069 void fetchFilesList();
00070 int getFile(const KUrl &url, char* buffer);
00071 };
00072
00073 #endif