kalarm
templatelistfiltermodel.h
Go to the documentation of this file.00001 /* 00002 * templatelistfiltermodel.h - proxy model class for lists of alarm templates 00003 * Program: kalarm 00004 * Copyright © 2007 by David Jarvie <software@astrojar.org.uk> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef TEMPLATELISTFILTERMODEL_H 00022 #define TEMPLATELISTFILTERMODEL_H 00023 00024 #include "kalarm.h" 00025 00026 #include "eventlistmodel.h" 00027 00028 00029 class TemplateListFilterModel : public EventListFilterModel 00030 { 00031 public: 00032 enum { // data columns 00033 TypeColumn, TemplateNameColumn, 00034 ColumnCount 00035 }; 00036 00037 explicit TemplateListFilterModel(EventListModel* baseModel, QObject* parent = 0) 00038 : EventListFilterModel(baseModel, parent) {} 00039 void setTypeFilter(bool excludeCommandAlarms); 00040 virtual QModelIndex mapFromSource(const QModelIndex& sourceIndex) const; 00041 virtual QModelIndex mapToSource(const QModelIndex& proxyIndex) const; 00042 00043 protected: 00044 virtual bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const; 00045 virtual bool filterAcceptsColumn(int sourceCol, const QModelIndex& sourceParent) const; 00046 00047 private: 00048 bool mCmdFilter; 00049 }; 00050 00051 #endif // TEMPLATELISTFILTERMODEL_H 00052
KDE 4.2 API Reference