kio
kfilefilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 #include <kdelibs_export.h>
00032
00033 class QRegExp;
00034 class KFileItem;
00035
00041 class KIO_EXPORT KFileFilter
00042 {
00043 public:
00049 virtual bool passesFilter( const KFileItem *item ) const = 0;
00050 protected:
00051 virtual void virtual_hook( int id, void* data );
00052 };
00053
00059 class KIO_EXPORT KSimpleFileFilter : public KFileFilter
00060 {
00061 public:
00066 KSimpleFileFilter();
00067 virtual ~KSimpleFileFilter();
00068
00076 virtual void setFilterDotFiles( bool filter );
00083 bool filterDotFiles() const { return m_filterDotFiles; }
00084
00089 virtual void setFilterSpecials( bool filter );
00094 bool filterSpecials() const { return m_filterSpecials; }
00095
00096
00108 void setNameFilters( const QString& nameFilters, bool caseSensitive,
00109 const QChar& separator = ' ' );
00117 virtual void setNameFilters( const QString& nameFilters );
00118
00125 virtual void setMimeFilters( const QStringList& mimeFilters );
00131 QStringList mimeFilters() const { return m_mimeFilters; }
00132
00141 virtual void setModeFilter( mode_t mode );
00147 mode_t modeFilter() const { return m_modeFilter; }
00148
00154 virtual bool passesFilter( const KFileItem *item ) const;
00155
00156 protected:
00157 QPtrList<QRegExp> m_nameFilters;
00158
00159 private:
00160 QStringList m_mimeFilters;
00161 bool m_filterDotFiles :1;
00162 bool m_filterSpecials :1;
00163 mode_t m_modeFilter;
00164 protected:
00165 virtual void virtual_hook( int id, void* data );
00166 private:
00167 class KSimpleFileFilterPrivate* d;
00168 };
00169
00170 #endif // KFILEFILTER_H