xref: /aoo42x/main/sw/inc/unocrsr.hxx (revision 1d2dbeb0)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _UNOCRSR_HXX
24cdf0e10cSrcweir #define _UNOCRSR_HXX
25cdf0e10cSrcweir #include <swcrsr.hxx>
26cdf0e10cSrcweir #include <calbck.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir 
29cdf0e10cSrcweir class SwUnoCrsr : public virtual SwCursor, public SwModify
30cdf0e10cSrcweir {
31cdf0e10cSrcweir 	sal_Bool bRemainInSection : 1;
32cdf0e10cSrcweir 	sal_Bool bSkipOverHiddenSections : 1;
33cdf0e10cSrcweir 	sal_Bool bSkipOverProtectSections : 1;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir public:
36cdf0e10cSrcweir 	SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 );
37cdf0e10cSrcweir 	virtual ~SwUnoCrsr();
38cdf0e10cSrcweir 
39cdf0e10cSrcweir protected:
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     virtual const SwCntntFrm* DoSetBidiLevelLeftRight(
42cdf0e10cSrcweir         sal_Bool & io_rbLeft, sal_Bool bVisualAllowed, sal_Bool bInsertCrsr);
43cdf0e10cSrcweir     virtual void DoSetBidiLevelUpDown();
44cdf0e10cSrcweir 
45cdf0e10cSrcweir public:
46cdf0e10cSrcweir 
47cdf0e10cSrcweir //	virtual SwCursor* Create( SwPaM* pRing = 0 ) const;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 	// gibt es eine Selection vom Content in die Tabelle
50cdf0e10cSrcweir 	// Return Wert gibt an, ob der Crsr auf der alten Position verbleibt
51cdf0e10cSrcweir 	virtual sal_Bool IsSelOvr( int eFlags =
52cdf0e10cSrcweir                                 ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
53cdf0e10cSrcweir                                   nsSwCursorSelOverFlags::SELOVER_TOGGLE |
54cdf0e10cSrcweir                                   nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ));
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	virtual bool IsReadOnlyAvailable() const;
57cdf0e10cSrcweir 
IsRemainInSection() const58cdf0e10cSrcweir 	sal_Bool IsRemainInSection() const 			{ return bRemainInSection; }
SetRemainInSection(sal_Bool bFlag)59cdf0e10cSrcweir 	void SetRemainInSection( sal_Bool bFlag )	{ bRemainInSection = bFlag; }
60cdf0e10cSrcweir 
IsSkipOverProtectSections() const61cdf0e10cSrcweir     virtual sal_Bool IsSkipOverProtectSections() const
62cdf0e10cSrcweir 									{ return bSkipOverProtectSections; }
SetSkipOverProtectSections(sal_Bool bFlag)63cdf0e10cSrcweir 	void SetSkipOverProtectSections( sal_Bool bFlag )
64cdf0e10cSrcweir 									{ bSkipOverProtectSections = bFlag; }
65cdf0e10cSrcweir 
IsSkipOverHiddenSections() const66cdf0e10cSrcweir     virtual sal_Bool IsSkipOverHiddenSections() const
67cdf0e10cSrcweir 									{ return bSkipOverHiddenSections; }
SetSkipOverHiddenSections(sal_Bool bFlag)68cdf0e10cSrcweir 	void SetSkipOverHiddenSections( sal_Bool bFlag )
69cdf0e10cSrcweir 									{ bSkipOverHiddenSections = bFlag; }
70cdf0e10cSrcweir 
71cdf0e10cSrcweir     // make copy of cursor
72cdf0e10cSrcweir     virtual SwUnoCrsr * Clone() const;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	DECL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr )
75cdf0e10cSrcweir };
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 
79cdf0e10cSrcweir class SwUnoTableCrsr : public virtual SwUnoCrsr, public virtual SwTableCursor
80cdf0e10cSrcweir {
81cdf0e10cSrcweir 	// die Selection hat die gleiche Reihenfolge wie die
82cdf0e10cSrcweir 	// TabellenBoxen. D.h., wird aus dem einen Array an einer Position
83cdf0e10cSrcweir 	// etwas geloescht, dann muss es auch im anderen erfolgen!!
84cdf0e10cSrcweir 	SwCursor aTblSel;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     using SwTableCursor::MakeBoxSels;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir public:
89cdf0e10cSrcweir 	SwUnoTableCrsr( const SwPosition& rPos );
90cdf0e10cSrcweir 	virtual ~SwUnoTableCrsr();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir //	virtual SwCursor* Create( SwPaM* pRing = 0 ) const;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	// gibt es eine Selection vom Content in die Tabelle
95cdf0e10cSrcweir 	// Return Wert gibt an, ob der Crsr auf der alten Position verbleibt
96cdf0e10cSrcweir 	virtual sal_Bool IsSelOvr( int eFlags =
97cdf0e10cSrcweir                                 ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
98cdf0e10cSrcweir                                   nsSwCursorSelOverFlags::SELOVER_TOGGLE |
99cdf0e10cSrcweir                                   nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ));
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     virtual SwUnoTableCrsr * Clone() const;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	void MakeBoxSels();
104cdf0e10cSrcweir 
GetSelRing()105cdf0e10cSrcweir 		  SwCursor& GetSelRing() 			{ return aTblSel; }
GetSelRing() const106cdf0e10cSrcweir 	const SwCursor& GetSelRing() const 		{ return aTblSel; }
107cdf0e10cSrcweir };
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 
111cdf0e10cSrcweir #endif
112