File indexing completed on 2024-05-12 16:39:54

0001 /* This file is part of the KDE project
0002    Copyright (C) 2003-2016 Jarosław Staniek <staniek@kde.org>
0003 
0004    Contains code from kfontsettingsdata.cpp:
0005    Copyright (C) 2000, 2006 David Faure <faure@kde.org>
0006    Copyright 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
0007    Copyright 2013 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
0008 
0009    This program is free software; you can redistribute it and/or
0010    modify it under the terms of the GNU Library General Public
0011    License as published by the Free Software Foundation; either
0012    version 2 of the License, or (at your option) any later version.
0013 
0014    This program is distributed in the hope that it will be useful,
0015    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017    Library General Public License for more details.
0018 
0019    You should have received a copy of the GNU Library General Public License
0020    along with this program; see the file COPYING.  If not, write to
0021    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0022  * Boston, MA 02110-1301, USA.
0023 */
0024 
0025 #ifndef KEXIUTILS_FONTSETTINGS_P_H
0026 #define KEXIUTILS_FONTSETTINGS_P_H
0027 
0028 #include <QFont>
0029 #include <KSharedConfig>
0030 
0031 //! @internal For KexiUtils::smallestReadableFont(), etc.
0032 struct FontData {
0033     const char *ConfigGroupKey;
0034     const char *ConfigKey;
0035     const char *FontName;
0036     int Size;
0037     int Weight;
0038     QFont::StyleHint StyleHint;
0039 };
0040 
0041 //! @internal For KexiUtils::smallestReadableFont(), etc.
0042 class FontSettingsData // : public QObject
0043 {
0044     //Q_OBJECT
0045 public:
0046     // if adding a new type here also add an entry to DefaultFontData
0047     enum FontTypes {
0048         GeneralFont = 0,
0049         FixedFont,
0050         ToolbarFont,
0051         MenuFont,
0052         WindowTitleFont,
0053         TaskbarFont,
0054         SmallestReadableFont,
0055         FontTypesCount
0056     };
0057 
0058 public:
0059     FontSettingsData();
0060     ~FontSettingsData();
0061 
0062 //public Q_SLOTS:
0063 //    void dropFontSettingsCache();
0064 
0065 //private Q_SLOTS:
0066 //    void delayedDBusConnects();
0067 
0068 public: // access, is not const due to caching
0069     QFont font(FontTypes fontType);
0070 
0071 private:
0072     QFont *m_fonts[FontTypesCount];
0073     KSharedConfigPtr m_kdeGlobals;
0074 };
0075 
0076 #endif