| 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 |
| 25 | * \inmodule KWidgetsAddons |
| 26 | * |
| 27 | * \brief An action to select a font family. |
| 28 | * |
| 29 | * On a toolbar this will show a combobox with all the fonts on the system. |
| 30 | */ |
| 31 | class KWIDGETSADDONS_EXPORT KFontAction : public KSelectAction |
| 32 | { |
| 33 | Q_OBJECT |
| 34 | |
| 35 | /*! |
| 36 | * \property KFontAction::font |
| 37 | */ |
| 38 | Q_PROPERTY(QString font READ font WRITE setFont) |
| 39 | |
| 40 | public: |
| 41 | /*! |
| 42 | * |
| 43 | */ |
| 44 | KFontAction(uint fontListCriteria, QObject *parent); |
| 45 | |
| 46 | /*! |
| 47 | * |
| 48 | */ |
| 49 | explicit KFontAction(QObject *parent); |
| 50 | KFontAction(const QString &text, QObject *parent); |
| 51 | KFontAction(const QIcon &icon, const QString &text, QObject *parent); |
| 52 | ~KFontAction() override; |
| 53 | |
| 54 | /*! |
| 55 | * |
| 56 | */ |
| 57 | QString font() const; |
| 58 | |
| 59 | /*! |
| 60 | * |
| 61 | */ |
| 62 | void setFont(const QString &family); |
| 63 | |
| 64 | /*! |
| 65 | * |
| 66 | */ |
| 67 | QWidget *createWidget(QWidget *parent) override; |
| 68 | |
| 69 | private: |
| 70 | Q_DECLARE_PRIVATE(KFontAction) |
| 71 | }; |
| 72 | |
| 73 | #endif |
| 74 | |