File indexing completed on 2024-09-29 09:33:16
0001 /* 0002 This file is part of the KDE Libraries 0003 SPDX-FileCopyrightText: 2007 Krzysztof Lichota <lichota@mimuw.edu.pl> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef _KSWITCHLANGUAGEDIALOG_H_ 0009 #define _KSWITCHLANGUAGEDIALOG_H_ 0010 0011 #include <kxmlgui_export.h> 0012 0013 #include <QDialog> 0014 0015 namespace KDEPrivate 0016 { 0017 KXMLGUI_EXPORT void setApplicationSpecificLanguage(const QByteArray &languageCode); 0018 KXMLGUI_EXPORT void initializeLanguages(); 0019 0020 class KSwitchLanguageDialogPrivate; 0021 0022 /** 0023 * @short Standard "switch application language" dialog box. 0024 * 0025 * This class provides "switch application language" dialog box that is used 0026 * in KHelpMenu 0027 * 0028 * @author Krzysztof Lichota (lichota@mimuw.edu.pl) 0029 * @internal 0030 */ 0031 0032 class KSwitchLanguageDialog : public QDialog 0033 { 0034 Q_OBJECT 0035 0036 public: 0037 /** 0038 * Constructor. Creates a fully featured "Switch application language" dialog box. 0039 * Note that this dialog is made modeless in the KHelpMenu class so 0040 * the users may expect a modeless dialog. 0041 * 0042 * @param parent The parent of the dialog box. You should use the 0043 * toplevel window so that the dialog becomes centered. 0044 * @param name Internal name of the widget. This name in not used in the 0045 * caption. 0046 * @param modal If false, this widget will be modeless and must be 0047 * made visible using QWidget::show(). Otherwise it will be 0048 * modal and must be made visible using QWidget::exec() 0049 */ 0050 explicit KSwitchLanguageDialog(QWidget *parent = nullptr); 0051 0052 ~KSwitchLanguageDialog() override; 0053 0054 protected Q_SLOTS: 0055 /** 0056 * Activated when the Ok button has been clicked. 0057 */ 0058 virtual void slotOk(); 0059 void slotDefault(); 0060 0061 /** 0062 Called when one of language buttons changes state. 0063 */ 0064 virtual void languageOnButtonChanged(const QString &); 0065 0066 /** 0067 Called to add one language button to dialog. 0068 */ 0069 virtual void slotAddLanguageButton(); 0070 0071 /** 0072 Called when "Remove" language button is clicked. 0073 */ 0074 virtual void removeButtonClicked(); 0075 0076 private: 0077 KSwitchLanguageDialogPrivate *const d; 0078 0079 friend class KSwitchLanguageDialogPrivate; 0080 }; 0081 0082 } 0083 0084 #endif