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