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 .
19 #ifndef INCLUDED_SW_INC_CSHTYP_HXX
20 #define INCLUDED_SW_INC_CSHTYP_HXX
23 #include <o3tl/typed_flags_set.hxx>
29 // Structure for SwPaM. Contains the method-pointers for cursor movement.
30 struct SwMoveFnCollection
;
32 // Type definition for CursorShell.
33 // Direction-parameter for MovePage.
34 typedef SwLayoutFrame
* (*SwWhichPage
)( const SwLayoutFrame
* );
35 SwLayoutFrame
*GetPrevFrame( const SwLayoutFrame
*pFrame
);
36 SwLayoutFrame
*GetThisFrame( const SwLayoutFrame
*pFrame
);
37 SwLayoutFrame
*GetNextFrame( const SwLayoutFrame
*pFrame
);
38 typedef SwContentFrame
* (*SwPosPage
)( const SwLayoutFrame
* );
39 SwContentFrame
*GetFirstSub( const SwLayoutFrame
*pLayout
);
40 SwContentFrame
*GetLastSub( const SwLayoutFrame
*pLayout
);
42 // Direction-parameter for MovePara.
43 typedef bool (*SwWhichPara
)( SwPaM
&, SwMoveFnCollection
const & );
44 bool GoPrevPara( SwPaM
&, SwMoveFnCollection
const &);
45 SW_DLLPUBLIC
bool GoCurrPara( SwPaM
&, SwMoveFnCollection
const &);
46 bool GoNextPara( SwPaM
&, SwMoveFnCollection
const &);
47 extern SW_DLLPUBLIC SwMoveFnCollection
const & fnParaStart
;
48 extern SW_DLLPUBLIC SwMoveFnCollection
const & fnParaEnd
;
50 // Direction-parameter for MoveSection.
51 typedef bool (*SwWhichSection
)( SwPaM
&, SwMoveFnCollection
const & );
52 extern SwMoveFnCollection
const & fnSectionStart
;
53 extern SwMoveFnCollection
const & fnSectionEnd
;
55 bool GoCurrSection( SwPaM
&, SwMoveFnCollection
const &);
57 // Direction-parameter for MoveTable
58 typedef bool (*SwWhichTable
)( SwPaM
&, SwMoveFnCollection
const &, bool bInReadOnly
);
59 SW_DLLPUBLIC
bool GotoPrevTable( SwPaM
&, SwMoveFnCollection
const &, bool bInReadOnly
);
60 SW_DLLPUBLIC
bool GotoCurrTable( SwPaM
&, SwMoveFnCollection
const &, bool bInReadOnly
);
61 bool GotoNextTable( SwPaM
&, SwMoveFnCollection
const &, bool bInReadOnly
);
62 extern SW_DLLPUBLIC SwMoveFnCollection
const & fnTableStart
;
63 extern SW_DLLPUBLIC SwMoveFnCollection
const & fnTableEnd
;
65 // Direction-parameter for MoveColumn
66 typedef SwLayoutFrame
* (*SwWhichColumn
)( const SwLayoutFrame
* );
67 typedef SwContentFrame
* (*SwPosColumn
)( const SwLayoutFrame
* );
68 SwLayoutFrame
* GetPrevColumn( const SwLayoutFrame
* pLayFrame
);
69 SwLayoutFrame
* GetCurrColumn( const SwLayoutFrame
* pLayFrame
);
70 SwLayoutFrame
* GetNextColumn( const SwLayoutFrame
* pLayFrame
);
71 SwContentFrame
* GetColumnStt( const SwLayoutFrame
* pColFrame
);
72 SwContentFrame
* GetColumnEnd( const SwLayoutFrame
* pColFrame
);
74 // Direction-parameter for MoveRegion (ranges!)
75 typedef bool (*SwWhichRegion
)( SwPaM
&, SwMoveFnCollection
const &, bool bInReadOnly
);
76 bool GotoPrevRegion( SwPaM
&, SwMoveFnCollection
const &, bool bInReadOnly
);
77 bool GotoNextRegion( SwPaM
&, SwMoveFnCollection
const &, bool bInReadOnly
);
78 bool GotoCurrRegionAndSkip( SwPaM
&, SwMoveFnCollection
const &, bool bInReadOnly
);
79 extern SwMoveFnCollection
const & fnRegionStart
;
80 extern SwMoveFnCollection
const & fnRegionEnd
;
83 * The following combinations are allowed:
84 * - find one in body -> FindRanges::InBody
85 * - find all in body: -> FindRanges::InBodyOnly | FindRanges::InSelAll
86 * - find in selections: one/all -> FindRanges::InSel [ | FindRanges::InSelAll ]
87 * - find not in body: one/all -> FindRanges::InOther [ | FindRanges::InSelAll ]
88 * - find all everywhere -> FindRanges::InSelAll
92 InBody
= 0x00, ///< Find "one" only in body text.
93 InSelAll
= 0x01, ///< All (only in non-body and selections).
94 InOther
= 0x02, ///< Find "all" in Footer/Header/Fly...
95 InSel
= 0x04, ///< Find in selections.
96 InBodyOnly
= 0x08, ///< Find only in body - only in combination with FindRanges::InSelAll !!!
100 template<> struct typed_flags
<FindRanges
> : is_typed_flags
<FindRanges
, 0x0f> {};
103 enum class SwDocPositions
112 #endif // INCLUDED_SW_INC_CSHTYP_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */