File indexing completed on 2025-02-02 04:11:28

0001 /*
0002  * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 #ifndef FONTSTYLEWIDGET_H
0008 #define FONTSTYLEWIDGET_H
0009 
0010 #include <memory>
0011 #include <QWidget>
0012 
0013 #include "font_model.hpp"
0014 
0015 namespace glaxnimate::gui::font {
0016 
0017 
0018 class FontStyleWidget : public QWidget
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     FontStyleWidget(QWidget* parent = nullptr);
0024     ~FontStyleWidget();
0025 
0026 
0027     void set_font(const QFont& font);
0028     const QFont& selected_font() const;
0029 
0030     FontModel& model();
0031 
0032 protected:
0033     void changeEvent ( QEvent* e ) override;
0034 
0035 Q_SIGNALS:
0036     void font_edited(const QFont& font);
0037     void font_changed(const QFont& font);
0038 
0039 private Q_SLOTS:
0040     void family_edited(const QString& family);
0041     void family_selected(const QModelIndex& index );
0042     void family_clicked(const QModelIndex& index);
0043     void style_selected(const QModelIndex& index);
0044     void filter_flags_changed();
0045     void system_changed(int index);
0046 
0047 private:
0048     class Private;
0049     std::unique_ptr<Private> d;
0050 };
0051 
0052 } // namespace glaxnimate::gui::font
0053 
0054 #endif // FONTSTYLEWIDGET_H