00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KIO_TRASH_H
00021 #define KIO_TRASH_H
00022
00023 #include <kio/slavebase.h>
00024 #include "trashimpl.h"
00025 namespace KIO { class Job; }
00026
00027 typedef TrashImpl::TrashedFileInfo TrashedFileInfo;
00028 typedef TrashImpl::TrashedFileInfoList TrashedFileInfoList;
00029
00030 class TrashProtocol : public TQObject, public KIO::SlaveBase
00031 {
00032 Q_OBJECT
00033 public:
00034 TrashProtocol( const TQCString& protocol, const TQCString &pool, const TQCString &app);
00035 virtual ~TrashProtocol();
00036 virtual void stat(const KURL& url);
00037 virtual void listDir(const KURL& url);
00038 virtual void get( const KURL& url );
00039 virtual void put( const KURL& url, int , bool overwrite, bool );
00040 virtual void rename( const KURL &, const KURL &, bool );
00041 virtual void copy( const KURL &src, const KURL &dest, int permissions, bool overwrite );
00042
00043 virtual void del( const KURL &url, bool isfile );
00050 virtual void special( const TQByteArray & data );
00051
00052 private slots:
00053 void slotData( KIO::Job*, const TQByteArray& );
00054 void slotMimetype( KIO::Job*, const TQString& );
00055 void jobFinished( KIO::Job* job );
00056
00057 private:
00058 typedef enum CopyOrMove { Copy, Move };
00059 void copyOrMove( const KURL& src, const KURL& dest, bool overwrite, CopyOrMove action );
00060 void createTopLevelDirEntry(KIO::UDSEntry& entry);
00061 bool createUDSEntry( const TQString& physicalPath, const TQString& fileName, const TQString& url,
00062 KIO::UDSEntry& entry, const TrashedFileInfo& info );
00063 void listRoot();
00064 void restore( const KURL& trashURL );
00065
00066 TrashImpl impl;
00067 TQString m_userName;
00068 TQString m_groupName;
00069 };
00070
00071 #endif