Hi Mathias,

Mathias Bauer wrote:

The checker should implement the XGrammarChecker interface, and define its abilities this way. OK. The checking process would be started with doGrammarChecking() method. OK. But here goes what I don't understand. Suppose I found some errors with my code, and I built the structures that describe errors (as far as I understand, I should use GrammarCheckingResult that contains a collection of SingleGrammarErrors). But what should I do with this structure? In other words, how do I make a wavy green line to appear, or supply data for a grammar checker dialog box / context menu? I haven't found any APIs that allow doing that but maybe they're generic and not for grammar-checking only.

You don't need to do that - OOo will do that for you, based on the
information you return.

Great, but where do I return the information? doGrammarChecking() returns no value - as it is defined as void(). I can create the GrammarCheckingResult but what next?

It's not clear to me if doGrammarChecking() would be triggered automatically or not - if not, whether I should build a class that uses XFlatParagraph to iterate the document? Also I cannot see any use for document IDs in the API - what are they for? And what endDocument method should do?

OOo will call doGrammarChecking() in the idle processing. Thomas Lange
currently is implementing this. For the moment you can write a Basic
macro that calls doGrammarChecking() and so start your checking with
this macro.

I can also trigger it from Java, so that's not a problem. We already have a working but rough interface for OOo (it's LanguageTool), and for the time being doGrammarChecking can be triggered from a toolbar or something like that.

Regards and thanks,
Marcin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to