kalarm
fontcolour.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FONTCOLOUR_H
00022 #define FONTCOLOUR_H
00023
00024 #include <kdeversion.h>
00025 #include <qwidget.h>
00026 #include <qstringlist.h>
00027 #include <kfontdialog.h>
00028 #include "colourlist.h"
00029
00030 class ColourCombo;
00031 class QPushButton;
00032 class CheckBox;
00033
00034
00035 class FontColourChooser : public QWidget
00036 {
00037 Q_OBJECT
00038 public:
00039 FontColourChooser(QWidget* parent = 0, const char* name = 0,
00040 bool onlyFixed = false,
00041 const QStringList& fontList = QStringList(),
00042 const QString& frameLabel = i18n("Requested font"),
00043 bool editColours = false, bool fg = true, bool defaultFont = false,
00044 int visibleListSize = 8);
00045
00046 void setDefaultFont();
00047 void setFont(const QFont&, bool onlyFixed = false);
00048 bool defaultFont() const;
00049 QFont font() const;
00050 QColor fgColour() const;
00051 QColor bgColour() const;
00052 const ColourList& colours() const { return mColourList; }
00053 void setFgColour(const QColor&);
00054 void setBgColour(const QColor&);
00055 void setColours(const ColourList&);
00056 QString sampleText() const;
00057 void setSampleText(const QString& text);
00058 bool isReadOnly() const { return mReadOnly; }
00059 void setReadOnly(bool);
00060
00061 private slots:
00062 void setSampleColour();
00063 void slotDefaultFontToggled(bool);
00064 void slotAddColour();
00065 void slotRemoveColour();
00066
00067 private:
00068 ColourCombo* mFgColourButton;
00069 ColourCombo* mBgColourButton;
00070 QPushButton* mRemoveColourButton;
00071 KFontChooser* mFontChooser;
00072 CheckBox* mDefaultFont;
00073 ColourList mColourList;
00074 bool mReadOnly;
00075 };
00076
00077 #endif
|