chmodjob.h

00001 // -*- c++ -*-
00002 /* This file is part of the KDE libraries
00003     Copyright (C) 2000 David Faure <faure@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef __kio_chmodjob_h__
00022 #define __kio_chmodjob_h__
00023 
00024 #include <kurl.h>
00025 #include <qstring.h>
00026 
00027 #include <kio/global.h>
00028 #include <kio/job.h>
00029 #include <kfileitem.h>
00030 
00031 /*
00032 
00033  NOTE : This job is currently in ksycoca because kfileitem needs to know
00034  about mimetypes. For KDE 3.0, make a base class for KFileItem, that holds
00035  all the information except the mimetype, so that jobs can use it.
00036 
00037 */
00038 
00039 namespace KIO {
00040 
00046     class KIO_EXPORT ChmodJob : public KIO::Job
00047     {
00048         Q_OBJECT
00049     public:
00053         ChmodJob( const KFileItemList & lstItems,  int permissions, int mask,
00054                   int newOwner, int newGroup,
00055                   bool recursive, bool showProgressInfo );
00056 
00057     protected:
00058         void chmodNextFile();
00059 
00060     protected slots:
00061 
00062         virtual void slotResult( KIO::Job *job );
00063         void slotEntries( KIO::Job * , const KIO::UDSEntryList & );
00064         void processList();
00065 
00066     private:
00067         struct ChmodInfo
00068         {
00069             KURL url;
00070             int permissions;
00071         };
00072         enum { STATE_LISTING, STATE_CHMODING } state;
00073         int m_permissions;
00074         int m_mask;
00075         int m_newOwner;
00076         int m_newGroup;
00077         bool m_recursive;
00078         KFileItemList m_lstItems;
00079         QValueList<ChmodInfo> m_infos;
00080     protected:
00081     virtual void virtual_hook( int id, void* data );
00082     private:
00083     class ChmodJobPrivate* d;
00084     };
00085 
00086 
00111     KIO_EXPORT ChmodJob * chmod( const KFileItemList& lstItems, int permissions, int mask,
00112                       QString newOwner, QString newGroup,
00113                       bool recursive, bool showProgressInfo = true );
00114 
00115 }
00116 
00117 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys