Get the style color and number just once
[LibreOffice.git] / offapi / com / sun / star / util / XSearchable.idl
blobbb03f2c3d191ba4c7f7b2e078bc03cd2a6366af7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
22 module com { module sun { module star { module util {
25 /** enables the object to look for specified contents of the object
26 (in particular, for a text range which contains a specific string pattern).
28 Example:
29 in a com::sun::star::text::TextDocument:
30 set all "search for" to bold using findFirst()/findNext():
32 @code{.bas}
33 xSearchDescr = xDocument.createSearchDescriptor()
34 xSearchDescr.SearchString = "search for"
35 xSearchDescr.SearchCaseSensitive = true
36 xSearchDescr.SearchWords = true
37 xFound = xDocument.findFirst( xSearchDescr )
38 do while not IsNull(xFound)
39 xFound.CharWeight = com.sun.star.awt.FontWeight.BOLD
40 xFound = xDocument.findNext( xFound.End, xSearchDescr )
41 loop
42 @endcode
45 published interface XSearchable: com::sun::star::uno::XInterface
47 /** creates a SearchDescriptor which contains properties that
48 specify a search in this container.@see SearchDescriptor
50 com::sun::star::util::XSearchDescriptor createSearchDescriptor();
52 /** searches the contained texts for all occurrences of whatever is specified.@see SearchDescriptor
54 com::sun::star::container::XIndexAccess findAll( [in] com::sun::star::util::XSearchDescriptor xDesc );
56 /** searches the contained texts for the next occurrence of whatever is specified.
58 @returns
59 the position within the component, e.g. a com::sun::star::text::XTextRange
60 which determines the found elements.
62 @see SearchDescriptor
64 com::sun::star::uno::XInterface findFirst( [in] com::sun::star::util::XSearchDescriptor xDesc );
66 /** searches the contained texts for the next occurrence of whatever is specified.
68 @param xStartAt
69 represents a position within the component at which the search continues.
70 This position is returned by XSearchable::findFirst() or
71 the previous XSearchable::findNext().
72 @param xDesc
73 the descriptor used for searching.
75 @see SearchDescriptor
77 com::sun::star::uno::XInterface findNext( [in] com::sun::star::uno::XInterface xStartAt,
78 [in] com::sun::star::util::XSearchDescriptor xDesc );
83 }; }; }; };
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */