Alle 13:06, gioved� 20 gennaio 2005, Jorge Marques Pelizzoni ha scritto:
> Following Michael Hoenig's advice ("unanswered questions"), here I am
> again.
>
> AIM: check the current API's support for prototyping a grammar-checker API
> "externally", i.e. without messing with OOo's source.
>
> MY QUESTIONS TO API DEVELOPERS REGARDING THE CURRENT API'S CURRENT FEATURES
> (not necessary now to answer HOW, just if the following are possible and an
> idea of difficulty level)
>
> 1 - Can specific context menus be assigned to specific portions of text?
Some time ago I've uploaded this snippet:
http://codesnippets.services.openoffice.org/Office/Office.ContexMenuInterceptor.snip

due to some limitations of starbasic language, to set up the interceptor I 
used some not-so-clean solutions but if you will use java or python, things 
should be easier

I think you can use the interceptor beside a selection listener in order to 
modify dinamically the contex menu.
I've no idea if and how much this would impact the UI responsivity


>
> 2 - Can a specific portion of text be assigned a user-defined property,
> e.g. its language? My (not new) idea is let the user specify which
> language(s) they intend for each portion of text.

This seems to me already covered by current API's:
(or am I missing something?)

Sub TestCharLocale

        oFamilies = thisComponent.getStyleFamilies
        oCharStyles = oFamilies.getByname("CharacterStyles")
        oCharStyleStandard = oCharStyles.getByName("Standard")

        oCharLocale = oCharStyleStandard.CharLocale
        
        MsgBox oCharLocale.Language
        MsgBox oCharLocale.Country
        MsgBox oCharLocale.Variant

End Sub


>
> 3 - Can error underlining (like the curly red one for auto spell-checking)
> be assigned to specific portions of text in a way that it would neither (i)
> conflict with end users' formatting nor (ii) be printed out eventually?

Of course you can use a coloured curly underline to mark text:
see this solution provided from Bernard Marcelly
http://api.openoffice.org/servlets/ReadMsg?list=dev&msgId=1097003

Unfortunately this would overvrite end-user formatting and would be stored and 
printed too ;-(


> 4 - Is it possible to implement a "service", "component" or whatever might
> be plugged-in through the API such that: it _concurrently_ looks for
> visible text, breaks visible paragraphs into sentences, checks them for
> grammar and _asynchronously_ request the API to perform (1), (2) and (3)
> above?

Stephan Wunderlich has recently posted a solution to identify which paragraphs 
are currently visible:
http://api.openoffice.org/servlets/ReadMsg?list=dev&msgId=1714997

In addition I think you should look for a specialized listener able to notify 
view changes.
Unfortunately I've no idea if this listener already exists somewhere in the 
API or not.

HTH
Paolo M




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

Reply via email to