Update ooo320-m1
[ooovba.git] / offapi / com / sun / star / util / XSearchable.idl
blobfb88bfaff431adbc431b7a8ee93515db83f29500
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSearchable.idl,v $
10 * $Revision: 1.14 $
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>
35 #endif
37 #ifndef __com_sun_star_util_XSearchDescriptor_idl__
38 #include <com/sun/star/util/XSearchDescriptor.idl>
39 #endif
41 #ifndef __com_sun_star_container_XIndexAccess_idl__
42 #include <com/sun/star/container/XIndexAccess.idl>
43 #endif
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).
55 @example
56 in a <type scope="com::sun::star::text">TextDocument</type>:
57 set all "search for" to bold using findFirst()/findNext():
59 <listing>
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 )
68 loop
69 </listing>
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.
88 @returns
89 the position within the component, e.g. a <type scope="com::sun::star::text">XTextRange</type>
90 which determines the found elements.
92 @see SearchDescriptor
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.
99 @param xStartAt
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 //=============================================================================
113 }; }; }; };
115 #endif