1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _UNOCRSR_HXX 28 #define _UNOCRSR_HXX 29 #include <swcrsr.hxx> 30 #include <calbck.hxx> 31 32 33 class SwUnoCrsr : public virtual SwCursor, public SwModify 34 { 35 sal_Bool bRemainInSection : 1; 36 sal_Bool bSkipOverHiddenSections : 1; 37 sal_Bool bSkipOverProtectSections : 1; 38 39 public: 40 SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 ); 41 virtual ~SwUnoCrsr(); 42 43 protected: 44 45 virtual const SwCntntFrm* DoSetBidiLevelLeftRight( 46 sal_Bool & io_rbLeft, sal_Bool bVisualAllowed, sal_Bool bInsertCrsr); 47 virtual void DoSetBidiLevelUpDown(); 48 49 public: 50 51 // virtual SwCursor* Create( SwPaM* pRing = 0 ) const; 52 53 // gibt es eine Selection vom Content in die Tabelle 54 // Return Wert gibt an, ob der Crsr auf der alten Position verbleibt 55 virtual sal_Bool IsSelOvr( int eFlags = 56 ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | 57 nsSwCursorSelOverFlags::SELOVER_TOGGLE | 58 nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )); 59 60 virtual bool IsReadOnlyAvailable() const; 61 62 sal_Bool IsRemainInSection() const { return bRemainInSection; } 63 void SetRemainInSection( sal_Bool bFlag ) { bRemainInSection = bFlag; } 64 65 virtual sal_Bool IsSkipOverProtectSections() const 66 { return bSkipOverProtectSections; } 67 void SetSkipOverProtectSections( sal_Bool bFlag ) 68 { bSkipOverProtectSections = bFlag; } 69 70 virtual sal_Bool IsSkipOverHiddenSections() const 71 { return bSkipOverHiddenSections; } 72 void SetSkipOverHiddenSections( sal_Bool bFlag ) 73 { bSkipOverHiddenSections = bFlag; } 74 75 // make copy of cursor 76 virtual SwUnoCrsr * Clone() const; 77 78 DECL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr ) 79 }; 80 81 82 83 class SwUnoTableCrsr : public virtual SwUnoCrsr, public virtual SwTableCursor 84 { 85 // die Selection hat die gleiche Reihenfolge wie die 86 // TabellenBoxen. D.h., wird aus dem einen Array an einer Position 87 // etwas geloescht, dann muss es auch im anderen erfolgen!! 88 SwCursor aTblSel; 89 90 using SwTableCursor::MakeBoxSels; 91 92 public: 93 SwUnoTableCrsr( const SwPosition& rPos ); 94 virtual ~SwUnoTableCrsr(); 95 96 // virtual SwCursor* Create( SwPaM* pRing = 0 ) const; 97 98 // gibt es eine Selection vom Content in die Tabelle 99 // Return Wert gibt an, ob der Crsr auf der alten Position verbleibt 100 virtual sal_Bool IsSelOvr( int eFlags = 101 ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | 102 nsSwCursorSelOverFlags::SELOVER_TOGGLE | 103 nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )); 104 105 virtual SwUnoTableCrsr * Clone() const; 106 107 void MakeBoxSels(); 108 109 SwCursor& GetSelRing() { return aTblSel; } 110 const SwCursor& GetSelRing() const { return aTblSel; } 111 }; 112 113 114 115 #endif 116