kalarm Library API Documentation

fontcolour.h

00001 /*
00002  *  fontcolour.h  -  font and colour chooser widget
00003  *  Program:  kalarm
00004  *  (C) 2001 by David Jarvie  software@astrojar.org.uk
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
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef FONTCOLOUR_H
00022 #define FONTCOLOUR_H
00023 
00024 #include <qwidget.h>
00025 #include <qsize.h>
00026 
00027 #include <kfontdialog.h>
00028 
00029 #include "colourcombo.h"
00030 
00031 
00032 // General tab of the Preferences dialog
00033 class FontColourChooser : public QWidget
00034 {
00035         Q_OBJECT
00036 public:
00037         FontColourChooser(QWidget* parent = 0L, const char* name = 0L,
00038                bool onlyFixed = false,
00039                const QStringList& fontList = QStringList(),
00040                bool makeFrame = true, const QString& frameLabel = i18n("Requested font"),
00041                bool fg = true, int visibleListSize=8);
00042         ~FontColourChooser();
00043 
00044         void setFont(const QFont& font, bool onlyFixed = false)  { m_fontChooser->setFont(font, onlyFixed); }
00045         QFont font() const                       { return m_fontChooser->font(); }
00046         QColor fgColour() const;
00047         QColor bgColour() const                  { return m_bgColourButton->color(); }
00048         void setFgColour(const QColor&);
00049         void setBgColour(const QColor&);
00050 #if QT_VERSION < 300
00051         void setCharset(const QString& charset)  { m_fontChooser->setCharset(charset); }
00052         QString charset() const                  { return m_fontChooser->charset(); }
00053 #endif
00054         QString sampleText() const               { return m_fontChooser->sampleText(); }
00055         void setSampleText(const QString& text)  { m_fontChooser->setSampleText(text); }
00056 
00057 private:
00058         ColourCombo*     m_fgColourButton;       // or null
00059         ColourCombo*     m_bgColourButton;
00060         KFontChooser*    m_fontChooser;
00061 
00062 private slots:
00063         void setSampleColour();
00064 };
00065 
00066 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:26 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001