/*
 * Copyright 2025 KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef MODELWIDGET_H
#define MODELWIDGET_H

#include <QWidget>
#include <QLabel>
#include <QToolButton>

#include <kysdk/applications/kswitchbutton.h>
#include <kysdk/applications/kborderlessbutton.h>
#include <kysdk/applications/klabel.h>
#include <aiconfig/modelconfig.h>
#include <QVBoxLayout>

using namespace kdk;
using namespace kyai::config::model;

// 自定义模型Widget类
class ModelWidget : public QWidget {
    Q_OBJECT

public:
    explicit ModelWidget(const QString &modelName, const QString &modelIntro, DeployType deployType, QWidget *parent = nullptr);
    ~ModelWidget();
    QSize sizeHint() const override;
    void initConnect();

public slots:
    void onTransModelDeployStatusChanged(bool enable);
    void onSortButtonClicked();

signals:
    void configClicked(const QString &modelName);
    void sortClicked(); // 添加一个排序点击信号

public:
    QPushButton *m_sortButton; // 排序按钮
    QLabel *modelNameLabel;      // 模型名称标签
    kdk::KLabel *modelIntroLabel;     // 模型简介标签
    kdk::KBorderlessButton *configButton; // 配置按钮
    KSwitchButton *modelSwitchBtn;  // 自定义的开关按钮
    QVBoxLayout *m_modelLayout = nullptr;
    QHBoxLayout *m_layout = nullptr;
    QString modelWidgetName;
    int m_priority;  // 优先级属性
    DeployType m_deployType; // 标识是云端模型还是本地模型

};
#endif // MODELWIDGET_H
