merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / util / XSearchable.idl
blobfce6b411ce9cc655467d383480d6dff5035830f8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_util_XSearchable_idl__
28 #define __com_sun_star_util_XSearchable_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include <com/sun/star/uno/XInterface.idl>
32 #endif
34 #ifndef __com_sun_star_util_XSearchDescriptor_idl__
35 #include <com/sun/star/util/XSearchDescriptor.idl>
36 #endif
38 #ifndef __com_sun_star_container_XIndexAccess_idl__
39 #include <com/sun/star/container/XIndexAccess.idl>
40 #endif
43 //=============================================================================
45 module com { module sun { module star { module util {
47 //=============================================================================
49 /** enables the object to look for specified contents of the object
50 (in particular, for a text range which contains a specific string pattern).
52 @example
53 in a <type scope="com::sun::star::text">TextDocument</type>:
54 set all "search for" to bold using findFirst()/findNext():
56 <listing>
57 xSearchDescr = xDocument.createSearchDescriptor()
58 xSearchDescr.SearchString = "search for"
59 xSearchDescr.SearchCaseSensitive = <TRUE/>
60 xSearchDescr.SearchWords = <TRUE/>
61 xFound = xDocument.findFirst( xSearchDescr )
62 do while not IsNull(xFound)
63 xFound.CharWeight = com.sun.star.awt.FontWeight.BOLD
64 xFound = xDocument.findNext( xFound.End, xSearchDescr )
65 loop
66 </listing>
69 published interface XSearchable: com::sun::star::uno::XInterface
71 //-------------------------------------------------------------------------
72 /** creates a <type>SearchDescriptor</type> which contains properties that
73 specify a search in this container.@see SearchDescriptor
75 com::sun::star::util::XSearchDescriptor createSearchDescriptor();
77 //-------------------------------------------------------------------------
78 /** searches the contained texts for all occurrences of whatever is specified.@see SearchDescriptor
80 com::sun::star::container::XIndexAccess findAll( [in] com::sun::star::util::XSearchDescriptor xDesc );
82 //-------------------------------------------------------------------------
83 /** searches the contained texts for the next occurrence of whatever is specified.
85 @returns
86 the position within the component, e.g. a <type scope="com::sun::star::text">XTextRange</type>
87 which determines the found elements.
89 @see SearchDescriptor
91 com::sun::star::uno::XInterface findFirst( [in] com::sun::star::util::XSearchDescriptor xDesc );
93 //-------------------------------------------------------------------------
94 /** searches the contained texts for the next occurrence of whatever is specified.
96 @param xStartAt
97 represents a position within the component at which the search continues.
98 This position is returned by <method>XSearchable::findFirst</method> or
99 the previous <method>XSearchable::findNext</method>.
101 @see SearchDescriptor
103 com::sun::star::uno::XInterface findNext( [in] com::sun::star::uno::XInterface xStartAt,
104 [in] com::sun::star::util::XSearchDescriptor xDesc );
108 //=============================================================================
110 }; }; }; };
112 #endif