2023-05-18 18:59:10 -04:00
|
|
|
#ifndef LOCALDOCS_H
|
|
|
|
#define LOCALDOCS_H
|
|
|
|
|
2024-06-04 14:47:11 -04:00
|
|
|
#include "localdocsmodel.h" // IWYU pragma: keep
|
2023-05-18 18:59:10 -04:00
|
|
|
|
2023-05-22 22:13:42 -04:00
|
|
|
#include <QObject>
|
2024-06-04 14:47:11 -04:00
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
class Database;
|
2023-05-18 18:59:10 -04:00
|
|
|
|
|
|
|
class LocalDocs : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2023-05-22 22:13:42 -04:00
|
|
|
Q_PROPERTY(LocalDocsModel *localDocsModel READ localDocsModel NOTIFY localDocsModelChanged)
|
2023-05-18 18:59:10 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
static LocalDocs *globalInstance();
|
|
|
|
|
2023-05-22 22:13:42 -04:00
|
|
|
LocalDocsModel *localDocsModel() const { return m_localDocsModel; }
|
2023-05-21 15:13:28 -04:00
|
|
|
|
2023-05-22 22:13:42 -04:00
|
|
|
Q_INVOKABLE void addFolder(const QString &collection, const QString &path);
|
|
|
|
Q_INVOKABLE void removeFolder(const QString &collection, const QString &path);
|
2023-06-01 14:13:12 -04:00
|
|
|
|
|
|
|
Database *database() const { return m_database; }
|
2023-05-18 18:59:10 -04:00
|
|
|
|
2023-06-28 20:42:40 -04:00
|
|
|
public Q_SLOTS:
|
|
|
|
void handleChunkSizeChanged();
|
2023-10-24 12:13:32 -04:00
|
|
|
void aboutToQuit();
|
2023-05-23 20:26:31 -04:00
|
|
|
|
2023-05-18 18:59:10 -04:00
|
|
|
Q_SIGNALS:
|
2024-04-25 13:16:52 -04:00
|
|
|
void requestStart();
|
|
|
|
void requestAddFolder(const QString &collection, const QString &path, bool fromDb);
|
2023-05-18 18:59:10 -04:00
|
|
|
void requestRemoveFolder(const QString &collection, const QString &path);
|
2023-05-23 20:26:31 -04:00
|
|
|
void requestChunkSizeChange(int chunkSize);
|
2023-05-22 22:13:42 -04:00
|
|
|
void localDocsModelChanged();
|
2023-05-18 18:59:10 -04:00
|
|
|
|
|
|
|
private:
|
2023-05-22 22:13:42 -04:00
|
|
|
LocalDocsModel *m_localDocsModel;
|
2023-05-18 18:59:10 -04:00
|
|
|
Database *m_database;
|
|
|
|
|
|
|
|
private:
|
|
|
|
explicit LocalDocs();
|
|
|
|
friend class MyLocalDocs;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LOCALDOCS_H
|