kalarm
fontcolour.h
Go to the documentation of this file.00001 /* 00002 * fontcolour.h - font and colour chooser widget 00003 * Program: kalarm 00004 * Copyright © 2001,2003,2008 by David Jarvie <djarvie@kde.org> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef FONTCOLOUR_H 00022 #define FONTCOLOUR_H 00023 00024 #include <QWidget> 00025 #include <QStringList> 00026 #include <kdeversion.h> 00027 00028 class QPushButton; 00029 class KFontChooser; 00030 class CheckBox; 00031 class ColourButton; 00032 00033 00034 class FontColourChooser : public QWidget 00035 { 00036 Q_OBJECT 00037 public: 00038 explicit FontColourChooser(QWidget* parent = 0, 00039 const QStringList& fontList = QStringList(), 00040 const QString& frameLabel = i18n("Requested font"), 00041 bool fg = true, bool defaultFont = false, int visibleListSize = 8); 00042 00043 void setDefaultFont(); 00044 void setFont(const QFont&, bool onlyFixed = false); 00045 bool defaultFont() const; 00046 QFont font() const; 00047 QColor fgColour() const; 00048 QColor bgColour() const; 00049 void setFgColour(const QColor&); 00050 void setBgColour(const QColor&); 00051 QString sampleText() const; 00052 void setSampleText(const QString& text); 00053 bool isReadOnly() const { return mReadOnly; } 00054 void setReadOnly(bool); 00055 virtual bool eventFilter(QObject*, QEvent*); 00056 00057 private slots: 00058 void setSampleColour(); 00059 void slotDefaultFontToggled(bool); 00060 00061 private: 00062 ColourButton* mFgColourButton; // or null 00063 ColourButton* mBgColourButton; 00064 KFontChooser* mFontChooser; 00065 CheckBox* mDefaultFont; // or null 00066 bool mReadOnly; 00067 }; 00068 00069 #endif
KDE 4.2 API Reference