LibreOffice Module sw (master)  1
pamtyp.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_PAMTYP_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_PAMTYP_HXX
22 
23 #include <unotools/textsearch.hxx>
24 #include <swdllapi.h>
25 
26 #include <memory>
27 
28 class SwpHints;
29 struct SwPosition;
30 class SwPaM;
31 class SwTextAttr;
32 class SwFormat;
33 class SfxPoolItem;
34 class SwRootFrame;
35 class SwNode;
36 class SwNodeIndex;
37 class SwContentNode;
38 class SwIndex;
39 class SvxSearchItem;
40 
41 namespace i18nutil {
42  struct SearchOptions2;
43 }
44 
45 // function prototypes for the move/find methods of SwPaM
46 
47 void GoStartDoc( SwPosition*);
48 void GoEndDoc( 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 );
53 
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 );
58 
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 * );
69 
71 {
80 };
81 
82 // function prototype for searching
84  bool bInReadOnly = false, SwRootFrame const* pLayout = nullptr);
85 
86 namespace sw {
87 
88  std::unique_ptr<SwPaM> MakeRegion(SwMoveFnCollection const & fnMove,
89  const SwPaM & rOrigRg);
90 
92  bool FindTextImpl(SwPaM & rSearchPam,
93  const i18nutil::SearchOptions2& rSearchOpt,
94  bool bSearchInNotes,
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);
110 
111 } // namespace sw
112 
113 #endif
114 
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Marks a position in the document model.
Definition: pam.hxx:35
const SwTextAttr * GetBkwrdTextHint(const SwpHints &, size_t &, sal_Int32)
Definition: findattr.cxx:92
std::unique_ptr< SwPaM > MakeRegion(SwMoveFnCollection const &fnMove, const SwPaM &rOrigRg)
make a new region
Definition: pam.cxx:521
void GoStartDoc(SwPosition *)
Definition: pam.cxx:895
GoSection fnSections
Definition: pamtyp.hxx:75
void(* GoSection)(SwPosition *)
Definition: pamtyp.hxx:63
bool(SwPosition::* CmpOp)(const SwPosition &) const
Definition: pamtyp.hxx:64
Dialog to specify the properties of date form field.
SwContentNode *(* GoNds)(SwNodeIndex *, bool)
Definition: pamtyp.hxx:61
The root element of a Writer document layout.
Definition: rootfrm.hxx:80
SwContentNode * GetNode(SwPaM &, bool &, SwMoveFnCollection const &, bool bInReadOnly=false, SwRootFrame const *pLayout=nullptr)
This function returns the next node in direction of search.
Definition: pam.cxx:816
GetHint fnGetHint
Definition: pamtyp.hxx:77
void GoEndSection(SwPosition *)
go to the end of the current base section
Definition: pam.cxx:928
void(* MvSection)(SwNodeIndex *)
Definition: pamtyp.hxx:68
bool FindFormatImpl(SwPaM &rSearchPam, const SwFormat &rFormat, SwMoveFnCollection const &fnMove, const SwPaM &rRegion, bool bInReadOnly, SwRootFrame const *const pLayout)
Definition: findfmt.cxx:28
void GoEndDoc(SwPosition *)
Definition: pam.cxx:905
MvSection fnSection
Definition: pamtyp.hxx:79
bool FindAttrImpl(SwPaM &rSearchPam, const SfxPoolItem &rAttr, SwMoveFnCollection const &fnMove, const SwPaM &rRegion, bool bInReadOnly, SwRootFrame const *const pLayout)
Definition: findattr.cxx:914
Base class for various Writer styles.
Definition: format.hxx:43
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
void GoStartSection(SwPosition *)
Definition: pam.cxx:914
Marks a character position inside a document model node.
Definition: index.hxx:33
bool(* GoNd)(SwNode *, SwIndex *, sal_uInt16)
Definition: pamtyp.hxx:60
Marks a node in the document model.
Definition: ndindex.hxx:31
bool GoPrevious(SwNode *pNd, SwIndex *pIdx, sal_uInt16 nMode)
Definition: pam.cxx:295
void(* GoDoc)(SwPosition *)
Definition: pamtyp.hxx:62
An SwTextAttr container, stores all directly formatted text portions for a text node.
Definition: ndhints.hxx:67
bool GoNext(SwNode *pNd, SwIndex *pIdx, sal_uInt16 nMode)
Definition: pam.cxx:288
bool(utl::TextSearch::* SearchText)(const OUString &, sal_Int32 *, sal_Int32 *, css::util::SearchResult *)
Definition: pamtyp.hxx:66
SwContentNode * GoPreviousNds(SwNodeIndex *pIdx, bool)
Definition: pam.cxx:317
bool FindTextImpl(SwPaM &rSearchPam, const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, utl::TextSearch &rSText, SwMoveFnCollection const &fnMove, const SwPaM &rRegion, bool bInReadOnly, SwRootFrame const *const pLayout, std::unique_ptr< SvxSearchItem > &xSearchItem)
Search.
Definition: findtxt.cxx:373
const SwTextAttr *(* GetHint)(const SwpHints &, size_t &, sal_Int32)
Definition: pamtyp.hxx:65
const SwTextAttr * GetFrwrdTextHint(const SwpHints &, size_t &, sal_Int32)
Definition: findattr.cxx:79
SwContentNode * GoNextNds(SwNodeIndex *pIdx, bool)
Definition: pam.cxx:302
SearchText fnSearch
Definition: pamtyp.hxx:78
Base class of the Writer document model elements.
Definition: node.hxx:79
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo