1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org> |
3 | (C) 1999 Simon Hausmann <hausmann@kde.org> |
4 | (C) 2000 Nicolas Hadacek <haadcek@kde.org> |
5 | (C) 2000 Kurt Granroth <granroth@kde.org> |
6 | (C) 2000 Michael Koch <koch@kde.org> |
7 | (C) 2001 Holger Freyther <freyther@kde.org> |
8 | (C) 2002 Ellis Whitehead <ellis@kde.org> |
9 | (C) 2003 Andras Mantia <amantia@kde.org> |
10 | (C) 2005-2006 Hamish Rodda <rodda@kde.org> |
11 | |
12 | This library is free software; you can redistribute it and/or |
13 | modify it under the terms of the GNU Library General Public |
14 | License version 2 as published by the Free Software Foundation. |
15 | |
16 | This library is distributed in the hope that it will be useful, |
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
19 | Library General Public License for more details. |
20 | |
21 | You should have received a copy of the GNU Library General Public License |
22 | along with this library; see the file COPYING.LIB. If not, write to |
23 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 | Boston, MA 02110-1301, USA. |
25 | */ |
26 | |
27 | #ifndef KFONTACTION_H |
28 | #define KFONTACTION_H |
29 | |
30 | #include <kselectaction.h> |
31 | |
32 | /** |
33 | * An action to select a font family. |
34 | * On a toolbar this will show a combobox with all the fonts on the system. |
35 | */ |
36 | class KDEUI_EXPORT KFontAction : public KSelectAction |
37 | { |
38 | Q_OBJECT |
39 | Q_PROPERTY( QString font READ font WRITE setFont ) |
40 | |
41 | public: |
42 | KFontAction(uint fontListCriteria, QObject *parent); |
43 | explicit KFontAction(QObject *parent); |
44 | KFontAction(const QString& text, QObject *parent); |
45 | KFontAction(const KIcon &icon, const QString &text, QObject *parent); |
46 | virtual ~KFontAction(); |
47 | |
48 | QString font() const; |
49 | |
50 | void setFont( const QString &family ); |
51 | |
52 | virtual QWidget* createWidget(QWidget* parent); |
53 | |
54 | private: |
55 | class KFontActionPrivate; |
56 | KFontActionPrivate * const d; |
57 | |
58 | Q_PRIVATE_SLOT( d, void _k_slotFontChanged(const QFont&) ) |
59 | }; |
60 | |
61 | #endif |
62 | |