Language:

The Free and Open Productivity Suite
Apache OpenOffice 4.1.4 released

Developer's Guide

API

SDK

Tips 'n' Tricks

Miscellaneous


:: com :: sun :: star :: resource ::

interface XStringResourceResolver
Base Interfaces
XStringResourceResolver
┗ ::com::sun::star::util::XModifyBroadcaster

::com::sun::star::util::XModifyBroadcaster
(referenced interface's summary:)
broadcasts each modification made on the date data of the object which supports this interface.
Description
Interface to access strings in a resource. The interface is derived from ::com::sun::star::util::XModifyBroadcaster All registered ::com::sun::star::util::XModifyListener interfaces will be notified if either the current locale changes or if a string is added, changed or removed. This usually will only happen if the implementing object also supports the interface XStringResourceManager and is used in the design mode of a Dialog or String table editor. But also changing the locale at runtime can be supported in this way.

Methods' Summary
resolveString Resolves the passed ResoureID for the current locale. This locale is set during initalisation of the object implementing this interface or - in case that also the interface XStringResourceManager is supported - by using the XStringResourceManager::setLocale method.  
resolveStringForLocale Resolves the passed ResoureID for a specific locale. It's not recommended to use this method to get the best performance as the implementation may be optimized for the use of the current locale.  
hasEntryForId Checks if the resource contains an entry for the given ResourceID and current locale.  
hasEntryForIdAndLocale Checks if the resource contains an entry for the given ResourceID and locale. It's not recommended to use this method to get the best performance as the implementation may be optimized for the use of the current locale.  
getResourceIDs Returns a sequence of all valid Resource IDs for the current locale  
getResourceIDsForLocale Returns a sequence of all valid Resource IDs for a specific locale It's not recommended to use this method to get the best performance as the implementation may be optimized for the use of the current locale.  
getCurrentLocale Returns the current locale specified in the accessed resource. If no locale is available, the returned Locale structure only contains empty strings.  
getDefaultLocale Returns the default locale of the accessed resource. In many cases this will be the locale of the Office initially used to create the resource.  
getLocales Returns a sequence of all supported locales  
Methods' Details
resolveString
string
resolveString( [in] string  ResourceID )
raises( MissingResourceException );

Description
Resolves the passed ResoureID for the current locale. This locale is set during initalisation of the object implementing this interface or - in case that also the interface XStringResourceManager is supported - by using the XStringResourceManager::setLocale method.
Parameter ResourceID
ID to specify the string inside the resource. The ID can - but not needs to - be a hierarchical name like "foo.nothing.invalid".
Returns
the localized string for the specified ID
Throws
::com::sun::star::resource::MissingResourceException if no entry exists for the given ResourceID
resolveStringForLocale
string
resolveStringForLocale( [in] string  ResourceID,
[in] ::com::sun::star::lang::Locale  locale )
raises( MissingResourceException );

Description
Resolves the passed ResoureID for a specific locale. It's not recommended to use this method to get the best performance as the implementation may be optimized for the use of the current locale.
Parameter ResourceID
ID to specify the string inside the resource. The ID can - but not needs to - be a hierarchical name like "foo.nothing.invalid".
Parameter locale
The locale the string should be resolved for. The locale has to match exactly with one of the locales provided by getLocales. A closest match search is not supported.
Returns
the localized string for the specified ID and Locale
Throws
MissingResourceException if no entry exists for the given ResourceID or locale
hasEntryForId
boolean
hasEntryForId( [in] string  ResourceID );

Description
Checks if the resource contains an entry for the given ResourceID and current locale.
Parameter ResourceID
ID to specify the string inside the resource.
Returns
true if an entry exists, otherwise false
hasEntryForIdAndLocale
boolean
hasEntryForIdAndLocale( [in] string  ResourceID,
[in] ::com::sun::star::lang::Locale  locale );

Description
Checks if the resource contains an entry for the given ResourceID and locale. It's not recommended to use this method to get the best performance as the implementation may be optimized for the use of the current locale.
Parameter ResourceID
ID to specify the string inside the resource.
Parameter locale
The locale the entry should be checked for. The locale has to match exactly with one of the locales provided by getLocales. A closest match search is not supported.
Returns
true if an entry exists, otherwise false
getResourceIDs
sequence< string >
getResourceIDs();

Description
Returns a sequence of all valid Resource IDs for the current locale
Returns
a sequence of all valid Resource IDs
getResourceIDsForLocale
sequence< string >
getResourceIDsForLocale( [in] ::com::sun::star::lang::Locale  locale );

Description
Returns a sequence of all valid Resource IDs for a specific locale It's not recommended to use this method to get the best performance as the implementation may be optimized for the use of the current locale.
Parameter locale
The locale the ResourceIDs should be returned for. The locale has to match exactly with one of the locales provided by getLocales. A closest match search is not supported.
Returns
a sequence of all valid Resource IDs
getCurrentLocale
::com::sun::star::lang::Locale
getCurrentLocale();

Description
Returns the current locale specified in the accessed resource. If no locale is available, the returned Locale structure only contains empty strings.
Returns
the used locale
getDefaultLocale
::com::sun::star::lang::Locale
getDefaultLocale();

Description
Returns the default locale of the accessed resource. In many cases this will be the locale of the Office initially used to create the resource.
Returns
the used locale
getLocales
sequence< ::com::sun::star::lang::Locale >
getLocales();

Description
Returns a sequence of all supported locales
Returns
a sequence of all supported locales
Top of Page

Apache Software Foundation

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

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