xref: /AOO41X/main/offapi/com/sun/star/util/XSearchable.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_util_XSearchable_idl__
24#define __com_sun_star_util_XSearchable_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_util_XSearchDescriptor_idl__
31#include <com/sun/star/util/XSearchDescriptor.idl>
32#endif
33
34#ifndef __com_sun_star_container_XIndexAccess_idl__
35#include <com/sun/star/container/XIndexAccess.idl>
36#endif
37
38
39//=============================================================================
40
41module com {  module sun {  module star {  module util {
42
43//=============================================================================
44
45/** enables the object to look for specified contents of the object
46    (in particular, for a text range which contains a specific string pattern).
47
48    @example
49        in a <type scope="com::sun::star::text">TextDocument</type>:
50        set all "search for" to bold using findFirst()/findNext():
51
52    <listing>
53    xSearchDescr = xDocument.createSearchDescriptor()
54    xSearchDescr.SearchString = "search for"
55    xSearchDescr.SearchCaseSensitive = <TRUE/>
56    xSearchDescr.SearchWords = <TRUE/>
57    xFound = xDocument.findFirst( xSearchDescr )
58    do while not IsNull(xFound)
59    xFound.CharWeight = com.sun.star.awt.FontWeight.BOLD
60    xFound = xDocument.findNext( xFound.End, xSearchDescr )
61    loop
62    </listing>
63
64 */
65published interface XSearchable: com::sun::star::uno::XInterface
66{
67    //-------------------------------------------------------------------------
68    /** creates a <type>SearchDescriptor</type> which contains properties that
69        specify a search in this container.@see SearchDescriptor
70     */
71    com::sun::star::util::XSearchDescriptor createSearchDescriptor();
72
73    //-------------------------------------------------------------------------
74    /** searches the contained texts for all occurrences of whatever is specified.@see SearchDescriptor
75     */
76    com::sun::star::container::XIndexAccess findAll( [in] com::sun::star::util::XSearchDescriptor xDesc );
77
78    //-------------------------------------------------------------------------
79    /** searches the contained texts for the next occurrence of whatever is specified.
80
81        @returns
82            the position within the component, e.g. a <type scope="com::sun::star::text">XTextRange</type>
83            which determines the found elements.
84
85        @see SearchDescriptor
86     */
87    com::sun::star::uno::XInterface findFirst( [in] com::sun::star::util::XSearchDescriptor xDesc );
88
89    //-------------------------------------------------------------------------
90    /** searches the contained texts for the next occurrence of whatever is specified.
91
92        @param xStartAt
93            represents a position within the component at which the search continues.
94            This position is returned by <method>XSearchable::findFirst</method> or
95            the previous <method>XSearchable::findNext</method>.
96
97        @see SearchDescriptor
98     */
99    com::sun::star::uno::XInterface findNext( [in] com::sun::star::uno::XInterface xStartAt,
100             [in] com::sun::star::util::XSearchDescriptor xDesc );
101
102};
103
104//=============================================================================
105
106}; }; }; };
107
108#endif
109