Sonnet

dictionarycombobox.h
1/*
2 * SPDX-FileCopyrightText: 2003 Ingo Kloecker <kloecker@kde.org>
3 * SPDX-FileCopyrightText: 2008 Tom Albers <tomalbers@kde.nl>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7
8#ifndef SONNET_DICTIONARYCOMBOBOX_H
9#define SONNET_DICTIONARYCOMBOBOX_H
10
11#include "sonnetui_export.h"
12
13#include <QComboBox>
14
15#include <memory>
16
17namespace Sonnet
18{
19class DictionaryComboBoxPrivate;
20/**
21 * @class Sonnet::DictionaryComboBox dictionarycombobox.h <Sonnet/DictionaryComboBox>
22 *
23 * @short A combo box for selecting the dictionary used for spell checking.
24 * @author Ingo Kloecker <kloecker@kde.org>
25 * @author Tom Albers <tomalbers@kde.nl>
26 * @since 4.2
27 **/
28
29class SONNETUI_EXPORT DictionaryComboBox : public QComboBox
30{
31 Q_OBJECT
32public:
33 /**
34 * Constructor
35 */
36 explicit DictionaryComboBox(QWidget *parent = nullptr);
37
38 /**
39 * Destructor
40 */
42
43 /**
44 * Clears the widget and reloads the dictionaries from Sonnet.
45 * Remember to set the dictionary you want selected after calling this function.
46 */
48
49 /**
50 * Returns the current dictionary name, for example "German (Switzerland)"
51 */
53
54 /**
55 * Returns the current dictionary, for example "de_CH"
56 */
58
59 /**
60 * Sets the current dictionaryName to the given dictionaryName
61 */
62 void setCurrentByDictionaryName(const QString &dictionaryName);
63
64 /**
65 * Sets the current dictionary to the given dictionary
66 * Return true if dictionary was found.
67 * @since 5.40
68 * TODO merge with previous method in kf6
69 */
70 bool assignByDictionnary(const QString &dictionary);
71
72 /**
73 * Sets the current dictionaryName to the given dictionaryName
74 * Return true if dictionary was found.
75 * @since 5.40
76 * TODO merge with previous method in kf6
77 */
78 bool assignDictionnaryName(const QString &name);
79
80 /**
81 * Sets the current dictionary to the given dictionary.
82 */
83 void setCurrentByDictionary(const QString &dictionary);
84
85Q_SIGNALS:
86 /**
87 * @em Emitted whenever the current dictionary changes. Either
88 * by user intervention or on setCurrentByDictionaryName() or on
89 * setCurrentByDictionary(). For example "de_CH".
90 */
91 void dictionaryChanged(const QString &dictionary);
92
93 /**
94 * @em Emitted whenever the current dictionary changes. Either
95 * by user intervention or on setCurrentByDictionaryName() or on
96 * setCurrentByDictionary(). For example "German (Switzerland)".
97 */
98 void dictionaryNameChanged(const QString &dictionaryName);
99
100private:
101 std::unique_ptr<DictionaryComboBoxPrivate> const d;
102 Q_PRIVATE_SLOT(d, void slotDictionaryChanged(int))
103};
104}
105
106#endif
A combo box for selecting the dictionary used for spell checking.
DictionaryComboBox(QWidget *parent=nullptr)
Constructor.
void setCurrentByDictionaryName(const QString &dictionaryName)
Sets the current dictionaryName to the given dictionaryName.
QString currentDictionaryName() const
Returns the current dictionary name, for example "German (Switzerland)".
bool assignByDictionnary(const QString &dictionary)
Sets the current dictionary to the given dictionary Return true if dictionary was found.
bool assignDictionnaryName(const QString &name)
Sets the current dictionaryName to the given dictionaryName Return true if dictionary was found.
void dictionaryChanged(const QString &dictionary)
Emitted whenever the current dictionary changes.
void reloadCombo()
Clears the widget and reloads the dictionaries from Sonnet.
void dictionaryNameChanged(const QString &dictionaryName)
Emitted whenever the current dictionary changes.
void setCurrentByDictionary(const QString &dictionary)
Sets the current dictionary to the given dictionary.
~DictionaryComboBox() override
Destructor.
QString currentDictionary() const
Returns the current dictionary, for example "de_CH".
The sonnet namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:15 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.