Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNDOREDLINE_HXX
21 : #define INCLUDED_SW_SOURCE_CORE_INC_UNDOREDLINE_HXX
22 :
23 : #include <undobj.hxx>
24 :
25 : struct SwSortOptions;
26 : class SwRangeRedline;
27 : class SwRedlineSaveDatas;
28 : class SwUndoDelete;
29 :
30 : class SwUndoRedline : public SwUndo, public SwUndRng
31 : {
32 : protected:
33 : SwRedlineData* mpRedlData;
34 : SwRedlineSaveDatas* mpRedlSaveData;
35 : SwUndoId mnUserId;
36 : bool mbHiddenRedlines;
37 :
38 : virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
39 : virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
40 :
41 : public:
42 : SwUndoRedline( SwUndoId nUserId, const SwPaM& rRange );
43 :
44 : virtual ~SwUndoRedline();
45 :
46 : virtual void UndoImpl( ::sw::UndoRedoContext & ) SAL_OVERRIDE;
47 : virtual void RedoImpl( ::sw::UndoRedoContext & ) SAL_OVERRIDE;
48 :
49 : SwUndoId GetUserId() const { return mnUserId; }
50 : sal_uInt16 GetRedlSaveCount() const;
51 : };
52 :
53 0 : class SwUndoRedlineDelete : public SwUndoRedline
54 : {
55 : bool bCanGroup : 1;
56 : bool bIsDelim : 1;
57 : bool bIsBackspace : 1;
58 :
59 : virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) SAL_OVERRIDE;
60 : virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) SAL_OVERRIDE;
61 :
62 : public:
63 : SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUserId = UNDO_EMPTY );
64 :
65 : bool CanGrouping( const SwUndoRedlineDelete& rPrev );
66 :
67 : // SwUndoTblCpyTbl needs this information:
68 0 : long NodeDiff() const { return nSttNode - nEndNode; }
69 0 : sal_Int32 ContentStart() const { return nSttCntnt; }
70 : };
71 :
72 : class SwUndoRedlineSort : public SwUndoRedline
73 : {
74 : SwSortOptions* pOpt;
75 : sal_uLong nSaveEndNode, nOffset;
76 : sal_Int32 nSaveEndCntnt;
77 :
78 : virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) SAL_OVERRIDE;
79 : virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) SAL_OVERRIDE;
80 :
81 : public:
82 : SwUndoRedlineSort( const SwPaM& rRange, const SwSortOptions& rOpt );
83 :
84 : virtual ~SwUndoRedlineSort();
85 :
86 : virtual void RepeatImpl( ::sw::RepeatContext & ) SAL_OVERRIDE;
87 :
88 : void SetSaveRange( const SwPaM& rRange );
89 : void SetOffset( const SwNodeIndex& rIdx );
90 : };
91 :
92 0 : class SwUndoAcceptRedline : public SwUndoRedline
93 : {
94 : private:
95 : virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) SAL_OVERRIDE;
96 :
97 : public:
98 : SwUndoAcceptRedline( const SwPaM& rRange );
99 :
100 : virtual void RepeatImpl( ::sw::RepeatContext & ) SAL_OVERRIDE;
101 : };
102 :
103 0 : class SwUndoRejectRedline : public SwUndoRedline
104 : {
105 : private:
106 : virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) SAL_OVERRIDE;
107 :
108 : public:
109 : SwUndoRejectRedline( const SwPaM& rRange );
110 :
111 : virtual void RepeatImpl( ::sw::RepeatContext & ) SAL_OVERRIDE;
112 : };
113 :
114 : class SwUndoCompDoc : public SwUndo, public SwUndRng
115 : {
116 : SwRedlineData* pRedlData;
117 : SwUndoDelete* pUnDel, *pUnDel2;
118 : SwRedlineSaveDatas* pRedlSaveData;
119 : bool bInsert;
120 :
121 : public:
122 : SwUndoCompDoc( const SwPaM& rRg, bool bIns );
123 : SwUndoCompDoc( const SwRangeRedline& rRedl );
124 :
125 : virtual ~SwUndoCompDoc();
126 :
127 : virtual void UndoImpl( ::sw::UndoRedoContext & ) SAL_OVERRIDE;
128 : virtual void RedoImpl( ::sw::UndoRedoContext & ) SAL_OVERRIDE;
129 : };
130 :
131 : #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOREDLINE_HXX
132 :
133 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|