quill/locallibrarywidget.h

75 lines
1.8 KiB
C
Raw Normal View History

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"
#include "generaldialog.h"
#include "toast.h"
#include "bookoptionsdialog.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;
float stdIconWidthDivider;
float stdIconHeightDivider;
2022-06-23 12:34:40 -07:00
int stdIconWidth;
int stdIconHeight;
QJsonDocument databaseJsonDocument;
QJsonObject databaseJsonObject;
QJsonArray databaseJsonArrayList;
int currentPageNumber = 1;
2022-06-25 20:22:38 -07:00
int pagesNumber;
2022-06-27 15:14:20 -07:00
int pagesTurned = 0;
2022-06-25 20:22:38 -07:00
int booksNumber;
int bookTitleTruncateThreshold;
QVector<int> idList;
2022-06-27 15:14:20 -07:00
bool noBooksInDatabase = true;
2022-06-23 12:34:40 -07:00
private slots:
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();
void openGoToPageDialog();
void goToPage(int page);
void setupDisplay();
void showToast(QString messageToDisplay);
void openBookOptionsDialog(int bookID);
void handlePossibleBookDeletion();
2022-06-23 08:10:38 -07:00
private:
2022-06-23 12:34:40 -07:00
Ui::localLibraryWidget * ui;
generalDialog * generalDialogWindow;
bookOptionsDialog * bookOptionsDialogWindow;
toast * toastWindow;
QVector<QHBoxLayout*> horizontalLayoutArray;
QVector<QLabel*> bookIconArray;
QVector<QClickableLabel*> bookBtnArray;
QVector<QFrame*> lineArray;
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