File indexing completed on 2024-05-12 04:47:03

0001 /*
0002  * Copyright: 2016 Canonical Ltd.
0003  *
0004  * This file is part of ubuntu-terminal-app
0005  *
0006  * ubuntu-terminal-app is free software: you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License as published by
0008  * the Free Software Foundation, either version 3 of the License, or
0009  * (at your option) any later version.
0010  *
0011  * ubuntu-terminal-app is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  *
0019  * Author: Florian Boucault <florian.boucault@canonical.com>
0020  */
0021 
0022 #pragma once
0023 #include <QObject>
0024 #include <QList>
0025 #include <QFontDatabase>
0026 #include <QStringList>
0027 
0028 class Fonts : public QObject
0029 {
0030     Q_OBJECT
0031 
0032     Q_PROPERTY(QStringList monospaceFamilies READ monospaceFamilies NOTIFY monospaceFamiliesChanged)
0033 
0034 public:
0035     Fonts();
0036 
0037     QStringList monospaceFamilies() const;
0038 
0039 Q_SIGNALS:
0040     void monospaceFamiliesChanged();
0041 
0042 protected:
0043     void updateFamilies();
0044 
0045 private:
0046     QStringList m_monospaceFamilies;
0047     QFontDatabase m_fontDatabase;
0048 };