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 .
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_PAMTYP_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_PAMTYP_HXX
23 #include <unotools/textsearch.hxx>
42 struct SearchOptions2
;
45 // function prototypes for the move/find methods of SwPaM
47 void GoStartDoc( SwPosition
*);
48 void GoEndDoc( SwPosition
*);
49 void GoStartSection( SwPosition
*);
50 void GoEndSection( SwPosition
*);
51 const SwTextAttr
* GetFrwrdTextHint( const SwpHints
&, size_t&, sal_Int32
);
52 const SwTextAttr
* GetBkwrdTextHint( const SwpHints
&, size_t&, sal_Int32
);
54 bool GoNext(SwNode
* pNd
, SwIndex
* pIdx
, sal_uInt16 nMode
);
55 bool GoPrevious(SwNode
* pNd
, SwIndex
* pIdx
, sal_uInt16 nMode
);
56 SwContentNode
* GoNextNds( SwNodeIndex
* pIdx
, bool );
57 SwContentNode
* GoPreviousNds( SwNodeIndex
* pIdx
, bool );
59 // type definitions of functions
60 typedef bool (*GoNd
)( SwNode
*, SwIndex
*, sal_uInt16
);
61 typedef SwContentNode
* (*GoNds
)( SwNodeIndex
*, bool );
62 typedef void (*GoDoc
)( SwPosition
* );
63 typedef void (*GoSection
)( SwPosition
* );
64 typedef bool (SwPosition::*CmpOp
)( const SwPosition
& ) const;
65 typedef const SwTextAttr
* (*GetHint
)( const SwpHints
&, size_t&, sal_Int32
);
66 typedef bool (utl::TextSearch::*SearchText
)( const OUString
&, sal_Int32
*,
67 sal_Int32
*, css::util::SearchResult
* );
68 typedef void (*MvSection
)( SwNodeIndex
* );
70 struct SwMoveFnCollection
82 // function prototype for searching
83 SwContentNode
* GetNode(SwPaM
&, bool&, SwMoveFnCollection
const &,
84 bool bInReadOnly
= false, SwRootFrame
const* pLayout
= nullptr);
88 std::unique_ptr
<SwPaM
> MakeRegion(SwMoveFnCollection
const & fnMove
,
89 const SwPaM
& rOrigRg
);
92 bool FindTextImpl(SwPaM
& rSearchPam
,
93 const i18nutil::SearchOptions2
& rSearchOpt
,
95 utl::TextSearch
& rSText
,
96 SwMoveFnCollection
const & fnMove
,
97 const SwPaM
& rRegion
, bool bInReadOnly
,
98 SwRootFrame
const* pLayout
,
99 std::unique_ptr
<SvxSearchItem
>& xSearchItem
);
100 bool FindFormatImpl(SwPaM
& rSearchPam
,
101 const SwFormat
& rFormat
,
102 SwMoveFnCollection
const & fnMove
,
103 const SwPaM
& rRegion
, bool bInReadOnly
,
104 SwRootFrame
const* pLayout
);
105 bool FindAttrImpl(SwPaM
& rSearchPam
,
106 const SfxPoolItem
& rAttr
,
107 SwMoveFnCollection
const & fnMove
,
108 const SwPaM
& rPam
, bool bInReadOnly
,
109 SwRootFrame
const* pLayout
);
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */