[evolution/webkit-composer: 122/231] Add e_spell_checker_count_active_languages().



commit ce067756376b1eea84a56ae1aeedd3d1265e8c9f
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.

 .../evolution-util/evolution-util-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/evolution-util/evolution-util-sections.txt 
b/doc/reference/evolution-util/evolution-util-sections.txt
index c4d867a..5c5055c 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -3809,6 +3809,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]