File indexing completed on 2024-04-28 03:59:05

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 1999 Reginald Stadlbauer <reggie@kde.org>
0004     SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
0005     SPDX-FileCopyrightText: 2000 Nicolas Hadacek <haadcek@kde.org>
0006     SPDX-FileCopyrightText: 2000 Kurt Granroth <granroth@kde.org>
0007     SPDX-FileCopyrightText: 2000 Michael Koch <koch@kde.org>
0008     SPDX-FileCopyrightText: 2001 Holger Freyther <freyther@kde.org>
0009     SPDX-FileCopyrightText: 2002 Ellis Whitehead <ellis@kde.org>
0010     SPDX-FileCopyrightText: 2003 Andras Mantia <amantia@kde.org>
0011     SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <rodda@kde.org>
0012 
0013     SPDX-License-Identifier: LGPL-2.0-only
0014 */
0015 
0016 #ifndef KFONTACTION_H
0017 #define KFONTACTION_H
0018 
0019 #include <kselectaction.h>
0020 
0021 class KFontActionPrivate;
0022 
0023 /**
0024  * @class KFontAction kfontaction.h KFontAction
0025  *
0026  * An action to select a font family.
0027  * On a toolbar this will show a combobox with all the fonts on the system.
0028  */
0029 class KWIDGETSADDONS_EXPORT KFontAction : public KSelectAction
0030 {
0031     Q_OBJECT
0032     Q_PROPERTY(QString font READ font WRITE setFont)
0033 
0034 public:
0035     KFontAction(uint fontListCriteria, QObject *parent);
0036     explicit KFontAction(QObject *parent);
0037     KFontAction(const QString &text, QObject *parent);
0038     KFontAction(const QIcon &icon, const QString &text, QObject *parent);
0039     ~KFontAction() override;
0040 
0041     QString font() const;
0042 
0043     void setFont(const QString &family);
0044 
0045     QWidget *createWidget(QWidget *parent) override;
0046 
0047 private:
0048     Q_DECLARE_PRIVATE(KFontAction)
0049 };
0050 
0051 #endif