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 KFONTSIZEACTION_H |
17 | #define KFONTSIZEACTION_H |
18 | |
19 | #include <kselectaction.h> |
20 | |
21 | class KFontSizeActionPrivate; |
22 | |
23 | /** |
24 | * @class KFontSizeAction kfontsizeaction.h KFontSizeAction |
25 | * |
26 | * An action to allow changing of the font size. |
27 | * This action will be shown as a combobox on a toolbar with a proper set of font sizes. |
28 | */ |
29 | class KWIDGETSADDONS_EXPORT KFontSizeAction : public KSelectAction |
30 | { |
31 | Q_OBJECT |
32 | Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize) |
33 | |
34 | public: |
35 | explicit KFontSizeAction(QObject *parent); |
36 | KFontSizeAction(const QString &text, QObject *parent); |
37 | KFontSizeAction(const QIcon &icon, const QString &text, QObject *parent); |
38 | |
39 | ~KFontSizeAction() override; |
40 | |
41 | int fontSize() const; |
42 | |
43 | void setFontSize(int size); |
44 | |
45 | Q_SIGNALS: |
46 | void fontSizeChanged(int); |
47 | |
48 | protected Q_SLOTS: |
49 | /** |
50 | * This function is called whenever an action from the selections is triggered. |
51 | */ |
52 | void slotActionTriggered(QAction *action) override; |
53 | |
54 | private: |
55 | Q_DECLARE_PRIVATE(KFontSizeAction) |
56 | }; |
57 | |
58 | #endif |
59 | |