[evolution/webkit-composer: 124/130] Add e_spell_checker_count_active_languages().



commit 74127d0c9dea9bf3ab1e9567b7fe0fb603442534
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 8eb211d..bc648c7 100644
--- a/doc/reference/libeutil/libeutil-sections.txt
+++ b/doc/reference/libeutil/libeutil-sections.txt
@@ -3663,6 +3663,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]