00001
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 <tdeversion.h>
00025 #include <tqwidget.h>
00026 #include <tqstringlist.h>
00027 #include <tdefontdialog.h>
00028 #include "colourlist.h"
00029
00030 class ColourCombo;
00031 class TQPushButton;
00032 class CheckBox;
00033
00034
00035 class FontColourChooser : public TQWidget
00036 {
00037 Q_OBJECT
00038
00039 public:
00040 explicit FontColourChooser(TQWidget* parent = 0, const char* name = 0,
00041 bool onlyFixed = false,
00042 const TQStringList& fontList = TQStringList(),
00043 const TQString& frameLabel = i18n("Requested font"),
00044 bool editColours = false, bool fg = true, bool defaultFont = false,
00045 int visibleListSize = 8);
00046
00047 void setDefaultFont();
00048 void setFont(const TQFont&, bool onlyFixed = false);
00049 bool defaultFont() const;
00050 TQFont font() const;
00051 TQColor fgColour() const;
00052 TQColor bgColour() const;
00053 const ColourList& colours() const { return mColourList; }
00054 void setFgColour(const TQColor&);
00055 void setBgColour(const TQColor&);
00056 void setColours(const ColourList&);
00057 TQString sampleText() const;
00058 void setSampleText(const TQString& text);
00059 bool isReadOnly() const { return mReadOnly; }
00060 void setReadOnly(bool);
00061 virtual bool eventFilter(TQObject*, TQEvent*);
00062
00063 private slots:
00064 void setSampleColour();
00065 void slotDefaultFontToggled(bool);
00066 void slotAddColour();
00067 void slotRemoveColour();
00068
00069 private:
00070 ColourCombo* mFgColourButton;
00071 ColourCombo* mBgColourButton;
00072 TQPushButton* mRemoveColourButton;
00073 TDEFontChooser* mFontChooser;
00074 CheckBox* mDefaultFont;
00075 ColourList mColourList;
00076 bool mReadOnly;
00077 };
00078
00079 #endif