You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.7 KiB
72 lines
2.7 KiB
15 years ago
|
/* This file is part of the KDE project
|
||
|
Copyright (C) 2004 David Faure <faure@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef KIO_TRASH_H
|
||
|
#define KIO_TRASH_H
|
||
|
|
||
12 years ago
|
#include <tdeio/slavebase.h>
|
||
15 years ago
|
#include "trashimpl.h"
|
||
12 years ago
|
namespace TDEIO { class Job; }
|
||
15 years ago
|
|
||
|
typedef TrashImpl::TrashedFileInfo TrashedFileInfo;
|
||
|
typedef TrashImpl::TrashedFileInfoList TrashedFileInfoList;
|
||
|
|
||
12 years ago
|
class TrashProtocol : public TQObject, public TDEIO::SlaveBase
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
14 years ago
|
TrashProtocol( const TQCString& protocol, const TQCString &pool, const TQCString &app);
|
||
15 years ago
|
virtual ~TrashProtocol();
|
||
|
virtual void stat(const KURL& url);
|
||
|
virtual void listDir(const KURL& url);
|
||
|
virtual void get( const KURL& url );
|
||
|
virtual void put( const KURL& url, int , bool overwrite, bool );
|
||
|
virtual void rename( const KURL &, const KURL &, bool );
|
||
|
virtual void copy( const KURL &src, const KURL &dest, int permissions, bool overwrite );
|
||
|
// TODO (maybe) chmod( const KURL& url, int permissions );
|
||
|
virtual void del( const KURL &url, bool isfile );
|
||
|
/**
|
||
|
* Special actions: (first int in the byte array)
|
||
|
* 1 : empty trash
|
||
|
* 2 : migrate old (pre-kde-3.4) trash contents
|
||
|
* 3 : restore a file to its original location. Args: KURL trashURL.
|
||
|
*/
|
||
14 years ago
|
virtual void special( const TQByteArray & data );
|
||
15 years ago
|
|
||
|
private slots:
|
||
12 years ago
|
void slotData( TDEIO::Job*, const TQByteArray& );
|
||
|
void slotMimetype( TDEIO::Job*, const TQString& );
|
||
|
void jobFinished( TDEIO::Job* job );
|
||
15 years ago
|
|
||
|
private:
|
||
|
typedef enum CopyOrMove { Copy, Move };
|
||
|
void copyOrMove( const KURL& src, const KURL& dest, bool overwrite, CopyOrMove action );
|
||
12 years ago
|
void createTopLevelDirEntry(TDEIO::UDSEntry& entry);
|
||
14 years ago
|
bool createUDSEntry( const TQString& physicalPath, const TQString& fileName, const TQString& url,
|
||
12 years ago
|
TDEIO::UDSEntry& entry, const TrashedFileInfo& info );
|
||
15 years ago
|
void listRoot();
|
||
|
void restore( const KURL& trashURL );
|
||
|
|
||
|
TrashImpl impl;
|
||
14 years ago
|
TQString m_userName;
|
||
|
TQString m_groupName;
|
||
15 years ago
|
};
|
||
|
|
||
|
#endif
|