[evolution/webkit-composer: 126/181] Add e_spell_checker_count_active_languages().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/webkit-composer: 126/181] Add e_spell_checker_count_active_languages().
- Date: Sun, 10 Feb 2013 12:19:06 +0000 (UTC)
commit fe0a6362ff8bfba8676af9cf9d1a302087608b55
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Jan 17 20:02:35 2013 -0500
Add e_spell_checker_count_active_languages().
Returns the number of languages actively being used for spell checking.
doc/reference/libeutil/libeutil-sections.txt | 1 +
e-util/e-spell-checker.c | 16 ++++++++++++++++
e-util/e-spell-checker.h | 2 ++
3 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/doc/reference/libeutil/libeutil-sections.txt b/doc/reference/libeutil/libeutil-sections.txt
index 9c10690..e914474 100644
--- a/doc/reference/libeutil/libeutil-sections.txt
+++ b/doc/reference/libeutil/libeutil-sections.txt
@@ -3654,6 +3654,7 @@ e_spell_checker_get_enchant_dict
e_spell_checker_get_language_active
e_spell_checker_set_language_active
e_spell_checker_list_active_languages
+e_spell_checker_count_active_languages
e_spell_checker_learn_word
e_spell_checker_ignore_word
<SUBSECTION Standard>
diff --git a/e-util/e-spell-checker.c b/e-util/e-spell-checker.c
index 67224c2..2988f02 100644
--- a/e-util/e-spell-checker.c
+++ b/e-util/e-spell-checker.c
@@ -640,6 +640,22 @@ e_spell_checker_list_active_languages (ESpellChecker *checker,
}
/**
+ * e_spell_checker_count_active_languages:
+ * @checker: an #ESpellChecker
+ *
+ * Returns the number of languages actively being used for spell checking.
+ *
+ * Returns: number of active spell checking languages
+ **/
+guint
+e_spell_checker_count_active_languages (ESpellChecker *checker)
+{
+ g_return_val_if_fail (E_IS_SPELL_CHECKER (checker), 0);
+
+ return g_hash_table_size (checker->priv->active_dictionaries);
+}
+
+/**
* e_spell_checker_ignore_word:
* @checker: an #ESpellChecker
* @word: word to ignore for the rest of session
diff --git a/e-util/e-spell-checker.h b/e-util/e-spell-checker.h
index c39c530..0bc0bc3 100644
--- a/e-util/e-spell-checker.h
+++ b/e-util/e-spell-checker.h
@@ -80,6 +80,8 @@ void e_spell_checker_set_language_active
gchar ** e_spell_checker_list_active_languages
(ESpellChecker *checker,
guint *n_languages);
+guint e_spell_checker_count_active_languages
+ (ESpellChecker *checker);
void e_spell_checker_learn_word (ESpellChecker *checker,
const gchar *word);
void e_spell_checker_ignore_word (ESpellChecker *checker,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]