docthemes: Save themes def. to a file when added to ColorSets
[LibreOffice.git] / sw / source / core / inc / pamtyp.hxx
blobd269e3f10d4671785f8b0bb32f41ca6d28c3d23b
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 .
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_PAMTYP_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_PAMTYP_HXX
23 #include <unotools/textsearch.hxx>
25 #include <memory>
26 #include <optional>
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 SwContentIndex;
39 class SvxSearchItem;
40 enum class SwCursorSkipMode;
42 namespace i18nutil {
43 struct SearchOptions2;
46 // function prototypes for the move/find methods of SwPaM
48 void GoStartDoc( SwPosition*);
49 void GoEndDoc( SwPosition*);
50 void GoStartSection( SwPosition*);
51 void GoEndSection( SwPosition*);
52 void GoStartOfSection( SwPosition& );
53 void GoEndOfSection( SwPosition& );
54 const SwTextAttr* GetFrwrdTextHint( const SwpHints&, size_t&, sal_Int32 );
55 const SwTextAttr* GetBkwrdTextHint( const SwpHints&, size_t&, sal_Int32 );
57 bool GoNext(SwNode& rNd, SwContentIndex& rIdx, SwCursorSkipMode nMode );
58 bool GoPrevious(SwNode& rNd, SwContentIndex& rIdx, SwCursorSkipMode nMode );
59 SwContentNode* GoNextPos( SwPosition * pIdx, bool );
60 SwContentNode* GoPreviousPos( SwPosition * pIdx, bool );
62 // type definitions of functions
63 typedef bool (*GoNd)( SwNode&, SwContentIndex&, SwCursorSkipMode );
64 typedef SwContentNode* (*GoPos)( SwPosition*, bool );
65 typedef void (*GoDoc)( SwPosition* );
66 typedef void (*GoSection)( SwPosition* );
67 typedef bool (SwPosition::*CmpOp)( const SwPosition& ) const;
68 typedef const SwTextAttr* (*GetHint)( const SwpHints&, size_t&, sal_Int32 );
69 typedef bool (utl::TextSearch::*SearchText)( const OUString&, sal_Int32*,
70 sal_Int32*, css::util::SearchResult* );
71 typedef void (*MvSection)( SwPosition& );
73 struct SwMoveFnCollection
75 GoNd fnNd;
76 GoPos fnPos;
77 GoDoc fnDoc;
78 GoSection fnSections;
79 CmpOp fnCmpOp;
80 GetHint fnGetHint;
81 SearchText fnSearch;
82 MvSection fnSection;
85 // function prototype for searching
86 SwContentNode* GetNode(SwPaM&, bool&, SwMoveFnCollection const &,
87 bool bInReadOnly = false, SwRootFrame const* pLayout = nullptr);
89 namespace sw {
91 void MakeRegion(SwMoveFnCollection const & fnMove,
92 const SwPaM & rOrigRg, std::optional<SwPaM>& rDestinaton);
94 /// Search.
95 bool FindTextImpl(SwPaM & rSearchPam,
96 const i18nutil::SearchOptions2& rSearchOpt,
97 bool bSearchInNotes,
98 utl::TextSearch& rSText,
99 SwMoveFnCollection const & fnMove,
100 const SwPaM & rRegion, bool bInReadOnly,
101 SwRootFrame const* pLayout,
102 std::unique_ptr<SvxSearchItem>& xSearchItem);
103 bool FindFormatImpl(SwPaM & rSearchPam,
104 const SwFormat& rFormat,
105 SwMoveFnCollection const & fnMove,
106 const SwPaM & rRegion, bool bInReadOnly,
107 SwRootFrame const* pLayout);
108 bool FindAttrImpl(SwPaM & rSearchPam,
109 const SfxPoolItem& rAttr,
110 SwMoveFnCollection const & fnMove,
111 const SwPaM & rPam, bool bInReadOnly,
112 SwRootFrame const* pLayout);
114 } // namespace sw
116 #endif
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */