Desktop client for Nextcloud to edit your notes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
NNotes/notehandler.h

42 lines
787 B

#ifndef NOTEHANDLER_H
#define NOTEHANDLER_H
// Qt includes
#include <QObject>
#include <QDebug>
#include <QDir>
#include <QFile>
// project includes
#include "config.h"
namespace tai {
class NoteHandler : public QObject
{
Q_OBJECT
public:
explicit NoteHandler(QString const& dirPath, std::shared_ptr<tai::config> conf);
public slots:
inline QString dirPath() { return _notesDir.path(); };
QString filename(int index);
QString fileContents(int index);
QStringList entryList();
void setDirPath(QString const& newDirPath);
bool setFilename(int index, QString const& filename);
bool saveContent(int index, QString const& content);
signals:
void filesChanged();
private:
QDir _notesDir {};
std::shared_ptr<tai::config> _config { nullptr };
};
}
#endif // NOTEHANDLER_H