Spell checking component for GNOME



Hi all!

I would like to start discussion on Spell checking component for GNOME. I have made proposal of API and how could spell checking control look like. It's attached to this mail.

I'll be happy to hear comments from you.

Best wishes
Radek
#include <Bonobo.idl>

module GNOME {
	module Spell {

		typedef sequence<string> StringSeq;

		interface Dictionary : Bonobo::Unknown {

			exception DictionaryError {};

			attribute boolean active;

			/**
			 * sets various pspell tags - see pspell manual
			 */
			void set_tag (in string tag, in string value) raises (DictionaryError);
		
			/**
			 * checks word
			 *
			 * returns true if word is valid
			 */
			boolean check_word (in string word) raises (DictionaryError);

			/**
			 * returns suggestions for word
			 */
			StringSeq suggetions (in string word) raises (DictionaryError);

			/**
			 * add to session/personal dictionary
			 */
			void add_word_to_session  (in string word) raises (DictionaryError);
			void add_word_to_personal (in string word) raises (DictionaryError);

			/**
			 * informs dictionary, that word 'word' will be replaced/corrected by word 'replacement'
			 */
			void correction (in string word, in string replacement);
		};

		struct Suggestion {
			StringSeq word;
			Dictionary dictionary;
		};

		interface Checker : Bonobo::Unknown {

			typedef sequence<Suggestion> SuggestionSeq;

			exception SpellError {};

			/**
			 * adds dictionary to checker
			 */
			void add (in Dictionary dictionary) raises (SpellError);

			/**
			 * removes dictionary from checker
			 */
			void remove_dictionary (in Dictionary dictionary);

			/**
			 * checks word
			 *
			 * returns true if word is valid for at least one (active) dictionary
			 */
			boolean check_word (in string word) raises (SpellError);

			/**
			 * returns suggestions for word from all (active) dictionaries
			 */
			SuggestionSeq suggetions (in string word) raises (SpellError);
		};
	};
};

Attachment: control.png
Description: Spell checker control



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]