File indexing completed on 2025-02-16 13:11:42
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 KFONTSIZEACTION_H 0017 #define KFONTSIZEACTION_H 0018 0019 #include <kselectaction.h> 0020 0021 class KFontSizeActionPrivate; 0022 0023 /** 0024 * @class KFontSizeAction kfontsizeaction.h KFontSizeAction 0025 * 0026 * An action to allow changing of the font size. 0027 * This action will be shown as a combobox on a toolbar with a proper set of font sizes. 0028 */ 0029 class KWIDGETSADDONS_EXPORT KFontSizeAction : public KSelectAction 0030 { 0031 Q_OBJECT 0032 Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize) 0033 0034 public: 0035 explicit KFontSizeAction(QObject *parent); 0036 KFontSizeAction(const QString &text, QObject *parent); 0037 KFontSizeAction(const QIcon &icon, const QString &text, QObject *parent); 0038 0039 ~KFontSizeAction() override; 0040 0041 int fontSize() const; 0042 0043 void setFontSize(int size); 0044 0045 Q_SIGNALS: 0046 void fontSizeChanged(int); 0047 0048 protected Q_SLOTS: 0049 /** 0050 * This function is called whenever an action from the selections is triggered. 0051 */ 0052 void actionTriggered(QAction *action) override; 0053 0054 private: 0055 Q_DECLARE_PRIVATE(KFontSizeAction) 0056 #if KWIDGETSADDONS_BUILD_DEPRECATED_SINCE(5, 79) 0057 QT_WARNING_PUSH 0058 QT_WARNING_DISABLE_CLANG("-Wunused-private-field") 0059 // Unused, kept for ABI compatibility 0060 const void *__kwidgetsaddons_d_do_not_use; 0061 QT_WARNING_POP 0062 #endif 0063 }; 0064 0065 #endif