libopie API Documentation

ofontselector.h

00001 /*
00002                =.            This file is part of the OPIE Project
00003              .=l.            Copyright (c)  2002 Robert Griebl <sandman@handhelds.org>
00004            .>+-=
00005  _;:,     .>    :=|.         This library is free software; you can
00006 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00007 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00008 .="- .-=="i,     .._         License as published by the Free Software
00009  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00010      ._= =}       :          or (at your option) any later version.
00011     .%`+i>       _;_.
00012     .i_,=:_.      -<s.       This library is distributed in the hope that
00013      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00014     : ..    .:,     . . .    without even the implied warranty of
00015     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00016   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00017 ..}^=.=       =       ;      Library General Public License for more
00018 ++=   -.     .`     .:       details.
00019  :     =  ...= . :.=-
00020  -.   .:....=;==+<;          You should have received a copy of the GNU
00021   -_. . .   )=.  =           Library General Public License along with
00022     --        :-=`           this library; see the file COPYING.LIB.
00023                              If not, write to the Free Software Foundation,
00024                              Inc., 59 Temple Place - Suite 330,
00025                              Boston, MA 02111-1307, USA.
00026 
00027 */
00028 
00029 #ifndef OPIE_FONTSELECTOR_H__
00030 #define OPIE_FONTSELECTOR_H__
00031 
00032 #include <qwidget.h>
00033 
00034 class QListBox;
00035 class OFontSelectorPrivate;
00036 
00048 class OFontSelector : public QWidget
00049 {
00050     Q_OBJECT
00051 
00052 public:
00053     OFontSelector ( bool withpreview, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
00054     virtual ~OFontSelector ( );
00055 
00056     bool selectedFont ( QString &family, QString &style, int &size );
00057     bool selectedFont ( QString &family, QString &style, int &size, QString &charset );
00058 
00059     QFont selectedFont ( );
00060 
00061     bool setSelectedFont ( const QFont & );
00062     bool setSelectedFont ( const QString &family, const QString &style, int size, const QString &charset = 0 );
00063 
00064     QString fontFamily ( ) const;
00065     QString fontStyle ( ) const;
00066     int fontSize ( ) const;
00067     QString fontCharSet ( ) const;
00068 
00069 signals:
00073     void fontSelected ( const QFont & );
00074 
00075 protected slots:
00077     virtual void fontFamilyClicked ( int );
00079     virtual void fontStyleClicked ( int );
00081     virtual void fontSizeClicked ( int );
00082 
00083 protected:
00084     virtual void resizeEvent ( QResizeEvent *re );
00085 
00086 private:
00087     void loadFonts ( QListBox * );
00088 
00089     void changeFont ( );
00090 
00091 private:
00092     OFontSelectorPrivate *d;
00093 };
00094 
00095 #endif
00096 
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:44 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001