kfontcombo.h
00001 /* This file is part of the KDE libraries 00002 Copyright (c) 2001 Malte Starostik <malte@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00016 Boston, MA 02111-1307, USA. 00017 */ 00018 00019 // $Id: kfontcombo.h,v 1.8 2002/03/13 21:37:53 malte Exp $ 00020 00021 #ifndef _KFONTCOMBO_H_ 00022 #define _KFONTCOMBO_H_ 00023 00024 #include <kcombobox.h> 00025 00037 class KFontCombo : public KComboBox 00038 { 00039 Q_OBJECT 00040 Q_PROPERTY(bool bold READ bold WRITE setBold DESIGNABLE true) 00041 Q_PROPERTY(bool italic READ italic WRITE setItalic DESIGNABLE true) 00042 Q_PROPERTY(bool underline READ underline WRITE setUnderline DESIGNABLE true) 00043 Q_PROPERTY(bool strikeOut READ strikeOut WRITE setStrikeOut DESIGNABLE true) 00044 Q_PROPERTY(int fontSize READ size WRITE setSize DESIGNABLE true) 00045 public: 00052 KFontCombo(QWidget *parent, const char *name = 0); 00060 KFontCombo(const QStringList &fonts, QWidget *parent, const char *name = 0); 00064 virtual ~KFontCombo(); 00065 00071 void setFonts(const QStringList &fonts); 00077 void setCurrentFont(const QString &family); 00081 QString currentFont() const; 00082 00088 void setBold(bool bold); 00094 bool bold() const; 00100 void setItalic(bool bold); 00106 bool italic() const; 00112 void setUnderline(bool bold); 00118 bool underline() const; 00124 void setStrikeOut(bool bold); 00130 bool strikeOut() const; 00136 void setSize(int size); 00142 int size() const; 00143 00150 static bool displayFonts(); 00151 00152 virtual void setCurrentItem(int i); 00153 00154 protected: 00159 void updateFonts(); 00160 00161 private: 00162 void init(); 00163 00164 private: 00165 friend class KFontListItem; 00166 protected: 00167 virtual void virtual_hook( int id, void* data ); 00168 private: 00169 struct KFontComboPrivate *d; 00170 }; 00171 00172 #endif 00173