• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kfontchooser.h

Go to the documentation of this file.
00001 /*
00002     Requires the Qt widget libraries, available at no cost at
00003     http://www.troll.no
00004 
00005     Copyright (C) 1997 Bernd Johannes Wuebben <wuebben@kde.org>
00006     Copyright (c) 1999 Preston Brown <pbrown@kde.org>
00007     Copyright (c) 1999 Mario Weilguni <mweilguni@kde.org>
00008 
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Library General Public
00011     License as published by the Free Software Foundation; either
00012     version 2 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Library General Public License for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with this library; see the file COPYING.LIB.  If not, write to
00021     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022     Boston, MA 02110-1301, USA.
00023 */
00024 #ifndef K_FONT_CHOOSER_H
00025 #define K_FONT_CHOOSER_H
00026 
00027 #include <kdeui_export.h>
00028 #include <QtGui/QWidget>
00029 
00030 class QFont;
00031 class QStringList;
00032 
00045 class KDEUI_EXPORT KFontChooser : public QWidget
00046 {
00047   Q_OBJECT
00048   Q_PROPERTY( QFont font READ font WRITE setFont USER true )
00049 
00050 public:
00056     enum FontColumn { FamilyList=0x01, StyleList=0x02, SizeList=0x04};
00057 
00063     enum FontDiff { NoFontDiffFlags = 0,
00064                     FontDiffFamily = 1,
00065                     FontDiffStyle = 2,
00066                     FontDiffSize = 4,
00067                     AllFontDiffs = FontDiffFamily | FontDiffStyle | FontDiffSize };
00068     Q_DECLARE_FLAGS( FontDiffFlags, FontDiff )
00069 
00070     
00075     enum DisplayFlag { NoDisplayFlags = 0,
00076                        FixedFontsOnly = 1,
00077                        DisplayFrame = 2,
00078                        ShowDifferences = 4 };
00079     Q_DECLARE_FLAGS( DisplayFlags, DisplayFlag )
00080 
00081   
00110   explicit KFontChooser( QWidget *parent = 0L,
00111                          const DisplayFlags& flags = DisplayFrame,
00112                          const QStringList &fontList = QStringList(),
00113                          int visibleListSize = 8,
00114                          Qt::CheckState *sizeIsRelativeState = 0L );
00115 
00119   virtual ~KFontChooser();
00120 
00132   void enableColumn( int column, bool state );
00133 
00141   void setFont( const QFont &font, bool onlyFixed = false );
00142 
00147   FontDiffFlags fontDiffFlags() const;
00148 
00152   QFont font() const;
00153 
00157   void setColor( const QColor & col );
00158 
00163   QColor color() const;
00164 
00168   void setBackgroundColor( const QColor & col );
00169 
00174   QColor backgroundColor() const;
00175 
00182   void setSizeIsRelative( Qt::CheckState relative );
00183 
00188   Qt::CheckState sizeIsRelative() const;
00189 
00190 
00194   QString sampleText() const;
00195 
00206   void setSampleText( const QString &text );
00207 
00213   void setSampleBoxVisible( bool visible );
00214 
00226   enum FontListCriteria { FixedWidthFonts=0x01, ScalableFonts=0x02, SmoothScalableFonts=0x04 };
00227 
00235   static void getFontList( QStringList &list, uint fontListCriteria);
00236 
00240   virtual QSize sizeHint( void ) const;
00241 
00242 Q_SIGNALS:
00246   void fontSelected( const QFont &font );
00247 
00248 private:
00249     class Private;
00250     Private * const d;
00251 
00252     Q_DISABLE_COPY(KFontChooser)
00253 
00254     Q_PRIVATE_SLOT(d, void _k_toggled_checkbox())
00255     Q_PRIVATE_SLOT(d, void _k_family_chosen_slot(const QString&))
00256     Q_PRIVATE_SLOT(d, void _k_size_chosen_slot(const QString&))
00257     Q_PRIVATE_SLOT(d, void _k_style_chosen_slot(const QString&))
00258     Q_PRIVATE_SLOT(d, void _k_displaySample(const QFont &font))
00259     Q_PRIVATE_SLOT(d, void _k_showXLFDArea(bool))
00260     Q_PRIVATE_SLOT(d, void _k_size_value_slot(int))
00261 };
00262 
00263 Q_DECLARE_OPERATORS_FOR_FLAGS( KFontChooser::DisplayFlags )
00264 
00265 #endif

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal