1 /*
2  * Copyright (C) 2014  Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
3  * LXQt project: https://lxqt.org/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  *
19  */
20 
21 #ifndef FONTCONFIGFILE_H
22 #define FONTCONFIGFILE_H
23 
24 #include <QString>
25 #include <QByteArray>
26 #include <QObject>
27 
28 class QTimer;
29 
30 class FontConfigFile: public QObject
31 {
32     Q_OBJECT
33 public:
34     explicit FontConfigFile(QObject* parent = nullptr);
35     virtual ~FontConfigFile();
36 
antialias()37     bool antialias() const {
38         return mAntialias;
39     }
40     void setAntialias(bool value);
41 
hinting()42     bool hinting() const {
43         return mHinting;
44     }
45     void setHinting(bool value);
46 
subpixel()47     QByteArray subpixel() const {
48         return mSubpixel;
49     }
50     void setSubpixel(QByteArray value);
51 
hintStyle()52     QByteArray hintStyle() const {
53         return mHintStyle;
54     }
55     void setHintStyle(QByteArray value);
56 
dpi()57     int dpi() const {
58         return mDpi;
59     }
60     void setDpi(int value);
61 
autohint()62     bool autohint() const {
63         return mAutohint;
64     }
65     void setAutohint(bool value);
66 
67 
68 private Q_SLOTS:
69     void save();
70 
71 private:
72     void load();
73     void queueSave();
74 
75 private:
76     bool mAntialias;
77     bool mHinting;
78     QByteArray mSubpixel;
79     QByteArray mHintStyle;
80     int mDpi;
81     bool mAutohint;
82     QString mDirPath;
83     QString mFilePath;
84     QTimer* mSaveTimer;
85 };
86 
87 #endif // FONTCONFIGFILE_H
88