recursivecollectionfilterproxymodel.h
00001 /* 00002 Copyright (c) 2009 Stephen Kelly <steveire@gmail.com> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 00021 #ifndef AKONADI_RECURSIVECOLLECTIONFILTERPROXYMODEL_H 00022 #define AKONADI_RECURSIVECOLLECTIONFILTERPROXYMODEL_H 00023 00024 #include <krecursivefilterproxymodel.h> 00025 00026 #include "akonadi_export.h" 00027 00028 namespace Akonadi 00029 { 00030 00031 class RecursiveCollectionFilterProxyModelPrivate; 00032 00039 class AKONADI_EXPORT RecursiveCollectionFilterProxyModel : public KRecursiveFilterProxyModel 00040 { 00041 Q_OBJECT 00042 00043 public: 00049 RecursiveCollectionFilterProxyModel( QObject *parent = 0 ); 00050 00054 virtual ~RecursiveCollectionFilterProxyModel(); 00055 00061 void addContentMimeTypeInclusionFilter( const QString &mimeType ); 00062 00068 void addContentMimeTypeInclusionFilters( const QStringList &mimeTypes ); 00069 00073 void clearFilters(); 00074 00080 void setContentMimeTypeInclusionFilters( const QStringList &mimeTypes ); 00081 00085 QStringList contentMimeTypeInclusionFilters() const; 00086 00087 protected: 00088 /* reimp */ bool acceptRow( int sourceRow, const QModelIndex &sourceParent ) const; 00089 /* reimp */ int columnCount( const QModelIndex& index ) const; 00090 00091 protected: 00092 RecursiveCollectionFilterProxyModelPrivate * const d_ptr; 00093 Q_DECLARE_PRIVATE(RecursiveCollectionFilterProxyModel) 00094 }; 00095 00096 } 00097 00098 #endif