akonadi
statisticsproxymodel.h
00001 /* 00002 Copyright (c) 2009 Kevin Ottens <ervin@kde.org> 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 #ifndef AKONADI_STATISTICSPROXYMODEL_H 00021 #define AKONADI_STATISTICSPROXYMODEL_H 00022 00023 #include "akonadi_export.h" 00024 00025 #include <QtGui/QSortFilterProxyModel> 00026 00027 namespace Akonadi { 00028 00050 class AKONADI_EXPORT StatisticsProxyModel : public QSortFilterProxyModel 00051 { 00052 Q_OBJECT 00053 00054 public: 00060 explicit StatisticsProxyModel( QObject *parent = 0 ); 00061 00065 virtual ~StatisticsProxyModel(); 00066 00070 void setToolTipEnabled( bool enable); 00071 00075 bool isToolTipEnabled() const; 00076 00080 void setExtraColumnsEnabled( bool enable); 00081 00085 bool isExtraColumnsEnabled() const; 00086 00087 00088 virtual QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const; 00089 virtual QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const; 00090 virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; 00091 virtual Qt::ItemFlags flags ( const QModelIndex & index ) const; 00092 virtual int columnCount( const QModelIndex & parent = QModelIndex() ) const; 00093 00094 virtual QModelIndexList match( const QModelIndex& start, int role, const QVariant& value, int hits = 1, 00095 Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) ) const; 00096 00097 virtual void setSourceModel(QAbstractItemModel* sourceModel); 00098 virtual void connectNotify(const char* signal); 00099 00100 private: 00101 //@cond PRIVATE 00102 class Private; 00103 Private* const d; 00104 00105 Q_PRIVATE_SLOT( d, void proxyDataChanged( QModelIndex, QModelIndex ) ) 00106 Q_PRIVATE_SLOT( d, void sourceLayoutAboutToBeChanged() ) 00107 Q_PRIVATE_SLOT( d, void sourceLayoutChanged() ) 00108 //@endcond 00109 }; 00110 00111 } 00112 00113 #endif