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 |
25 | * \inmodule KWidgetsAddons |
26 | * |
27 | * \brief An action to allow changing of the font size. |
28 | * |
29 | * This action will be shown as a combobox on a toolbar with a proper set of font sizes. |
30 | */ |
31 | class KWIDGETSADDONS_EXPORT KFontSizeAction : public KSelectAction |
32 | { |
33 | Q_OBJECT |
34 | |
35 | /*! |
36 | * \property KFontSizeAction::fontSize |
37 | */ |
38 | Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize) |
39 | |
40 | public: |
41 | /*! |
42 | * |
43 | */ |
44 | explicit KFontSizeAction(QObject *parent); |
45 | |
46 | /*! |
47 | * |
48 | */ |
49 | KFontSizeAction(const QString &text, QObject *parent); |
50 | |
51 | /*! |
52 | * |
53 | */ |
54 | KFontSizeAction(const QIcon &icon, const QString &text, QObject *parent); |
55 | |
56 | ~KFontSizeAction() override; |
57 | |
58 | /*! |
59 | * |
60 | */ |
61 | int fontSize() const; |
62 | |
63 | /*! |
64 | * |
65 | */ |
66 | void setFontSize(int size); |
67 | |
68 | Q_SIGNALS: |
69 | /*! |
70 | * |
71 | */ |
72 | void fontSizeChanged(int); |
73 | |
74 | protected Q_SLOTS: |
75 | /*! |
76 | * This function is called whenever an action from the selections is triggered. |
77 | */ |
78 | void slotActionTriggered(QAction *action) override; |
79 | |
80 | private: |
81 | Q_DECLARE_PRIVATE(KFontSizeAction) |
82 | }; |
83 | |
84 | #endif |
85 | |