1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-04-20 11:28:40 +02:00

48 lines
793 B
C
Raw Normal View History

2016-12-10 22:39:53 +00:00
#ifndef FOLDERMODEL_H
#define FOLDERMODEL_H
#include <stable.h>
#include "services/folderservice.h"
namespace jop {
class FolderModel : public QAbstractListModel {
Q_OBJECT
public:
enum FolderRoles {
2016-12-11 16:09:39 +00:00
IdRole = Qt::UserRole + 1,
TitleRole,
RawRole
2016-12-10 22:39:53 +00:00
};
2016-12-11 16:09:39 +00:00
FolderModel();
void setService(FolderService& folderService);
2016-12-10 22:39:53 +00:00
void addFolder(Folder* folder);
int rowCount(const QModelIndex & parent = QModelIndex()) const;
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
protected:
QHash<int, QByteArray> roleNames() const;
bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE;
void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE;
private:
QList<Folder> folders_;
FolderService folderService_;
};
}
#endif // FOLDERMODEL_H