LibreOffice Module sw (master)  1
cshtyp.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 #ifndef INCLUDED_SW_INC_CSHTYP_HXX
20 #define INCLUDED_SW_INC_CSHTYP_HXX
21 
22 #include "swdllapi.h"
23 #include <o3tl/typed_flags_set.hxx>
24 
25 class SwPaM;
26 class SwContentFrame;
27 class SwLayoutFrame;
28 
29 // Structure for SwPaM. Contains the method-pointers for cursor movement.
30 struct SwMoveFnCollection;
31 
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 );
41 
42 // Direction-parameter for MovePara.
43 typedef bool (*SwWhichPara)( SwPaM&, SwMoveFnCollection const & );
44 bool GoPrevPara( SwPaM&, SwMoveFnCollection const &);
46 bool GoNextPara( SwPaM&, SwMoveFnCollection const &);
49 
50 // Direction-parameter for MoveSection.
51 typedef bool (*SwWhichSection)( SwPaM&, SwMoveFnCollection const & );
52 extern SwMoveFnCollection const & fnSectionStart;
53 extern SwMoveFnCollection const & fnSectionEnd;
54 
55 bool GoCurrSection( SwPaM&, SwMoveFnCollection const &);
56 
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 );
64 
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 );
73 
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;
81 
82 /*
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
89  */
90 enum class FindRanges
91 {
92  InBody = 0x00,
93  InSelAll = 0x01,
94  InOther = 0x02,
95  InSel = 0x04,
96  InBodyOnly = 0x08,
97 };
98 namespace o3tl
99 {
100  template<> struct typed_flags<FindRanges> : is_typed_flags<FindRanges, 0x0f> {};
101 }
102 
103 enum class SwDocPositions
104 {
105  Start,
106  Curr,
107  End,
108  OtherStart,
109  OtherEnd
110 };
111 
112 #endif // INCLUDED_SW_INC_CSHTYP_HXX
113 
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GotoNextRegion(SwPaM &, SwMoveFnCollection const &, bool bInReadOnly)
Definition: trvlreg.cxx:104
Find "all" in Footer/Header/Fly...
SwMoveFnCollection const & fnSectionEnd
Definition: paminit.cxx:50
SwContentFrame * GetFirstSub(const SwLayoutFrame *pLayout)
Definition: trvlfrm.cxx:1046
SwContentFrame * GetLastSub(const SwLayoutFrame *pLayout)
Definition: trvlfrm.cxx:1051
Find in selections.
SW_DLLPUBLIC bool GoCurrPara(SwPaM &, SwMoveFnCollection const &)
Definition: pam.cxx:947
SwDocPositions
Definition: cshtyp.hxx:103
SW_DLLPUBLIC SwMoveFnCollection const & fnParaStart
Definition: paminit.cxx:46
bool GotoNextTable(SwPaM &, SwMoveFnCollection const &, bool bInReadOnly)
Definition: trvltbl.cxx:560
FindRanges
Definition: cshtyp.hxx:90
bool(* SwWhichRegion)(SwPaM &, SwMoveFnCollection const &, bool bInReadOnly)
Definition: cshtyp.hxx:75
SwMoveFnCollection const & fnRegionEnd
Definition: paminit.cxx:56
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool(* SwWhichTable)(SwPaM &, SwMoveFnCollection const &, bool bInReadOnly)
Definition: cshtyp.hxx:58
bool GoPrevPara(SwPaM &, SwMoveFnCollection const &)
Definition: pam.cxx:933
bool(* SwWhichPara)(SwPaM &, SwMoveFnCollection const &)
Definition: cshtyp.hxx:43
SW_DLLPUBLIC SwMoveFnCollection const & fnTableEnd
Definition: paminit.cxx:53
bool GotoPrevRegion(SwPaM &, SwMoveFnCollection const &, bool bInReadOnly)
Definition: trvlreg.cxx:31
SwMoveFnCollection const & fnSectionStart
Definition: paminit.cxx:49
SW_DLLPUBLIC SwMoveFnCollection const & fnParaEnd
Definition: paminit.cxx:47
All (only in non-body and selections).
SwLayoutFrame * GetThisFrame(const SwLayoutFrame *pFrame)
Definition: trvlfrm.cxx:1068
bool GoNextPara(SwPaM &, SwMoveFnCollection const &)
Definition: pam.cxx:975
SwContentFrame * GetColumnEnd(const SwLayoutFrame *pColFrame)
Definition: trvlcol.cxx:51
SwLayoutFrame * GetNextFrame(const SwLayoutFrame *pFrame)
Definition: trvlfrm.cxx:1056
SW_DLLPUBLIC bool GotoPrevTable(SwPaM &, SwMoveFnCollection const &, bool bInReadOnly)
Definition: trvltbl.cxx:480
SwLayoutFrame * GetPrevColumn(const SwLayoutFrame *pLayFrame)
Definition: trvlcol.cxx:40
SwLayoutFrame * GetNextColumn(const SwLayoutFrame *pLayFrame)
Definition: trvlcol.cxx:34
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
SW_DLLPUBLIC bool GotoCurrTable(SwPaM &, SwMoveFnCollection const &, bool bInReadOnly)
Definition: trvltbl.cxx:632
Find only in body - only in combination with FindRanges::InSelAll !!!
SwLayoutFrame * GetPrevFrame(const SwLayoutFrame *pFrame)
Definition: trvlfrm.cxx:1073
bool GoCurrSection(SwPaM &, SwMoveFnCollection const &)
Definition: pam.cxx:989
SW_DLLPUBLIC SwMoveFnCollection const & fnTableStart
Definition: paminit.cxx:52
SwMoveFnCollection const & fnRegionStart
Definition: paminit.cxx:55
bool GotoCurrRegionAndSkip(SwPaM &, SwMoveFnCollection const &, bool bInReadOnly)
Definition: trvlreg.cxx:177
Find "one" only in body text.
SwLayoutFrame * GetCurrColumn(const SwLayoutFrame *pLayFrame)
Definition: trvlcol.cxx:27
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
SwContentFrame * GetColumnStt(const SwLayoutFrame *pColFrame)
Definition: trvlcol.cxx:46
bool(* SwWhichSection)(SwPaM &, SwMoveFnCollection const &)
Definition: cshtyp.hxx:51