Top   Module   Use   Manual   Index 
 EXPORTING SERVICES | METHODS' SUMMARY | METHODS' DETAILS 

com :: sun :: star :: util ::

interface XSearchable

Base Interface
com::sun::star::uno::XInterface

Description
enables the object to look for specified contents of the object (in particular, for a text range which contains a specific string pattern).
Example
in a TextDocument : set all "search for" to bold using findFirst()/findNext():
 xSearchDescr = xDocument.createSearchDescriptor()
 xSearchDescr.SearchString = "to look for"
 xSearchDescr.SearchCaseSensitive = true
 xSearchDescr.SearchWholeWords = true
 xFound = xDocument.findFirst( xSearchDescr )
 do while xFound
 xFound.CharWeight = CharWeight_BOLD
 xFound = xDocument.findNext( xFound.End, xSearchDescr )
 loop
replace all bold "search for" by "look for" using findAll():
 xSearchDescr = xDocument.createSearchDescriptor()
 xSearchDescr.SearchString = "to look for"
 xSearchDescr.SearchCaseSensitive = true
 xSearchDescr.SearchWholeWords = true
 xStyles = createPropertySet( xSearchDescr.SearchStyles )
 xStyles.CharWeight = CharWeight_BOLD
 xSearchDescr.SearchStyles = xStyles.PropertyValues
 xAllFound = xDocument.findAll( xSearchDescr )
 for n% = lbound(xAllFound) to ubound(xAllFound)
 xAllFound(n%).String = "look for"
 loop


Known Services which Export this Interface

com::sun::star::text::TextDocument A text document is a model component which contains text structured by paragraphs.

Methods' Summary

createSearchDescriptor creates a SearchDescriptor which contains properties that specify a search in this container.
findAll searches the contained texts for all occurrences of whatever is specified.
findFirst searches the contained texts for the next occurrence of whatever is specified.
findNext searches the contained texts for the next occurrence of whatever is specified.

Methods' Details

createSearchDescriptor
 
com::sun::star::util::XSearchDescriptor
createSearchDescriptor();
Description
creates a SearchDescriptor which contains properties that specify a search in this container.
See also
SearchDescriptor
findAll
 
com::sun::star::container::XIndexAccess
findAll(
[ in ] com::sun::star::util::XSearchDescriptor xDesc );

Description
searches the contained texts for all occurrences of whatever is specified.
See also
SearchDescriptor
findFirst
 
com::sun::star::uno::XInterface
findFirst(
[ in ] com::sun::star::util::XSearchDescriptor xDesc );

Description
searches the contained texts for the next occurrence of whatever is specified.
See also
SearchDescriptor
findNext
 
com::sun::star::uno::XInterface
findNext(
[ in ] com::sun::star::uno::XInterface xStartAt,
[ in ] com::sun::star::util::XSearchDescriptor xDesc );

Description
searches the contained texts for the next occurrence of whatever is specified.
See also
SearchDescriptor

Top of Page