/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * Copyright (C) 2024 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 2 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, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */
#ifndef POPUPFONTINFO_H
#define POPUPFONTINFO_H

#include <QWidget>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QScrollArea>
#include <QScrollBar>
#include <QGridLayout>
#include <QPushButton>
#include <QDBusInterface>
#include "libfun.h"
#include "lightlabel.h"

/* 字体信息弹窗 */
class PopupFontInfo : public QWidget
{
    Q_OBJECT
public:
    PopupFontInfo(QString fontPath , QWidget *parent = nullptr);
    ~PopupFontInfo();
    void setWidegtUi();
    void setWidLayout();
    void changeFontSize();

private:
    QLabel *m_tipText = nullptr;
    QWidget *m_widget = nullptr;
    QScrollArea *m_scrollArea = nullptr;

    LightLabel* m_fontName = nullptr;         /* 属性：名称 */
    QLabel* m_nameValue = nullptr;        /* 名称 */

    QLabel* m_fontSeries = nullptr;       /* 属性：系列 */
    QLabel* m_seriesValue = nullptr;      /* 系列 */

    QLabel* m_fontStyle = nullptr;        /* 属性：样式 */
    QLabel* m_styleValue = nullptr;       /* 样式 */

    QLabel* m_fontType = nullptr;         /* 属性：种类 */
    QLabel* m_typeValue = nullptr;        /* 种类 */

    QLabel* m_fontVersion = nullptr;      /* 属性：版本 */
    QLabel* m_versionValue = nullptr;     /* 版本 */

    QLabel* m_fontPath = nullptr;         /* 属性：位置 */
    QLabel* m_pathValue = nullptr;        /* 位置 */

    QLabel* m_fontCopyright = nullptr;    /* 属性：版权 */
    QLabel* m_copyrightValue = nullptr;   /* 版权 */

    QLabel* m_fontTrademark = nullptr;    /* 属性：商标 */
    QLabel* m_trademarkValue = nullptr;   /* 商标 */

    QPushButton *m_continueBtn = nullptr;
    QPushButton *m_cancelBtn = nullptr;

    QVBoxLayout *m_vLayout = nullptr;
    QGridLayout *m_gridLayout = nullptr;   /* 字体信息内容网格布局 */
    QVBoxLayout *m_vGridLayout = nullptr;
    QHBoxLayout *m_hBtnLayout = nullptr;
    QHBoxLayout *m_hMainLayout = nullptr;
    QVBoxLayout *m_vMainLayout = nullptr;
    QDBusInterface* m_fontInterface = nullptr;
    FontInformation m_font;   /* 字体信息结构体 */

public slots:
    void slotContinueClick();
};

#endif // POPUPFONTINFO_H
