Use qtpaths directly
[kdepim.git] / kalarm / fontcolour.h
blob49cc3d5c5a758d242f7f2937c1ec4361348a759d
1 /*
2 * fontcolour.h - font and colour chooser widget
3 * Program: kalarm
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.
21 #ifndef FONTCOLOUR_H
22 #define FONTCOLOUR_H
24 #include <KLocalizedString>
25 #include <QWidget>
26 #include <QStringList>
28 class KFontChooser;
29 class CheckBox;
30 class ColourButton;
33 class FontColourChooser : public QWidget
35 Q_OBJECT
36 public:
37 explicit FontColourChooser(QWidget* parent = Q_NULLPTR,
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;
45 QFont font() 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 bool eventFilter(QObject*, QEvent*) Q_DECL_OVERRIDE;
56 private Q_SLOTS:
57 void setSampleColour();
58 void slotDefaultFontToggled(bool);
60 private:
61 ColourButton* mFgColourButton; // or null
62 ColourButton* mBgColourButton;
63 KFontChooser* mFontChooser;
64 CheckBox* mDefaultFont; // or null
65 bool mReadOnly;
68 #endif
70 // vim: et sw=4: