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 
40 namespace i18nutil {
41  struct SearchOptions2;
42 }
43 
44 // function prototypes for the move/find methods of SwPaM
45 
46 void GoStartDoc( SwPosition*);
47 void GoEndDoc( SwPosition*);
49 void GoEndSection( SwPosition*);
50 const SwTextAttr* GetFrwrdTextHint( const SwpHints&, size_t&, sal_Int32 );
51 const SwTextAttr* GetBkwrdTextHint( const SwpHints&, size_t&, sal_Int32 );
52 
53 bool GoNext(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode );
54 bool GoPrevious(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode );
56 SwContentNode* GoPreviousNds( SwNodeIndex * pIdx, bool );
57 
58 // type definitions of functions
59 typedef bool (*GoNd)( SwNode*, SwIndex*, sal_uInt16 );
60 typedef SwContentNode* (*GoNds)( SwNodeIndex*, bool );
61 typedef void (*GoDoc)( SwPosition* );
62 typedef void (*GoSection)( SwPosition* );
63 typedef bool (SwPosition:: *CmpOp)( const SwPosition& ) const;
64 typedef const SwTextAttr* (*GetHint)( const SwpHints&, size_t&, sal_Int32 );
65 typedef bool (utl::TextSearch:: *SearchText)( const OUString&, sal_Int32*,
66  sal_Int32*, css::util::SearchResult* );
67 typedef void (*MvSection)( SwNodeIndex * );
68 
70 {
79 };
80 
81 // function prototype for searching
83  bool bInReadOnly = false, SwRootFrame const* pLayout = nullptr);
84 
85 namespace sw {
86 
87  std::unique_ptr<SwPaM> MakeRegion(SwMoveFnCollection const & fnMove,
88  const SwPaM & rOrigRg);
89 
91  bool FindTextImpl(SwPaM & rSearchPam,
92  const i18nutil::SearchOptions2& rSearchOpt,
93  bool bSearchInNotes,
94  utl::TextSearch& rSText,
95  SwMoveFnCollection const & fnMove,
96  const SwPaM & rRegion, bool bInReadOnly,
97  SwRootFrame const* pLayout);
98  bool FindFormatImpl(SwPaM & rSearchPam,
99  const SwFormat& rFormat,
100  SwMoveFnCollection const & fnMove,
101  const SwPaM & rRegion, bool bInReadOnly,
102  SwRootFrame const* pLayout);
103  bool FindAttrImpl(SwPaM & rSearchPam,
104  const SfxPoolItem& rAttr,
105  SwMoveFnCollection const & fnMove,
106  const SwPaM & rPam, bool bInReadOnly,
107  SwRootFrame const* pLayout);
108 
109 } // namespace sw
110 
111 #endif
112 
113 /* 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:106
std::unique_ptr< SwPaM > MakeRegion(SwMoveFnCollection const &fnMove, const SwPaM &rOrigRg)
make a new region
Definition: pam.cxx:501
void GoStartDoc(SwPosition *)
Definition: pam.cxx:833
GoSection fnSections
Definition: pamtyp.hxx:74
void(* GoSection)(SwPosition *)
Definition: pamtyp.hxx:62
Dialog to specify the properties of date form field.
SwContentNode *(* GoNds)(SwNodeIndex *, bool)
Definition: pamtyp.hxx:60
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
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)
Search.
Definition: findtxt.cxx:353
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:754
GetHint fnGetHint
Definition: pamtyp.hxx:76
void GoEndSection(SwPosition *)
go to the end of the current base section
Definition: pam.cxx:866
void(* MvSection)(SwNodeIndex *)
Definition: pamtyp.hxx:67
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:843
MvSection fnSection
Definition: pamtyp.hxx:78
bool FindAttrImpl(SwPaM &rSearchPam, const SfxPoolItem &rAttr, SwMoveFnCollection const &fnMove, const SwPaM &rRegion, bool bInReadOnly, SwRootFrame const *const pLayout)
Definition: findattr.cxx:885
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:852
Marks a character position inside a document model node.
Definition: index.hxx:37
bool(* GoNd)(SwNode *, SwIndex *, sal_uInt16)
Definition: pamtyp.hxx:59
Marks a node in the document model.
Definition: ndindex.hxx:31
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
bool GoPrevious(SwNode *pNd, SwIndex *pIdx, sal_uInt16 nMode)
Definition: pam.cxx:275
void(* GoDoc)(SwPosition *)
Definition: pamtyp.hxx:61
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:268
bool(SwPosition::* CmpOp)(const SwPosition &) const
Definition: pamtyp.hxx:63
SwContentNode * GoPreviousNds(SwNodeIndex *pIdx, bool)
Definition: pam.cxx:297
const SwTextAttr *(* GetHint)(const SwpHints &, size_t &, sal_Int32)
Definition: pamtyp.hxx:64
const SwTextAttr * GetFrwrdTextHint(const SwpHints &, size_t &, sal_Int32)
Definition: findattr.cxx:93
SW_DLLPUBLIC SwContentNode * GoNextNds(SwNodeIndex *pIdx, bool)
Definition: pam.cxx:282
bool(utl::TextSearch::* SearchText)(const OUString &, sal_Int32 *, sal_Int32 *, css::util::SearchResult *)
Definition: pamtyp.hxx:65
SearchText fnSearch
Definition: pamtyp.hxx:77
Base class of the Writer document model elements.
Definition: node.hxx:79
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo