1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-04-14 11:18:47 +02:00
2017-01-12 17:59:19 +01:00

45 lines
708 B
C++
Executable File

#ifndef NOTEMODEL_H
#define NOTEMODEL_H
#include <stable.h>
#include "models/folder.h"
#include "sparsevector.hpp"
namespace jop {
class NoteModel : public QAbstractListModel {
Q_OBJECT
public:
enum NoteRoles {
IdRole = Qt::UserRole + 1,
TitleRole
};
NoteModel();
int rowCount(const QModelIndex & parent = QModelIndex()) const;
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
Note atIndex(int index) const;
void setFolderId(const QString& v);
Folder folder() const;
protected:
QHash<int, QByteArray> roleNames() const;
private:
QList<Note> notes_;
QString folderId_;
QString orderBy_;
mutable SparseVector<Note> cache_;
};
}
#endif // NOTEMODEL_H