Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _UNOCRSR_HXX
29 : : #define _UNOCRSR_HXX
30 : : #include <swcrsr.hxx>
31 : : #include <calbck.hxx>
32 : :
33 : :
34 : : class SwUnoCrsr : public virtual SwCursor, public SwModify
35 : : {
36 : : sal_Bool bRemainInSection : 1;
37 : : sal_Bool bSkipOverHiddenSections : 1;
38 : : sal_Bool bSkipOverProtectSections : 1;
39 : :
40 : : public:
41 : : SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 );
42 : : virtual ~SwUnoCrsr();
43 : :
44 : : protected:
45 : :
46 : : virtual const SwCntntFrm* DoSetBidiLevelLeftRight(
47 : : sal_Bool & io_rbLeft, sal_Bool bVisualAllowed, sal_Bool bInsertCrsr);
48 : : virtual void DoSetBidiLevelUpDown();
49 : :
50 : : public:
51 : :
52 : : // Does a selection of content exist in table?
53 : : // Return value indicates if the cursor remains at its old position.
54 : : virtual sal_Bool IsSelOvr( int eFlags =
55 : : ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
56 : : nsSwCursorSelOverFlags::SELOVER_TOGGLE |
57 : : nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ));
58 : :
59 : : virtual bool IsReadOnlyAvailable() const;
60 : :
61 : 10413 : sal_Bool IsRemainInSection() const { return bRemainInSection; }
62 : 2801 : void SetRemainInSection( sal_Bool bFlag ) { bRemainInSection = bFlag; }
63 : :
64 : 13037 : virtual sal_Bool IsSkipOverProtectSections() const
65 : 13037 : { return bSkipOverProtectSections; }
66 : 0 : void SetSkipOverProtectSections( sal_Bool bFlag )
67 : 0 : { bSkipOverProtectSections = bFlag; }
68 : :
69 : 13037 : virtual sal_Bool IsSkipOverHiddenSections() const
70 : 13037 : { return bSkipOverHiddenSections; }
71 : 0 : void SetSkipOverHiddenSections( sal_Bool bFlag )
72 : 0 : { bSkipOverHiddenSections = bFlag; }
73 : :
74 : : // make copy of cursor
75 : : virtual SwUnoCrsr * Clone() const;
76 : :
77 [ + + ][ + + ]: 76656 : DECL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr )
78 : : };
79 : :
80 : :
81 : :
82 : : class SwUnoTableCrsr : public virtual SwUnoCrsr, public virtual SwTableCursor
83 : : {
84 : : // The selection has the same order as the table boxes, i.e.
85 : : // if something is deleted from the one array at a certain position
86 : : // it has also to be deleted from the other!
87 : : SwCursor aTblSel;
88 : :
89 : : using SwTableCursor::MakeBoxSels;
90 : :
91 : : public:
92 : : SwUnoTableCrsr( const SwPosition& rPos );
93 : : virtual ~SwUnoTableCrsr();
94 : :
95 : : // Does a selection of content exist in table?
96 : : // Return value indicates if the cursor remains at its old position.
97 : : virtual sal_Bool IsSelOvr( int eFlags =
98 : : ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
99 : : nsSwCursorSelOverFlags::SELOVER_TOGGLE |
100 : : nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ));
101 : :
102 : : virtual SwUnoTableCrsr * Clone() const;
103 : :
104 : : void MakeBoxSels();
105 : :
106 : 1656 : SwCursor& GetSelRing() { return aTblSel; }
107 : : const SwCursor& GetSelRing() const { return aTblSel; }
108 : : };
109 : :
110 : :
111 : :
112 : : #endif
113 : :
114 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|