public class Main
extends com.sun.star.lib.uno.helper.WeakBase
implements com.sun.star.task.XJobExecutor, com.sun.star.lang.XServiceDisplayName, com.sun.star.lang.XServiceInfo, com.sun.star.linguistic2.XProofreader, com.sun.star.linguistic2.XLinguServiceEventBroadcaster, com.sun.star.lang.XEventListener
Constructor and Description |
---|
Main(com.sun.star.uno.XComponentContext xCompContext) |
Modifier and Type | Method and Description |
---|---|
static com.sun.star.lang.XSingleComponentFactory |
__getComponentFactory(String sImplName)
Get XSingleComponentFactory
Default method called by LO/OO extensions
|
static boolean |
__writeRegistryServiceInfo(com.sun.star.registry.XRegistryKey regKey)
Write keys to registry
Default method called by LO/OO extensions
|
boolean |
addLinguServiceEventListener(com.sun.star.linguistic2.XLinguServiceEventListener eventListener)
Add a listener that allow re-checking the document after changing the
options in the configuration dialog box.
|
void |
disposing(com.sun.star.lang.EventObject source)
Remove internal stored text if document disposes
Interface: XEventListener
|
com.sun.star.linguistic2.ProofreadingResult |
doProofreading(String docID,
String paraText,
com.sun.star.lang.Locale locale,
int startOfSentencePos,
int nSuggestedBehindEndOfSentencePosition,
com.sun.star.beans.PropertyValue[] propertyValues)
Runs the grammar checker on paragraph text.
|
String |
getImplementationName()
Get the implementation name of the LT service
interface: XServiceInfo
|
com.sun.star.lang.Locale[] |
getLocales() |
String |
getServiceDisplayName(com.sun.star.lang.Locale locale)
Get the display name of the LT service
Interface: XServiceDisplayName
|
String[] |
getSupportedServiceNames()
Get the names of supported services
interface: XServiceInfo
|
boolean |
hasLocale(com.sun.star.lang.Locale locale) |
void |
ignoreRule(String ruleId,
com.sun.star.lang.Locale locale)
Called when "Ignore" is selected e.g. in the context menu for an error.
|
boolean |
isSpellChecker()
We leave spell checking to OpenOffice/LibreOffice.
|
boolean |
removeLinguServiceEventListener(com.sun.star.linguistic2.XLinguServiceEventListener eventListener)
Remove a listener from the event listeners list.
|
void |
resetIgnoreRules()
Called on rechecking the document - resets the ignore status for rules that
was set in the spelling dialog box or in the context menu.
|
boolean |
supportsService(String sServiceName)
Test if the service is supported by LT
interface: XServiceInfo
|
void |
trigger(String sEvent)
Triggers a registered event
interface: XJobExecutor
|
public final com.sun.star.linguistic2.ProofreadingResult doProofreading(String docID, String paraText, com.sun.star.lang.Locale locale, int startOfSentencePos, int nSuggestedBehindEndOfSentencePosition, com.sun.star.beans.PropertyValue[] propertyValues)
doProofreading
in interface com.sun.star.linguistic2.XProofreader
docID
- document IDparaText
- paragraph textlocale
- Locale the text LocalestartOfSentencePos
- start of sentence positionnSuggestedBehindEndOfSentencePosition
- end of sentence positionpublic final boolean isSpellChecker()
isSpellChecker
in interface com.sun.star.linguistic2.XProofreader
public final com.sun.star.lang.Locale[] getLocales()
getLocales
in interface com.sun.star.linguistic2.XSupportedLocales
public final boolean hasLocale(com.sun.star.lang.Locale locale)
hasLocale
in interface com.sun.star.linguistic2.XSupportedLocales
locale
- The Locale to check
interface: XProofreaderpublic final boolean addLinguServiceEventListener(com.sun.star.linguistic2.XLinguServiceEventListener eventListener)
addLinguServiceEventListener
in interface com.sun.star.linguistic2.XLinguServiceEventBroadcaster
eventListener
- the listener to be addedpublic final boolean removeLinguServiceEventListener(com.sun.star.linguistic2.XLinguServiceEventListener eventListener)
removeLinguServiceEventListener
in interface com.sun.star.linguistic2.XLinguServiceEventBroadcaster
eventListener
- the listener to be removedpublic String[] getSupportedServiceNames()
getSupportedServiceNames
in interface com.sun.star.lang.XServiceInfo
public boolean supportsService(String sServiceName)
supportsService
in interface com.sun.star.lang.XServiceInfo
public String getImplementationName()
getImplementationName
in interface com.sun.star.lang.XServiceInfo
public static com.sun.star.lang.XSingleComponentFactory __getComponentFactory(String sImplName)
public static boolean __writeRegistryServiceInfo(com.sun.star.registry.XRegistryKey regKey)
public void trigger(String sEvent)
trigger
in interface com.sun.star.task.XJobExecutor
public void ignoreRule(String ruleId, com.sun.star.lang.Locale locale)
ignoreRule
in interface com.sun.star.linguistic2.XProofreader
public void resetIgnoreRules()
resetIgnoreRules
in interface com.sun.star.linguistic2.XProofreader
public String getServiceDisplayName(com.sun.star.lang.Locale locale)
getServiceDisplayName
in interface com.sun.star.lang.XServiceDisplayName
public void disposing(com.sun.star.lang.EventObject source)
disposing
in interface com.sun.star.lang.XEventListener