#ifndef WALLPAPERUI_H
#define WALLPAPERUI_H

#include "previewlabel.h"
#include "titlelabel.h"
#include "fixlabel.h"
#include "settinggroup.h"
#include "ukccframe.h"
#include "addbutton.h"
#include "comboxwidget.h"
#include "pictureunit.h"
#include "flowlayout.h"
#include "colordialog.h"
#include <QWidget>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QRadioButton>
#include <QButtonGroup>

class WallpaperUi : public QWidget
{
    Q_OBJECT
public:
    WallpaperUi();
    ~WallpaperUi();

public:
    void setWallpaperModes(const QStringList &modeList, const QStringList &modeDataList);
    void setDisplayTypes(const QStringList &typeList, const QStringList &typeDataList);
    void setWallpaperMode(const QString &mode, const QString &data);
    void setDisplayType(const QString &type);
    void setPicturesFile(const QStringList &picturePathList, const QStringList &sourcePathList); // 压缩文件、源文件
    void showPictures();
    void showColors();

// 初始化
private:
    void initUi();
    void initColors();
    void createObject();
    void initSignals();
    void resetClickedPic();

private:
    void createPictureUnit(const QPixmap &pixmap, const QString &filename, const bool &clicked);

private:
    QVBoxLayout *uiLayout      = nullptr;

private:
    TitleLabel   *wallpaperTitleLabel = nullptr;
    PreviewLabel *previewLabel        = nullptr;

private:
    SettingGroup *settingGroup    = nullptr;
    ComboxWidget *modeWidget      = nullptr;
    ComboxWidget *typeWidget      = nullptr;
    SettingGroup *colorGroup      = nullptr;
    UkccFrame    *addbuttonFrame  = nullptr;
    QHBoxLayout  *addbuttonlayout = nullptr;
    AddButton    *colorAddButton  = nullptr;
    UkccFrame    *colorFrame      = nullptr;
    FlowLayout   *colorLayout     = nullptr;
    UkccFrame    *picBtnFrame     = nullptr;
    UkccFrame    *picFrame        = nullptr;
    FlowLayout   *pictureLayout   = nullptr;
    UkccFrame    *bottomFrame     = nullptr;
    QPushButton  *localBtn        = nullptr;
    QPushButton  *onlineBtn       = nullptr;
    QPushButton  *resetBtn        = nullptr;

private:
    QString     currentFile;
    PictureUnit *prePictureUnit = nullptr;

Q_SIGNALS:
    void wallpaperChanged(const QString &mode, const QString &data);
    void typeChanged(const QString &type);
    void localButtonClicked();
    void onlineButtonClicked();
    void resetButtonClicked();
    void colorAddButtonClicked();
};



#endif // WALLPAPERUI_H
