| 
									
										
										
										
											2017-04-27 20:25:32 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2015-05-28 15:00:58 -03:00
										 |  |  | #ifndef CLEANERTABLEMODEL_H
 | 
					
						
							|  |  |  | #define CLEANERTABLEMODEL_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QAbstractTableModel>
 | 
					
						
							|  |  |  | #include <QStringList>
 | 
					
						
							| 
									
										
										
										
											2015-05-28 17:17:09 -03:00
										 |  |  | #include <QPixmap>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Retrieve the trash icon pixmap, common to most table models */ | 
					
						
							|  |  |  | const QPixmap &trashIcon(); | 
					
						
							| 
									
										
										
										
											2015-09-17 15:27:49 -07:00
										 |  |  | const QPixmap &trashForbiddenIcon(); | 
					
						
							| 
									
										
										
										
											2019-03-16 11:14:42 +01:00
										 |  |  | const QPixmap &editIcon(); | 
					
						
							| 
									
										
										
										
											2015-05-28 15:00:58 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* When using a QAbstractTableModel, consider using this instead
 | 
					
						
							|  |  |  |  * of the default implementation, as it's easyer to setup the columns | 
					
						
							|  |  |  |  * and headers. | 
					
						
							|  |  |  |  * Most subsurface classes uses this one to save loads of lines | 
					
						
							|  |  |  |  * of code and share a consistent layout. */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class CleanerTableModel : public QAbstractTableModel { | 
					
						
							|  |  |  | 	Q_OBJECT | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  | 	explicit CleanerTableModel(QObject *parent = 0); | 
					
						
							| 
									
										
										
										
											2018-09-29 22:13:44 +02:00
										 |  |  | 	int columnCount(const QModelIndex &parent = QModelIndex()) const override; | 
					
						
							|  |  |  | 	QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; | 
					
						
							| 
									
										
										
										
											2015-05-28 15:00:58 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							|  |  |  | 	void setHeaderDataStrings(const QStringList &headers); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  | 	QStringList headers; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |