1 | /* |
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 1999 Reginald Stadlbauer <reggie@kde.org> |
4 | SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org> |
5 | SPDX-FileCopyrightText: 2000 Nicolas Hadacek <haadcek@kde.org> |
6 | SPDX-FileCopyrightText: 2000 Kurt Granroth <granroth@kde.org> |
7 | SPDX-FileCopyrightText: 2000 Michael Koch <koch@kde.org> |
8 | SPDX-FileCopyrightText: 2001 Holger Freyther <freyther@kde.org> |
9 | SPDX-FileCopyrightText: 2002 Ellis Whitehead <ellis@kde.org> |
10 | SPDX-FileCopyrightText: 2003 Andras Mantia <amantia@kde.org> |
11 | SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <rodda@kde.org> |
12 | |
13 | SPDX-License-Identifier: LGPL-2.0-only |
14 | */ |
15 | |
16 | #ifndef KFONTACTION_H |
17 | #define KFONTACTION_H |
18 | |
19 | #include <kselectaction.h> |
20 | |
21 | class KFontActionPrivate; |
22 | |
23 | /** |
24 | * @class KFontAction kfontaction.h KFontAction |
25 | * |
26 | * An action to select a font family. |
27 | * On a toolbar this will show a combobox with all the fonts on the system. |
28 | */ |
29 | class KWIDGETSADDONS_EXPORT KFontAction : public KSelectAction |
30 | { |
31 | Q_OBJECT |
32 | Q_PROPERTY(QString font READ font WRITE setFont) |
33 | |
34 | public: |
35 | KFontAction(uint fontListCriteria, QObject *parent); |
36 | explicit KFontAction(QObject *parent); |
37 | KFontAction(const QString &text, QObject *parent); |
38 | KFontAction(const QIcon &icon, const QString &text, QObject *parent); |
39 | ~KFontAction() override; |
40 | |
41 | QString font() const; |
42 | |
43 | void setFont(const QString &family); |
44 | |
45 | QWidget *createWidget(QWidget *parent) override; |
46 | |
47 | private: |
48 | Q_DECLARE_PRIVATE(KFontAction) |
49 | }; |
50 | |
51 | #endif |
52 | |