Line data Source code
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_UNOCRSR_HXX
20 : #define INCLUDED_SW_INC_UNOCRSR_HXX
21 : #include <swcrsr.hxx>
22 : #include <calbck.hxx>
23 :
24 : class SwUnoCrsr : public virtual SwCursor, public SwModify
25 : {
26 : bool bRemainInSection : 1;
27 : bool bSkipOverHiddenSections : 1;
28 : bool bSkipOverProtectSections : 1;
29 :
30 : public:
31 : SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 );
32 : virtual ~SwUnoCrsr();
33 :
34 : protected:
35 :
36 : virtual const SwCntntFrm* DoSetBidiLevelLeftRight(
37 : bool & io_rbLeft, bool bVisualAllowed, bool bInsertCrsr) SAL_OVERRIDE;
38 : virtual void DoSetBidiLevelUpDown() SAL_OVERRIDE;
39 :
40 : public:
41 :
42 : // Does a selection of content exist in table?
43 : // Return value indicates if the cursor remains at its old position.
44 : virtual bool IsSelOvr( int eFlags =
45 : ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
46 : nsSwCursorSelOverFlags::SELOVER_TOGGLE |
47 : nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )) SAL_OVERRIDE;
48 :
49 : virtual bool IsReadOnlyAvailable() const SAL_OVERRIDE;
50 :
51 1368070 : bool IsRemainInSection() const { return bRemainInSection; }
52 21458 : void SetRemainInSection( bool bFlag ) { bRemainInSection = bFlag; }
53 :
54 118314 : virtual bool IsSkipOverProtectSections() const SAL_OVERRIDE
55 118314 : { return bSkipOverProtectSections; }
56 0 : void SetSkipOverProtectSections( bool bFlag )
57 0 : { bSkipOverProtectSections = bFlag; }
58 :
59 118314 : virtual bool IsSkipOverHiddenSections() const SAL_OVERRIDE
60 118314 : { return bSkipOverHiddenSections; }
61 0 : void SetSkipOverHiddenSections( bool bFlag )
62 0 : { bSkipOverHiddenSections = bFlag; }
63 :
64 : // make copy of cursor
65 : virtual SwUnoCrsr * Clone() const;
66 :
67 748492 : DECL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr )
68 : };
69 :
70 : class SwUnoTableCrsr : public virtual SwUnoCrsr, public virtual SwTableCursor
71 : {
72 : // The selection has the same order as the table boxes, i.e.
73 : // if something is deleted from the one array at a certain position
74 : // it has also to be deleted from the other!
75 : SwCursor aTblSel;
76 :
77 : using SwTableCursor::MakeBoxSels;
78 :
79 : public:
80 : SwUnoTableCrsr( const SwPosition& rPos );
81 : virtual ~SwUnoTableCrsr();
82 :
83 : // Does a selection of content exist in table?
84 : // Return value indicates if the cursor remains at its old position.
85 : virtual bool IsSelOvr( int eFlags =
86 : ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
87 : nsSwCursorSelOverFlags::SELOVER_TOGGLE |
88 : nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )) SAL_OVERRIDE;
89 :
90 0 : virtual SwUnoTableCrsr * Clone() const SAL_OVERRIDE;
91 :
92 : void MakeBoxSels();
93 :
94 1816 : SwCursor& GetSelRing() { return aTblSel; }
95 : const SwCursor& GetSelRing() const { return aTblSel; }
96 : };
97 :
98 : #endif
99 :
100 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|