1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSearchable.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_util_XSearchable_idl__
31 #define __com_sun_star_util_XSearchable_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_util_XSearchDescriptor_idl__
38 #include
<com
/sun
/star
/util
/XSearchDescriptor.idl
>
41 #ifndef __com_sun_star_container_XIndexAccess_idl__
42 #include
<com
/sun
/star
/container
/XIndexAccess.idl
>
46 //=============================================================================
48 module com
{ module sun
{ module star
{ module util
{
50 //=============================================================================
52 /** enables the object to look for specified contents of the object
53 (in particular, for a text range which contains a specific string pattern).
56 in a <type scope="com::sun::star::text">TextDocument</type>:
57 set all "search for" to bold using findFirst()/findNext():
60 xSearchDescr = xDocument.createSearchDescriptor()
61 xSearchDescr.SearchString = "search for"
62 xSearchDescr.SearchCaseSensitive = <TRUE/>
63 xSearchDescr.SearchWords = <TRUE/>
64 xFound = xDocument.findFirst( xSearchDescr )
65 do while not IsNull(xFound)
66 xFound.CharWeight = com.sun.star.awt.FontWeight.BOLD
67 xFound = xDocument.findNext( xFound.End, xSearchDescr )
72 published
interface XSearchable
: com
::sun
::star
::uno
::XInterface
74 //-------------------------------------------------------------------------
75 /** creates a <type>SearchDescriptor</type> which contains properties that
76 specify a search in this container.@see SearchDescriptor
78 com
::sun
::star
::util
::XSearchDescriptor createSearchDescriptor
();
80 //-------------------------------------------------------------------------
81 /** searches the contained texts for all occurrences of whatever is specified.@see SearchDescriptor
83 com
::sun
::star
::container
::XIndexAccess findAll
( [in] com
::sun
::star
::util
::XSearchDescriptor xDesc
);
85 //-------------------------------------------------------------------------
86 /** searches the contained texts for the next occurrence of whatever is specified.
89 the position within the component, e.g. a <type scope="com::sun::star::text">XTextRange</type>
90 which determines the found elements.
94 com
::sun
::star
::uno
::XInterface findFirst
( [in] com
::sun
::star
::util
::XSearchDescriptor xDesc
);
96 //-------------------------------------------------------------------------
97 /** searches the contained texts for the next occurrence of whatever is specified.
100 represents a position within the component at which the search continues.
101 This position is returned by <method>XSearchable::findFirst</method> or
102 the previous <method>XSearchable::findNext</method>.
104 @see SearchDescriptor
106 com
::sun
::star
::uno
::XInterface findNext
( [in] com
::sun
::star
::uno
::XInterface xStartAt
,
107 [in] com
::sun
::star
::util
::XSearchDescriptor xDesc
);
111 //=============================================================================