2022-06-28 23:15:13 -07:00
|
|
|
#ifndef HOMEPAGEWIDGET_H
|
|
|
|
#define HOMEPAGEWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include "qclickablelabel.h"
|
2022-06-29 10:11:11 -07:00
|
|
|
#include "qtooltiplabel.h"
|
2022-06-30 06:52:48 -07:00
|
|
|
#include "locallibrarywidget.h"
|
|
|
|
#include "toast.h"
|
2022-07-17 23:40:32 -07:00
|
|
|
#include "bookoptionsdialog.h"
|
|
|
|
#include "bookinfodialog.h"
|
2022-06-28 23:15:13 -07:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class homePageWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class homePageWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
QString className = this->metaObject()->className();
|
|
|
|
explicit homePageWidget(QWidget *parent = nullptr);
|
|
|
|
~homePageWidget();
|
|
|
|
int sW;
|
|
|
|
int sH;
|
|
|
|
int stdIconWidth;
|
|
|
|
int stdIconHeight;
|
|
|
|
float stdIconWidthDivider;
|
|
|
|
float stdIconHeightDivider;
|
2022-06-29 10:11:11 -07:00
|
|
|
int bookTitleTruncateThreshold;
|
2022-07-17 23:40:32 -07:00
|
|
|
bool pinnedBooksDatabaseEmpty = true;
|
2022-06-28 23:15:13 -07:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void openBookSignal(QString bookPath, bool relativePath);
|
|
|
|
void refreshScreen();
|
2022-07-17 23:40:32 -07:00
|
|
|
void relaunchHomePageWidget();
|
2022-06-28 23:15:13 -07:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void openBook(QString bookPath);
|
|
|
|
void refreshScreenNative();
|
2022-06-30 06:52:48 -07:00
|
|
|
void setupDisplay(bool databaseGenerated);
|
|
|
|
void setupDisplaySlot();
|
|
|
|
void setupDisplayWithDatabase();
|
|
|
|
void showToast(QString messageToDisplay);
|
2022-07-17 23:40:32 -07:00
|
|
|
void openBookOptionsDialog(QString bookPath);
|
|
|
|
void openLocalBookInfoDialog();
|
|
|
|
void handlePossibleBookPin();
|
2022-06-28 23:15:13 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::homePageWidget *ui;
|
2022-06-30 06:52:48 -07:00
|
|
|
localLibraryWidget * localLibraryWidgetWindow;
|
|
|
|
toast * toastWindow;
|
2022-07-17 23:40:32 -07:00
|
|
|
bookOptionsDialog * bookOptionsDialogWindow;
|
|
|
|
bookInfoDialog * bookInfoDialogWindow;
|
2022-06-29 10:11:11 -07:00
|
|
|
QVector<QToolTipLabel*> bookTitleArray;
|
2022-06-29 08:42:05 -07:00
|
|
|
QVector<QHBoxLayout*> horizontalLayoutArray;
|
2022-06-28 23:15:13 -07:00
|
|
|
QVector<QVBoxLayout*> verticalLayoutArray;
|
|
|
|
QVector<QClickableLabel*> bookBtnArray;
|
2022-07-17 23:40:32 -07:00
|
|
|
QVector<QToolTipLabel*> pinnedBooksTitleArray;
|
|
|
|
QVector<QHBoxLayout*> pinnedBooksHorizontalLayoutArray;
|
|
|
|
QVector<QVBoxLayout*> pinnedBooksVerticalLayoutArray;
|
|
|
|
QVector<QClickableLabel*> pinnedBooksBtnArray;
|
2022-06-28 23:15:13 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // HOMEPAGEWIDGET_H
|