summaryrefslogtreecommitdiffabout
path: root/microkde/ofontselector.h
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /microkde/ofontselector.h
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'microkde/ofontselector.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/ofontselector.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/microkde/ofontselector.h b/microkde/ofontselector.h
new file mode 100644
index 0000000..b819c45
--- a/dev/null
+++ b/microkde/ofontselector.h
@@ -0,0 +1,96 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef OPIE_FONTSELECTOR_H__
30#define OPIE_FONTSELECTOR_H__
31
32#include <qwidget.h>
33
34class QListBox;
35class OFontSelectorPrivate;
36
37/**
38 * This class lets you chose a Font out of a list of Fonts.
39 * It can show a preview too. This selector will use all available
40 * fonts
41 *
42 *
43 * @short A widget to select a font
44 * @see QWidget
45 * @see QFont
46 * @author Rober Griebl
47 */
48class OFontSelector : public QWidget
49{
50 Q_OBJECT
51
52public:
53 OFontSelector ( bool withpreview, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
54 virtual ~OFontSelector ( );
55
56 bool selectedFont ( QString &family, QString &style, int &size );
57 bool selectedFont ( QString &family, QString &style, int &size, QString &charset );
58
59 QFont selectedFont ( );
60
61 bool setSelectedFont ( const QFont & );
62 bool setSelectedFont ( const QString &family, const QString &style, int size, const QString &charset = 0 );
63
64 QString fontFamily ( ) const;
65 QString fontStyle ( ) const;
66 int fontSize ( ) const;
67 QString fontCharSet ( ) const;
68
69signals:
70 /**
71 * This signal gets emitted when a font got chosen
72 */
73 void fontSelected ( const QFont & );
74
75protected slots:
76 /** @internal */
77 virtual void fontFamilyClicked ( int );
78 /** @internal */
79 virtual void fontStyleClicked ( int );
80 /** @internal */
81 virtual void fontSizeClicked ( int );
82
83protected:
84 virtual void resizeEvent ( QResizeEvent *re );
85
86private:
87 void loadFonts ( QListBox * );
88
89 void changeFont ( );
90
91private:
92 OFontSelectorPrivate *d;
93};
94
95#endif
96