2022-06-23 08:10:38 -07:00
|
|
|
#ifndef LOCALLIBRARYWIDGET_H
|
|
|
|
#define LOCALLIBRARYWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2022-06-23 12:34:40 -07:00
|
|
|
#include <QLabel>
|
2022-06-25 20:22:38 -07:00
|
|
|
#include <QHBoxLayout>
|
2022-06-23 12:34:40 -07:00
|
|
|
|
|
|
|
#include "functions.h"
|
|
|
|
#include "qclickablelabel.h"
|
2022-06-23 08:10:38 -07:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class localLibraryWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class localLibraryWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-06-23 12:34:40 -07:00
|
|
|
QString className = this->metaObject()->className();
|
2022-06-23 08:10:38 -07:00
|
|
|
explicit localLibraryWidget(QWidget *parent = nullptr);
|
|
|
|
~localLibraryWidget();
|
2022-06-23 12:34:40 -07:00
|
|
|
int buttonsNumber;
|
|
|
|
int sW;
|
|
|
|
int sH;
|
2022-06-26 23:40:34 -07:00
|
|
|
float stdIconWidthDivider;
|
|
|
|
float stdIconHeightDivider;
|
2022-06-23 12:34:40 -07:00
|
|
|
int stdIconWidth;
|
|
|
|
int stdIconHeight;
|
2022-06-25 17:12:50 -07:00
|
|
|
QJsonDocument databaseJsonDocument;
|
|
|
|
QJsonObject databaseJsonObject;
|
|
|
|
QJsonArray databaseJsonArrayList;
|
|
|
|
int currentPageNumber = 1;
|
2022-06-25 20:22:38 -07:00
|
|
|
int pagesNumber;
|
|
|
|
int booksNumber;
|
2022-06-26 08:51:52 -07:00
|
|
|
int bookTitleTruncateThreshold;
|
|
|
|
QVector<int> idList;
|
2022-06-23 12:34:40 -07:00
|
|
|
|
|
|
|
private slots:
|
2022-06-25 17:12:50 -07:00
|
|
|
void setupDatabase();
|
|
|
|
void setupBooksList(int pageNumber);
|
|
|
|
void on_previousPageBtn_clicked();
|
|
|
|
void on_nextPageBtn_clicked();
|
|
|
|
void openBook(int id);
|
|
|
|
void btnOpenBook(int buttonNumber);
|
2022-06-26 10:21:43 -07:00
|
|
|
void refreshScreenNative();
|
2022-06-23 08:10:38 -07:00
|
|
|
|
|
|
|
private:
|
2022-06-23 12:34:40 -07:00
|
|
|
Ui::localLibraryWidget * ui;
|
2022-06-26 08:51:52 -07:00
|
|
|
QVector<QHBoxLayout*> horizontalLayoutArray;
|
|
|
|
QVector<QLabel*> bookIconArray;
|
|
|
|
QVector<QClickableLabel*> bookBtnArray;
|
|
|
|
QVector<QFrame*> lineArray;
|
2022-06-25 17:12:50 -07:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void openBookSignal(QString bookFile, bool relativePath);
|
2022-06-26 10:21:43 -07:00
|
|
|
void refreshScreen();
|
2022-06-23 08:10:38 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LOCALLIBRARYWIDGET_H
|