summaryrefslogtreecommitdiffstats
path: root/kcontrol/fonts/fonts.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /kcontrol/fonts/fonts.h
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/fonts/fonts.h')
-rw-r--r--kcontrol/fonts/fonts.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/kcontrol/fonts/fonts.h b/kcontrol/fonts/fonts.h
new file mode 100644
index 000000000..ca1ab7729
--- /dev/null
+++ b/kcontrol/fonts/fonts.h
@@ -0,0 +1,124 @@
+//-----------------------------------------------------------------------------
+//
+// kdisplay, fonts tab
+//
+// Copyright (c) Mark Donohoe 1997
+// Lars Knoll 1999
+
+#ifndef FONTS_H
+#define FONTS_H
+
+#include <qobject.h>
+
+#include <kcmodule.h>
+#include <kdialogbase.h>
+#include <kfontdialog.h>
+#include <kfontrequester.h>
+
+#include "kxftconfig.h"
+
+class QCheckBox;
+class QComboBox;
+class KDoubleNumInput;
+class FontAASettings;
+
+class FontUseItem : public KFontRequester
+{
+ Q_OBJECT
+
+public:
+ FontUseItem(QWidget * parent, const QString &name, const QString &grp,
+ const QString &key, const QString &rc, const QFont &default_fnt,
+ bool fixed = false);
+
+ void readFont( bool useDefaults );
+ void writeFont();
+ void setDefault();
+ void applyFontDiff(const QFont &fnt, int fontDiffFlags);
+
+ const QString& rcFile() { return _rcfile; }
+ const QString& rcGroup() { return _rcgroup; }
+ const QString& rcKey() { return _rckey; }
+
+private:
+ QString _rcfile;
+ QString _rcgroup;
+ QString _rckey;
+ QFont _default;
+};
+
+class FontAASettings : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+
+ FontAASettings(QWidget *parent);
+
+ bool save( bool useAA );
+ bool load();
+ bool load( bool useDefaults );
+ void defaults();
+ int getIndex(KXftConfig::SubPixel::Type spType);
+ KXftConfig::SubPixel::Type getSubPixelType();
+#ifdef HAVE_FONTCONFIG
+ int getIndex(KXftConfig::Hint::Style hStyle);
+ KXftConfig::Hint::Style getHintStyle();
+#endif
+ void enableWidgets();
+ int exec();
+
+protected slots:
+
+ void changed();
+
+private:
+
+ QCheckBox *excludeRange;
+ QCheckBox *useSubPixel;
+ KDoubleNumInput *excludeFrom;
+ KDoubleNumInput *excludeTo;
+ QComboBox *subPixelType;
+#ifdef HAVE_FONTCONFIG
+ QComboBox *hintingStyle;
+#endif
+ QLabel *excludeToLabel;
+ bool changesMade;
+};
+
+/**
+ * The Desktop/fonts tab in kcontrol.
+ */
+class KFonts : public KCModule
+{
+ Q_OBJECT
+
+public:
+ KFonts(QWidget *parent, const char *name, const QStringList &);
+ ~KFonts();
+
+ virtual void load();
+ virtual void load( bool useDefaults );
+ virtual void save();
+ virtual void defaults();
+
+protected slots:
+ void fontSelected();
+ void slotApplyFontDiff();
+ void slotUseAntiAliasing();
+ void slotCfgAa();
+
+private:
+ enum AASetting { AAEnabled, AASystem, AADisabled };
+ enum DPISetting { DPINone, DPI96, DPI120 };
+ AASetting useAA, useAA_original;
+ DPISetting dpi_original;
+ QComboBox *cbAA;
+ QComboBox* comboForceDpi;
+ QPushButton *aaSettingsButton;
+ QPtrList <FontUseItem> fontUseList;
+ FontAASettings *aaSettings;
+};
+
+#endif
+