OSDN Git Service

Version: 0.1
[fontmanager/fontmanager.git] / fontinfo.h
1 #ifndef FONTINFO_H
2 #define FONTINFO_H
3
4 #include <QObject>
5 #include <QStringList>
6 #include <QFontInfo>
7
8 class FontsConfigProperties;
9
10 class FontInfo : public QObject
11 {
12     Q_OBJECT
13     Q_PROPERTY(QString fontPath READ fontPath WRITE setFontPath NOTIFY fontPathChanged)
14     Q_PROPERTY(QStringList families READ families NOTIFY fontPathChanged)
15 public:
16     explicit FontInfo(QObject *parent = 0);
17     explicit FontInfo(const QString &fontPath, QObject *parent = 0);
18     ~FontInfo();
19
20     QString fontPath() const;
21     void setFontPath(const QString &fontPath);
22
23     QStringList families() const;
24
25     Q_INVOKABLE FontsConfigProperties *fontProperty(const QString &family) const;
26
27 signals:
28     void fontPathChanged();
29
30 public slots:
31
32 private:
33     int mFontId;
34     QString mFontPath;
35     QStringList mFontFamilies;
36     QList<FontsConfigProperties *> mFontProperties;
37 };
38
39 #endif // FONTINFO_H