Branch libreoffice-5-0-4
[LibreOffice.git] / sw / inc / unocrsr.hxx
blobc3290502553996ec4a0df126a26498ac47fd248e
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 .
19 #ifndef INCLUDED_SW_INC_UNOCRSR_HXX
20 #define INCLUDED_SW_INC_UNOCRSR_HXX
22 #include <swcrsr.hxx>
23 #include <calbck.hxx>
25 class SwUnoCrsr : public virtual SwCursor, public SwModify
27 private:
28 bool m_bRemainInSection : 1;
29 bool m_bSkipOverHiddenSections : 1;
30 bool m_bSkipOverProtectSections : 1;
32 public:
33 SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 );
34 virtual ~SwUnoCrsr();
36 protected:
38 virtual const SwContentFrm* DoSetBidiLevelLeftRight(
39 bool & io_rbLeft, bool bVisualAllowed, bool bInsertCrsr) SAL_OVERRIDE;
40 virtual void DoSetBidiLevelUpDown() SAL_OVERRIDE;
42 public:
44 // Does a selection of content exist in table?
45 // Return value indicates if the cursor remains at its old position.
46 virtual bool IsSelOvr( int eFlags =
47 ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
48 nsSwCursorSelOverFlags::SELOVER_TOGGLE |
49 nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )) SAL_OVERRIDE;
51 virtual bool IsReadOnlyAvailable() const SAL_OVERRIDE;
53 bool IsRemainInSection() const { return m_bRemainInSection; }
54 void SetRemainInSection( bool bFlag ) { m_bRemainInSection = bFlag; }
56 virtual bool IsSkipOverProtectSections() const SAL_OVERRIDE
57 { return m_bSkipOverProtectSections; }
58 void SetSkipOverProtectSections( bool bFlag )
59 { m_bSkipOverProtectSections = bFlag; }
61 virtual bool IsSkipOverHiddenSections() const SAL_OVERRIDE
62 { return m_bSkipOverHiddenSections; }
63 void SetSkipOverHiddenSections( bool bFlag )
64 { m_bSkipOverHiddenSections = bFlag; }
66 // make copy of cursor
67 virtual SwUnoCrsr * Clone() const;
69 DECL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr )
72 class SwUnoTableCrsr : public virtual SwUnoCrsr, public virtual SwTableCursor
74 // The selection has the same order as the table boxes, i.e.
75 // if something is deleted from the one array at a certain position
76 // it has also to be deleted from the other!
77 SwCursor m_aTableSel;
79 using SwTableCursor::MakeBoxSels;
81 public:
82 SwUnoTableCrsr( const SwPosition& rPos );
83 virtual ~SwUnoTableCrsr();
85 // Does a selection of content exist in table?
86 // Return value indicates if the cursor remains at its old position.
87 virtual bool IsSelOvr( int eFlags =
88 ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
89 nsSwCursorSelOverFlags::SELOVER_TOGGLE |
90 nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )) SAL_OVERRIDE;
92 virtual SwUnoTableCrsr * Clone() const SAL_OVERRIDE;
94 void MakeBoxSels();
96 SwCursor& GetSelRing() { return m_aTableSel; }
97 const SwCursor& GetSelRing() const { return m_aTableSel; }
100 #endif
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */