#ifndef THUMBNAILWIDGET_H
#define THUMBNAILWIDGET_H

#include "thumbnaildelegate.h"
#include "globalsignal.h"
#include "saneobject.h"
#include "include/common.h"
#include <QWidget>
#include <QListView>
#include <QStandardItem>
#include <QStandardItemModel>
#include <QListWidget>
#include <QListWidgetItem>
#include <QListData>
#include <QListIterator>
#include <QSize>
#include <QImage>
#include <QPixmap>
#include <QIcon>
#include <QGraphicsDropShadowEffect>
#include <QScrollBar>
#include <QFile>
#include <QFileInfo>
#include <QPaintEvent>
#include <QPainter>
#include <QStyleOption>
#include <QStyle>


class ScanStandardItem: public QStandardItem
{
public:
    void setPath(const QString &path);
    QString getPath();

    int getRowCountLocation() const;
    void setRowCountLocation(int value);

private:
    QString m_path;
    int rowCountLocation;

};

class ThumbnailWidget : public QListView
{
    Q_OBJECT
public:
    explicit ThumbnailWidget(QWidget *parent = nullptr);

    static int scanPictureCount;
    static bool scanPictureIsEmpty;
    void setupGui();
    void initConnect();
    void initSettings();
    void themeChange();
    bool isDarkTheme();
    void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;

protected:
//        void paintEvent(QPaintEvent *event) override;


private:
    ThumbnailDelegate *m_thumbnailDelegate = nullptr;
    QStandardItemModel *m_thumbnailItemModel = nullptr;


public slots:
    void showThumbnailIcon();

    void showNormalImageAfterScan(QString, QString);
    void showNormalImagesAfterScan(QStringList, QStringList);
    void clickedItemSlot(const QModelIndex &index);

};

#endif // THUMBNAILWIDGET_H
