Rename Library to History
This commit is contained in:
11 files changed
+102
-102
No files matched your search
@@ -0,0 +1,62 @@
|
||||
#ifndef HISTORYBOOKMODEL_H
|
||||
#define HISTORYBOOKMODEL_H
|
||||
|
||||
#include <QString>
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
#include <QFuture>
|
||||
|
||||
#include "formats/ReaderFactory.h"
|
||||
|
||||
class FormatReader;
|
||||
|
||||
class HistoryBookModel : public QObject {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString filePath READ filePath CONSTANT)
|
||||
Q_PROPERTY(double progress READ progress WRITE setProgress NOTIFY progressChanged)
|
||||
Q_PROPERTY(QString lastOpened READ lastOpened WRITE setLastOpened NOTIFY lastOpenedChanged)
|
||||
Q_PROPERTY(QString title READ title NOTIFY metadataLoaded)
|
||||
Q_PROPERTY(QString author READ author NOTIFY metadataLoaded)
|
||||
Q_PROPERTY(QString coverImageUrl READ coverImageUrl NOTIFY coverImageLoaded)
|
||||
|
||||
public:
|
||||
explicit HistoryBookModel(ReaderFactory &factory, QObject *parent = nullptr);
|
||||
explicit HistoryBookModel(const QString &filePath, double progress, const QString &lastOpened, ReaderFactory &factory, QObject *parent = nullptr);
|
||||
~HistoryBookModel() override;
|
||||
|
||||
QString filePath() const;
|
||||
double progress() const;
|
||||
void setProgress(double progress);
|
||||
|
||||
QString lastOpened() const;
|
||||
void setLastOpened(const QString &lastOpened);
|
||||
|
||||
QString title() const;
|
||||
QString author() const;
|
||||
QString coverImageUrl() const;
|
||||
|
||||
void loadMetadata();
|
||||
void loadCoverImage(const QString &epubBasePath);
|
||||
|
||||
public slots:
|
||||
void onMetadataLoaded();
|
||||
|
||||
signals:
|
||||
void progressChanged();
|
||||
void lastOpenedChanged();
|
||||
void metadataLoaded();
|
||||
void coverImageLoaded();
|
||||
|
||||
private:
|
||||
QString m_filePath;
|
||||
double m_progress = 0.0;
|
||||
QString m_lastOpened;
|
||||
QString m_title;
|
||||
QString m_author;
|
||||
QString m_coverImageUrl;
|
||||
bool m_metadataLoaded = false;
|
||||
QFuture<void> m_metadataFuture;
|
||||
ReaderFactory &m_factory;
|
||||
};
|
||||
|
||||
#endif // HISTORYBOOKMODEL_H
|
||||
Reference in new issue
Block a user