Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: linguistic2 ::

interface XConversionDictionary
Description
Allows the user to access a conversion dictionary.

The dictionary consists of entries (pairs) of the form ( aLeftText, aRightText ). Those pairs can be added and removed. Also it can be looked for all entries where the left text or the right text matches a given text. Thus it can be used for conversions in both directions.

Restrictions to what has to be the left and right text are usually given by specific services implementing this interface.

Since
OOo 1.1.2
See also
ConversionDictionary, HangulHanjaConversionDictionary

Methods' Summary
getName  
getLocale  
getConversionType  
setActive specifies whether the dictionary should be used or not .  
isActive  
clear removes all entries from the dictionary.  
getConversions searches for entries or conversions that match the given text.  
addEntry is used to add a conversion pair to the dictionary.  
removeEntry removes a conversion pair from the dictionary.  
getMaxCharCount returns the maximum number of characters used as left or right text in entries.  
getConversionEntries  
Methods' Details
getName
string
getName();

Returns
the name of the dictionary.
getLocale
::com::sun::star::lang::Locale
getLocale();

Returns
the language supported by the dictionary.
See also
::com::sun::star::lang::Locale
getConversionType
short
getConversionType();

Returns
the conversion type supported by the dictionary.
See also
ConversionDictionaryType
setActive
void
setActive( [in] boolean  bActivate );

Description
specifies whether the dictionary should be used or not .
Parameter bAcvtivate
true if the dictionary should be used, false otherwise.
isActive
boolean
isActive();

Returns
true if the dictionary is active, false otherwise.
clear
void
clear();

Description
removes all entries from the dictionary.
getConversions
sequence< string >
getConversions( [in] string  aText,
[in] long  nStartPos,
[in] long  nLength,
[in] ConversionDirection  eDirection,
[in] long  nTextConversionOptions )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
searches for entries or conversions that match the given text.

The exact string to be looked for is the substring from the aText parameter that starts at position nStartPos and has the length nLength.

Returns
the list of conversions found for the supplied text. If no nothing was found, it is empty.
Parameter aText
the text where the substring to be looked for will be taken from. Depending on the conversion direction parameter it specifies either the left text or the right text to look for.
Parameter nStartPos
the starting pos of the substring to be looked for.
Parameter nLength
the length of the substring to be looked for.
Parameter eConversionDirection
specifies the direction of the conversion to look for. It is one of ConversionDirection.
Parameter nTextConversionOptions
Combination of ::com::sun::star::i18n::TextConversionOption values.
Throws
com::sun::star::lang::IllegalArgumentException if the locale is not supported by the dictionary or if nTextConversionOptions is invalid for the given locale.
addEntry
void
addEntry( [in] string  aLeftText,
[in] string  aRightText )
raises( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::ElementExistException );

Description
is used to add a conversion pair to the dictionary.
Parameter aLeftText
the left text of the pair to be added.
Parameter aRightText
the right text of the pair to be added.
Throws
com::sun::star::lang::IllegalArgumentException if the arguments are invalid. For example if the specifications defined by the service implementing this object are not met.
Throws
com::sun::star::container::ElementExistException if such an entry already exists.
removeEntry
void
removeEntry( [in] string  aLeftText,
[in] string  aRightText )
raises( ::com::sun::star::container::NoSuchElementException );

Description
removes a conversion pair from the dictionary.
Parameter aLeftText
the left text of the pair to be removed.
Parameter aRightText
the right text of the pair to be removed.
Throws
com::sun::star::container::NoSuchElementException if there is no such entry.
getMaxCharCount
short
getMaxCharCount( [in] ConversionDirection  eDirection );

Description
returns the maximum number of characters used as left or right text in entries.
Parameter eDirection
specifies if the left text or the right text of entries will be used.
See also
ConversionDirection
getConversionEntries
sequence< string >
getConversionEntries( [in] ConversionDirection  eDirection );

Returns
a list of all left or right parts of the dictionaries entries.
Parameter eDirection
specifies if all left or all right parts of the entries should be returned.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.