kio Library API Documentation

kfilefilter.h

00001 /* This file is part of the KDE libraries 00002 00003 Copyright (c) 2001,2002 Carsten Pfeiffer <pfeiffer@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 (LGPL) 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., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 00021 #ifndef KFILEFILTER_H 00022 #define KFILEFILTER_H 00023 00024 #include <qptrlist.h> 00025 #include <qstringlist.h> 00026 00027 #include <sys/types.h> 00028 #include <sys/stat.h> 00029 #include <unistd.h> 00030 00031 class QRegExp; 00032 class KFileItem; 00033 00039 class KFileFilter 00040 { 00041 public: 00047 virtual bool passesFilter( const KFileItem *item ) const = 0; 00048 protected: 00049 virtual void virtual_hook( int id, void* data ); 00050 }; 00051 00057 class KSimpleFileFilter : public KFileFilter 00058 { 00059 public: 00064 KSimpleFileFilter(); 00065 virtual ~KSimpleFileFilter(); 00066 00074 virtual void setFilterDotFiles( bool filter ); 00081 bool filterDotFiles() const { return m_filterDotFiles; } 00082 00087 virtual void setFilterSpecials( bool filter ); 00092 bool filterSpecials() const { return m_filterSpecials; } 00093 00094 // ### KDE4 make virtual and bool caseSensitive = false 00106 void setNameFilters( const QString& nameFilters, bool caseSensitive, 00107 const QChar& separator = ' ' ); 00115 virtual void setNameFilters( const QString& nameFilters ); 00116 00123 virtual void setMimeFilters( const QStringList& mimeFilters ); 00129 QStringList mimeFilters() const { return m_mimeFilters; } 00130 00139 virtual void setModeFilter( mode_t mode ); 00145 mode_t modeFilter() const { return m_modeFilter; } 00146 00152 virtual bool passesFilter( const KFileItem *item ) const; 00153 00154 protected: 00155 QPtrList<QRegExp> m_nameFilters; 00156 00157 private: 00158 QStringList m_mimeFilters; 00159 bool m_filterDotFiles :1; 00160 bool m_filterSpecials :1; 00161 mode_t m_modeFilter; 00162 protected: 00163 virtual void virtual_hook( int id, void* data ); 00164 private: 00165 class KSimpleFileFilterPrivate* d; 00166 }; 00167 00168 #endif // KFILEFILTER_H
KDE Logo
This file is part of the documentation for kio Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 8 11:14:57 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003