1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the QtWidgets module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#ifndef QFONTDIALOG_P_H
41#define QFONTDIALOG_P_H
42
43//
44// W A R N I N G
45// -------------
46//
47// This file is not part of the Qt API. It exists purely as an
48// implementation detail. This header file may change from version to
49// version without notice, or even be removed.
50//
51// We mean it.
52//
53//
54
55#include <QtWidgets/private/qtwidgetsglobal_p.h>
56#include "private/qdialog_p.h"
57#include "qfontdatabase.h"
58#include "qfontdialog.h"
59#include <qpa/qplatformdialoghelper.h>
60#include "qsharedpointer.h"
61
62QT_REQUIRE_CONFIG(fontdialog);
63
64QT_BEGIN_NAMESPACE
65
66class QBoxLayout;
67class QCheckBox;
68class QComboBox;
69class QDialogButtonBox;
70class QFontListView;
71class QGroupBox;
72class QLabel;
73class QLineEdit;
74
75class Q_AUTOTEST_EXPORT QFontDialogPrivate : public QDialogPrivate
76{
77 Q_DECLARE_PUBLIC(QFontDialog)
78
79public:
80 QFontDialogPrivate();
81 ~QFontDialogPrivate();
82
83 QPlatformFontDialogHelper *platformFontDialogHelper() const
84 { return static_cast<QPlatformFontDialogHelper *>(platformHelper()); }
85
86 void updateFamilies();
87 void updateStyles();
88 void updateSizes();
89
90 static QFont getFont(bool *ok, const QFont &initial, QWidget *parent,
91 const QString &title, QFontDialog::FontDialogOptions options);
92
93 void init();
94 void _q_sizeChanged(const QString &);
95 void _q_familyHighlighted(int);
96 void _q_writingSystemHighlighted(int);
97 void _q_styleHighlighted(int);
98 void _q_sizeHighlighted(int);
99 void _q_updateSample();
100 void updateSampleFont(const QFont &newFont);
101 void retranslateStrings();
102
103 QLabel *familyAccel;
104 QLineEdit *familyEdit;
105 QFontListView *familyList;
106
107 QLabel *styleAccel;
108 QLineEdit *styleEdit;
109 QFontListView *styleList;
110
111 QLabel *sizeAccel;
112 QLineEdit *sizeEdit;
113 QFontListView *sizeList;
114
115 QGroupBox *effects;
116 QCheckBox *strikeout;
117 QCheckBox *underline;
118 QComboBox *color;
119
120 QGroupBox *sample;
121 QLineEdit *sampleEdit;
122
123 QLabel *writingSystemAccel;
124 QComboBox *writingSystemCombo;
125
126 QBoxLayout *buttonLayout;
127 QBoxLayout *effectsLayout;
128 QBoxLayout *sampleLayout;
129 QBoxLayout *sampleEditLayout;
130
131 QDialogButtonBox *buttonBox;
132
133 QFontDatabase fdb;
134 QString family;
135 QFontDatabase::WritingSystem writingSystem;
136 QString style;
137 int size;
138 bool smoothScalable;
139 QFont selectedFont;
140 QSharedPointer<QFontDialogOptions> options;
141 QPointer<QObject> receiverToDisconnectOnClose;
142 QByteArray memberToDisconnectOnClose;
143
144 bool canBeNativeDialog() const override;
145 void _q_runNativeAppModalPanel();
146
147private:
148 virtual void initHelper(QPlatformDialogHelper *) override;
149 virtual void helperPrepareShow(QPlatformDialogHelper *) override;
150};
151
152QT_END_NAMESPACE
153
154#endif // QFONTDIALOG_P_H
155

source code of qtbase/src/widgets/dialogs/qfontdialog_p.h