mirror of
https://github.com/laurent22/joplin.git
synced 2025-04-23 11:52:59 +02:00
46 lines
781 B
C
46 lines
781 B
C
|
#ifndef FOLDERMODEL_H
|
||
|
#define FOLDERMODEL_H
|
||
|
|
||
|
#include <stable.h>
|
||
|
|
||
|
#include "services/folderservice.h"
|
||
|
|
||
|
namespace jop {
|
||
|
|
||
|
class FolderModel : public QAbstractListModel {
|
||
|
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
|
||
|
enum FolderRoles {
|
||
|
UuidRole = Qt::UserRole + 1,
|
||
|
TitleRole
|
||
|
};
|
||
|
|
||
|
//FolderModel();
|
||
|
FolderModel(FolderService& folderService);
|
||
|
|
||
|
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
|