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



commit 7ec40fdb64924ba40813e44bfe64e4fd8bfe1cdf
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 6e2754c..ccbf856 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -3917,6 +3917,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]