home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kio / file.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-01-15  |  3.2 KB  |  99 lines

  1. /*
  2.    Copyright (C) 2000-2002 Stephan Kulow <coolo@kde.org>
  3.    Copyright (C) 2000-2002 David Faure <faure@kde.org>
  4.    Copyright (C) 2000-2002 Waldo Bastian <bastian@kde.org>
  5.  
  6.    This library is free software; you can redistribute it and/or
  7.    modify it under the terms of the GNU Library General Public
  8.    License (LGPL) as published by the Free Software Foundation;
  9.    either version 2 of the License, or (at your option) any later
  10.    version.
  11.  
  12.    This library is distributed in the hope that it will be useful,
  13.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.    Library General Public License for more details.
  16.  
  17.    You should have received a copy of the GNU Library General Public License
  18.    along with this library; see the file COPYING.LIB.  If not, write to
  19.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  20.    Boston, MA 02110-1301, USA.
  21. */
  22.  
  23. #ifndef __file_h__
  24. #define __file_h__ "$Id: file.h 591636 2006-10-02 21:47:38Z adridg $"
  25.  
  26. #include <sys/types.h>
  27. #include <sys/stat.h>
  28.  
  29. #include <stdio.h>
  30. #include <unistd.h>
  31.  
  32. #include <qobject.h>
  33. #include <qintdict.h>
  34. #include <qstring.h>
  35. #include <qvaluelist.h>
  36.  
  37. #include <kio/global.h>
  38. #include <kio/slavebase.h>
  39.  
  40. // Note that this header file is installed, so think twice
  41. // before breaking binary compatibility (read: it is forbidden :)
  42.  
  43. class FileProtocol : public QObject, public KIO::SlaveBase
  44. {
  45.   Q_OBJECT
  46. public:
  47.   FileProtocol( const QCString &pool, const QCString &app);
  48.   virtual ~FileProtocol() { }
  49.  
  50.   virtual void get( const KURL& url );
  51.   virtual void put( const KURL& url, int permissions,
  52.             bool overwrite, bool resume );
  53.   virtual void copy( const KURL &src, const KURL &dest,
  54.                      int permissions, bool overwrite );
  55.   virtual void rename( const KURL &src, const KURL &dest,
  56.                        bool overwrite );
  57.   virtual void symlink( const QString &target, const KURL &dest,
  58.                         bool overwrite );
  59.  
  60.   virtual void stat( const KURL& url );
  61.   virtual void listDir( const KURL& url );
  62.   virtual void mkdir( const KURL& url, int permissions );
  63.   virtual void chmod( const KURL& url, int permissions );
  64.   virtual void del( const KURL& url, bool isfile);
  65.  
  66.   /**
  67.    * Special commands supported by this slave:
  68.    * 1 - mount
  69.    * 2 - unmount
  70.    * 3 - shred
  71.    */
  72.   virtual void special( const QByteArray &data);
  73.   void unmount( const QString& point );
  74.   void mount( bool _ro, const char *_fstype, const QString& dev, const QString& point );
  75.   bool pumount( const QString &point );
  76.   bool pmount( const QString &dev );
  77.  
  78. protected slots:
  79.   void slotProcessedSize( KIO::filesize_t _bytes );
  80.   void slotInfoMessage( const QString & msg );
  81.  
  82. protected:
  83.  
  84.   bool createUDSEntry( const QString & filename, const QCString & path, KIO::UDSEntry & entry, 
  85.                        short int details, bool withACL );
  86.   int setACL( const char *path, mode_t perm, bool _directoryDefault );
  87.   
  88.   QString getUserName( uid_t uid );
  89.   QString getGroupName( gid_t gid );
  90.  
  91.   QIntDict<QString> usercache;      // maps long ==> QString *
  92.   QIntDict<QString> groupcache;
  93.  
  94.   class FileProtocolPrivate;
  95.   FileProtocolPrivate *d;
  96. };
  97.  
  98. #endif
  99.