1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_util_XSearchable_idl__
20 #define __com_sun_star_util_XSearchable_idl__
22 #include
<com
/sun
/star
/uno
/XInterface.idl
>
24 #include
<com
/sun
/star
/util
/XSearchDescriptor.idl
>
26 #include
<com
/sun
/star
/container
/XIndexAccess.idl
>
30 module com
{ module sun
{ module star
{ module util
{
33 /** enables the object to look for specified contents of the object
34 (in particular, for a text range which contains a specific string pattern).
37 in a com::sun::star::text::TextDocument:
38 set all "search for" to bold using findFirst()/findNext():
41 xSearchDescr = xDocument.createSearchDescriptor()
42 xSearchDescr.SearchString = "search for"
43 xSearchDescr.SearchCaseSensitive = true
44 xSearchDescr.SearchWords = true
45 xFound = xDocument.findFirst( xSearchDescr )
46 do while not IsNull(xFound)
47 xFound.CharWeight = com.sun.star.awt.FontWeight.BOLD
48 xFound = xDocument.findNext( xFound.End, xSearchDescr )
53 published
interface XSearchable
: com
::sun
::star
::uno
::XInterface
55 /** creates a SearchDescriptor which contains properties that
56 specify a search in this container.@see SearchDescriptor
58 com
::sun
::star
::util
::XSearchDescriptor createSearchDescriptor
();
60 /** searches the contained texts for all occurrences of whatever is specified.@see SearchDescriptor
62 com
::sun
::star
::container
::XIndexAccess findAll
( [in] com
::sun
::star
::util
::XSearchDescriptor xDesc
);
64 /** searches the contained texts for the next occurrence of whatever is specified.
67 the position within the component, e.g. a com::sun::star::text::XTextRange
68 which determines the found elements.
72 com
::sun
::star
::uno
::XInterface findFirst
( [in] com
::sun
::star
::util
::XSearchDescriptor xDesc
);
74 /** searches the contained texts for the next occurrence of whatever is specified.
77 represents a position within the component at which the search continues.
78 This position is returned by XSearchable::findFirst() or
79 the previous XSearchable::findNext().
81 the descriptor used for searching.
85 com
::sun
::star
::uno
::XInterface findNext
( [in] com
::sun
::star
::uno
::XInterface xStartAt
,
86 [in] com
::sun
::star
::util
::XSearchDescriptor xDesc
);
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */