summaryrefslogtreecommitdiff
path: root/lspackagemodel.h
blob: 58ad62ddf3072f3068fa3e54a268fddceb606e73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef LSPACKAGEMODEL_H
#define LSPACKAGEMODEL_H

#include <QAbstractItemModel>
#include "lyt/packagebase.h"

class LSPackageModel : public QAbstractItemModel {
	Q_OBJECT
public:
	explicit LSPackageModel(LYTPackageBase *pkg, QObject *parent = 0);
	~LSPackageModel();

	LYTPackageBase *package() const { return m_package; }

	QModelIndex index(int row, int column, const QModelIndex &parent) const;
	QModelIndex parent(const QModelIndex &child) const;
	int rowCount(const QModelIndex &parent) const;
	int columnCount(const QModelIndex &parent) const;
	QVariant data(const QModelIndex &index, int role) const;

	QString itemNameForIndex(const QModelIndex &index) const;
	LYTPackageBase::ItemType itemTypeForIndex(const QModelIndex &index) const;

signals:
	
private slots:
	//void handleAboutToAddFile(LYTPackageBase::ItemType type, QString name);
	//void handleAboutToRemoveFile(LYTPackageBase::ItemType type, QString name);
	//void handleAboutToRenameFile(LYTPackageBase::ItemType type, QString from, QString to);
	//void handleAboutToModifyFile(LYTPackageBase::ItemType type, QString name);

	void handleFileWasAdded(LYTPackageBase::ItemType type, QString name);
	void handleFileWasRemoved(LYTPackageBase::ItemType type, QString name);
	void handleFileWasRenamed(LYTPackageBase::ItemType type, QString from, QString to);
	//void handleFileWasModified(LYTPackageBase::ItemType type, QString name);

public slots:
	
protected:
	LYTPackageBase *m_package;

	QStringList *m_caches;
};

#endif // LSPACKAGEMODEL_H