1/*
2 This file is part of the KDE Libraries
3 SPDX-FileCopyrightText: 2007 Krzysztof Lichota <lichota@mimuw.edu.pl>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef _KSWITCHLANGUAGEDIALOG_H_
9#define _KSWITCHLANGUAGEDIALOG_H_
10
11#include <kxmlgui_export.h>
12
13#include <QDialog>
14
15namespace KDEPrivate
16{
17KXMLGUI_EXPORT void setApplicationSpecificLanguage(const QByteArray &languageCode);
18KXMLGUI_EXPORT void initializeLanguages();
19
20class KSwitchLanguageDialogPrivate;
21
22/**
23 * @short Standard "switch application language" dialog box.
24 *
25 * This class provides "switch application language" dialog box that is used
26 * in KHelpMenu
27 *
28 * @author Krzysztof Lichota (lichota@mimuw.edu.pl)
29 * @internal
30 */
31
32class KSwitchLanguageDialog : public QDialog
33{
34 Q_OBJECT
35
36public:
37 /**
38 * Constructor. Creates a fully featured "Switch application language" dialog box.
39 * Note that this dialog is made modeless in the KHelpMenu class so
40 * the users may expect a modeless dialog.
41 *
42 * @param parent The parent of the dialog box. You should use the
43 * toplevel window so that the dialog becomes centered.
44 * @param name Internal name of the widget. This name in not used in the
45 * caption.
46 * @param modal If false, this widget will be modeless and must be
47 * made visible using QWidget::show(). Otherwise it will be
48 * modal and must be made visible using QWidget::exec()
49 */
50 explicit KSwitchLanguageDialog(QWidget *parent = nullptr);
51
52 ~KSwitchLanguageDialog() override;
53
54protected Q_SLOTS:
55 /**
56 * Activated when the Ok button has been clicked.
57 */
58 virtual void slotOk();
59 void slotDefault();
60
61 /**
62 Called when one of language buttons changes state.
63 */
64 virtual void languageOnButtonChanged(const QString &);
65
66 /**
67 Called to add one language button to dialog.
68 */
69 virtual void slotAddLanguageButton();
70
71 /**
72 Called when "Remove" language button is clicked.
73 */
74 virtual void removeButtonClicked();
75
76private:
77 KSwitchLanguageDialogPrivate *const d;
78
79 friend class KSwitchLanguageDialogPrivate;
80};
81
82}
83
84#endif
85

source code of kxmlgui/src/kswitchlanguagedialog_p.h