1/*
2 *
3 * SPDX-FileCopyrightText: 2004 Zack Rusin <zack@kde.org>
4 * SPDX-FileCopyrightText: 2020 Benjamin Port <benjamin.port@kde.org>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 */
8#ifndef SONNET_CONFIGVIEW_H
9#define SONNET_CONFIGVIEW_H
10
11#include <QWidget>
12
13#include "sonnetui_export.h"
14
15#include <memory>
16
17namespace Sonnet
18{
19class ConfigViewPrivate;
20
21/*!
22 * \class Sonnet::ConfigView
23 * \inheaderfile Sonnet/ConfigView
24 * \inmodule SonnetUi
25 *
26 * \brief The sonnet ConfigView.
27 */
28class SONNETUI_EXPORT ConfigView : public QWidget
29{
30 Q_OBJECT
31
32 /*!
33 * \property Sonnet::ConfigView::language
34 */
35 Q_PROPERTY(QString language READ language WRITE setLanguage)
36
37 /*!
38 * \property Sonnet::ConfigView::ignoreList
39 */
40 Q_PROPERTY(QStringList ignoreList READ ignoreList WRITE setIgnoreList)
41
42 /*!
43 * \property Sonnet::ConfigView::preferredLanguages
44 */
45 Q_PROPERTY(QStringList preferredLanguages READ preferredLanguages WRITE setPreferredLanguages)
46
47 /*!
48 * \property Sonnet::ConfigView::backgroundCheckingButtonShown
49 */
50 Q_PROPERTY(bool backgroundCheckingButtonShown READ backgroundCheckingButtonShown WRITE setBackgroundCheckingButtonShown)
51
52 /*!
53 * \property Sonnet::ConfigView::showNoBackendFound
54 */
55 Q_PROPERTY(bool showNoBackendFound READ noBackendFoundVisible WRITE setNoBackendFoundVisible)
56public:
57 /*!
58 */
59 explicit ConfigView(QWidget *parent = nullptr);
60 ~ConfigView() override;
61
62 /*!
63 */
64 bool backgroundCheckingButtonShown() const;
65 /*!
66 */
67 bool noBackendFoundVisible() const;
68 /*!
69 */
70 QStringList preferredLanguages() const;
71 /*!
72 */
73 QString language() const;
74 /*!
75 */
76 QStringList ignoreList() const;
77
78public Q_SLOTS:
79 /*!
80 */
81 void setNoBackendFoundVisible(bool show);
82 /*!
83 */
84 void setBackgroundCheckingButtonShown(bool);
85 /*!
86 */
87 void setPreferredLanguages(const QStringList &ignoreList);
88 /*!
89 */
90 void setLanguage(const QString &language);
91 /*!
92 */
93 void setIgnoreList(const QStringList &ignoreList);
94
95Q_SIGNALS:
96 /*!
97 */
98 void configChanged();
99
100private:
101 std::unique_ptr<ConfigViewPrivate> const d;
102};
103}
104
105#endif
106

source code of sonnet/src/ui/configview.h