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