2 * fontcolour.h - font and colour chooser widget
4 * Copyright © 2001,2003,2008,2009 by David Jarvie <djarvie@kde.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include <QStringList>
33 class FontColourChooser
: public QWidget
37 explicit FontColourChooser(QWidget
* parent
= 0,
38 const QStringList
& fontList
= QStringList(),
39 const QString
& frameLabel
= i18n("Requested font"),
40 bool fg
= true, bool defaultFont
= false, int visibleListSize
= 8);
42 void setDefaultFont();
43 void setFont(const QFont
&, bool onlyFixed
= false);
44 bool defaultFont() const;
46 QColor
fgColour() const;
47 QColor
bgColour() const;
48 void setFgColour(const QColor
&);
49 void setBgColour(const QColor
&);
50 QString
sampleText() const;
51 void setSampleText(const QString
& text
);
52 bool isReadOnly() const { return mReadOnly
; }
53 void setReadOnly(bool);
54 virtual bool eventFilter(QObject
*, QEvent
*);
57 void setSampleColour();
58 void slotDefaultFontToggled(bool);
61 ColourButton
* mFgColourButton
; // or null
62 ColourButton
* mBgColourButton
;
63 KFontChooser
* mFontChooser
;
64 CheckBox
* mDefaultFont
; // or null