File indexing completed on 2024-05-19 04:48:24

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 #ifndef FONTS_H
0023 #define FONTS_H
0024 
0025 #include <QObject>
0026 #include <QList>
0027 #include <QFontDatabase>
0028 #include <QStringList>
0029 
0030 class Fonts : public QObject
0031 {
0032     Q_OBJECT
0033 
0034     Q_PROPERTY(QStringList monospaceFamilies READ monospaceFamilies NOTIFY monospaceFamiliesChanged)
0035 
0036 public:
0037     Fonts();
0038 
0039     QStringList monospaceFamilies() const;
0040 
0041 Q_SIGNALS:
0042     void monospaceFamiliesChanged();
0043 
0044 protected:
0045     void updateFamilies();
0046 
0047 private:
0048     QStringList m_monospaceFamilies;
0049     QFontDatabase m_fontDatabase;
0050 };
0051 
0052 #endif // FONTS_H