KTextAddons

translatorconfigurelanguagelistwidget.h
1/*
2 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "texttranslator_export.h"
10#include <QWidget>
11class QListView;
12class QLineEdit;
13class QLabel;
15namespace TextTranslator
16{
17/**
18 * @brief The TranslatorConfigureLanguageListWidget class
19 * @author Laurent Montel <montel@kde.org>
20 */
21class TEXTTRANSLATOR_EXPORT TranslatorConfigureLanguageListWidget : public QWidget
22{
23 Q_OBJECT
24public:
25 explicit TranslatorConfigureLanguageListWidget(const QString &labelText, QWidget *parent = nullptr);
27
28 void clear();
29
30 void addItem(const QString &translatedStr, const QString &languageCode);
31
32 [[nodiscard]] QStringList selectedLanguages() const;
33 void setSelectedLanguages(const QStringList &list);
34
35private:
36 enum LanguageData {
37 LanguageCode = Qt::UserRole + 1,
38 };
39 QListView *const mLanguageListWidget;
40 QLineEdit *const mListSearchLine;
41 QLabel *const mLabel;
42 QStandardItemModel *const mModel;
43};
44}
UserRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.