41
41
const QLatin1String KEY_PRESS_FEEDBACK_KEY = QLatin1String("keyPressFeedback");
44
* \brief KeyboadSettings::KeyboadSettings class to load the settings, and
44
* \brief KeyboardSettings::KeyboardSettings class to load the settings, and
45
45
* listens on runtime to changes of them
48
KeyboadSettings::KeyboadSettings(QObject *parent) :
48
KeyboardSettings::KeyboardSettings(QObject *parent) :
50
50
, m_settings(new QGSettings("com.canonical.keyboard.maliit",
51
51
"/com/canonical/keyboard/maliit/", this))
58
* \brief KeyboadSettings::enabledLanguages returns a list of languages that are
58
* \brief KeyboardSettings::enabledLanguages returns a list of languages that are
62
QStringList KeyboadSettings::enabledLanguages() const
62
QStringList KeyboardSettings::enabledLanguages() const
64
64
return m_settings->get(ENABLED_LANGUAGES_KEY).toStringList();
68
* \brief KeyboadSettings::autoCapitalization returns true id the first letter
68
* \brief KeyboardSettings::autoCapitalization returns true id the first letter
69
69
* of each sentence should be capitalized
72
bool KeyboadSettings::autoCapitalization() const
72
bool KeyboardSettings::autoCapitalization() const
74
74
return m_settings->get(AUTO_CAPITALIZATION_KEY).toBool();
78
* \brief KeyboadSettings::autoCompletion returns true if the current word should
78
* \brief KeyboardSettings::autoCompletion returns true if the current word should
79
79
* be completed with first suggestion when hitting space
82
bool KeyboadSettings::autoCompletion() const
82
bool KeyboardSettings::autoCompletion() const
84
84
return m_settings->get(AUTO_COMPLETION_KEY).toBool();
88
* \brief KeyboadSettings::predictiveText returns true, if potential words in the
88
* \brief KeyboardSettings::predictiveText returns true, if potential words in the
89
89
* word ribbon should be suggested
92
bool KeyboadSettings::predictiveText() const
92
bool KeyboardSettings::predictiveText() const
94
94
return m_settings->get(PREDICTIVE_TEXT_KEY).toBool();
98
* \brief KeyboadSettings::keyPressFeedback returns true if feedback is enabled
98
* \brief KeyboardSettings::keyPressFeedback returns true if feedback is enabled
99
99
* when the user presses a keyboad key
102
bool KeyboadSettings::keyPressFeedback() const
102
bool KeyboardSettings::keyPressFeedback() const
104
104
return m_settings->get(KEY_PRESS_FEEDBACK_KEY).toBool();
108
* \brief KeyboadSettings::settingUpdated slot to handle changes in the settings backend
108
* \brief KeyboardSettings::settingUpdated slot to handle changes in the settings backend
109
109
* A specialized signal is emitted for the affected setting
112
void KeyboadSettings::settingUpdated(const QString &key)
112
void KeyboardSettings::settingUpdated(const QString &key)
114
114
if (key == ENABLED_LANGUAGES_KEY) {
115
115
Q_EMIT enabledLanguagesChanged();