2016-12-10 22:39:53 +00:00
|
|
|
#ifndef FOLDER_H
|
|
|
|
#define FOLDER_H
|
|
|
|
|
|
|
|
#include <stable.h>
|
|
|
|
#include "models/item.h"
|
2017-01-12 17:59:19 +01:00
|
|
|
#include "models/note.h"
|
2016-12-10 22:39:53 +00:00
|
|
|
|
|
|
|
namespace jop {
|
|
|
|
|
|
|
|
class Folder : public Item {
|
|
|
|
|
2017-02-06 20:20:30 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2016-12-10 22:39:53 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
Folder();
|
|
|
|
|
2017-02-06 20:20:30 +00:00
|
|
|
static int count(const QString& parentId);
|
2017-02-06 21:18:03 +00:00
|
|
|
static std::vector<std::unique_ptr<Folder>> pathToFolders(const QString& path, bool returnLast, int& errorCode);
|
|
|
|
static QString pathBaseName(const QString& path);
|
|
|
|
static std::unique_ptr<Folder> root();
|
2017-01-01 23:03:42 +01:00
|
|
|
|
2017-01-02 13:17:15 +01:00
|
|
|
bool primaryKeyIsUuid() const;
|
2017-01-02 15:04:27 +01:00
|
|
|
bool trackChanges() const;
|
2017-01-12 17:59:19 +01:00
|
|
|
int noteCount() const;
|
2017-02-06 21:18:03 +00:00
|
|
|
std::vector<std::unique_ptr<Note>> notes(const QString& orderBy, int limit, int offset = 0) const;
|
|
|
|
std::vector<std::unique_ptr<BaseModel>> children(const QString &orderBy = QString("title"), int limit = 0, int offset = 0) const;
|
2017-01-12 19:11:58 +01:00
|
|
|
int noteIndexById(const QString& orderBy, const QString &id) const;
|
2017-02-06 21:18:03 +00:00
|
|
|
QString displayTitle() const;
|
2017-02-03 20:47:45 +00:00
|
|
|
|
2016-12-10 22:39:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // FOLDER_H
|