xref: /trunk/main/offapi/com/sun/star/util/XSearchable.idl (revision cdf0e10c)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
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.
14 *
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).
20 *
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.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_util_XSearchable_idl__
28#define __com_sun_star_util_XSearchable_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_util_XSearchDescriptor_idl__
35#include <com/sun/star/util/XSearchDescriptor.idl>
36#endif
37
38#ifndef __com_sun_star_container_XIndexAccess_idl__
39#include <com/sun/star/container/XIndexAccess.idl>
40#endif
41
42
43//=============================================================================
44
45module com {  module sun {  module star {  module util {
46
47//=============================================================================
48
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).
51
52	@example
53		in a <type scope="com::sun::star::text">TextDocument</type>:
54		set all "search for" to bold using findFirst()/findNext():
55
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>
67
68 */
69published interface XSearchable: com::sun::star::uno::XInterface
70{
71	//-------------------------------------------------------------------------
72	/** creates a <type>SearchDescriptor</type> which contains properties that
73		specify a search in this container.@see SearchDescriptor
74	 */
75	com::sun::star::util::XSearchDescriptor createSearchDescriptor();
76
77	//-------------------------------------------------------------------------
78	/** searches the contained texts for all occurrences of whatever is specified.@see SearchDescriptor
79	 */
80	com::sun::star::container::XIndexAccess findAll( [in] com::sun::star::util::XSearchDescriptor xDesc );
81
82	//-------------------------------------------------------------------------
83	/** searches the contained texts for the next occurrence of whatever is specified.
84
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.
88
89		@see SearchDescriptor
90	 */
91	com::sun::star::uno::XInterface findFirst( [in] com::sun::star::util::XSearchDescriptor xDesc );
92
93	//-------------------------------------------------------------------------
94	/** searches the contained texts for the next occurrence of whatever is specified.
95
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>.
100
101		@see SearchDescriptor
102	 */
103	com::sun::star::uno::XInterface findNext( [in] com::sun::star::uno::XInterface xStartAt,
104			 [in] com::sun::star::util::XSearchDescriptor xDesc );
105
106};
107
108//=============================================================================
109
110}; }; }; };
111
112#endif
113