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