11d2dbeb0SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 31d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 41d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 51d2dbeb0SAndrew Rist * distributed with this work for additional information 61d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 71d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 81d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 91d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 111d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 131d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 141d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 151d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 161d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 171d2dbeb0SAndrew Rist * specific language governing permissions and limitations 181d2dbeb0SAndrew Rist * under the License. 19cdf0e10cSrcweir * 201d2dbeb0SAndrew Rist *************************************************************/ 211d2dbeb0SAndrew Rist 221d2dbeb0SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SW_UNDO_REDLINE_HXX 25cdf0e10cSrcweir #define SW_UNDO_REDLINE_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <undobj.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir 30cdf0e10cSrcweir struct SwSortOptions; 31cdf0e10cSrcweir class SwRedline; 32cdf0e10cSrcweir class SwRedlineSaveDatas; 33cdf0e10cSrcweir class SwUndoDelete; 34cdf0e10cSrcweir 35cdf0e10cSrcweir 36cdf0e10cSrcweir //-------------------------------------------------------------------- 37cdf0e10cSrcweir 38cdf0e10cSrcweir class SwUndoRedline : public SwUndo, public SwUndRng 39cdf0e10cSrcweir { 40cdf0e10cSrcweir protected: 41*641de097SOliver-Rainer Wittmann SwRedlineData* mpRedlData; 42*641de097SOliver-Rainer Wittmann SwRedlineSaveDatas* mpRedlSaveData; 43*641de097SOliver-Rainer Wittmann SwUndoId mnUserId; 44*641de097SOliver-Rainer Wittmann sal_Bool mbHiddenRedlines; 45cdf0e10cSrcweir 46cdf0e10cSrcweir virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); 47cdf0e10cSrcweir virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); 48cdf0e10cSrcweir 49cdf0e10cSrcweir public: 50cdf0e10cSrcweir SwUndoRedline( SwUndoId nUserId, const SwPaM& rRange ); 51cdf0e10cSrcweir 52cdf0e10cSrcweir virtual ~SwUndoRedline(); 53cdf0e10cSrcweir 54cdf0e10cSrcweir virtual void UndoImpl( ::sw::UndoRedoContext & ); 55cdf0e10cSrcweir virtual void RedoImpl( ::sw::UndoRedoContext & ); 56cdf0e10cSrcweir GetUserId() const57*641de097SOliver-Rainer Wittmann SwUndoId GetUserId() const { return mnUserId; } 58cdf0e10cSrcweir sal_uInt16 GetRedlSaveCount() const; 59cdf0e10cSrcweir }; 60cdf0e10cSrcweir 61cdf0e10cSrcweir class SwUndoRedlineDelete : public SwUndoRedline 62cdf0e10cSrcweir { 63cdf0e10cSrcweir sal_Bool bCanGroup : 1; 64cdf0e10cSrcweir sal_Bool bIsDelim : 1; 65cdf0e10cSrcweir sal_Bool bIsBackspace : 1; 66cdf0e10cSrcweir 67cdf0e10cSrcweir virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); 68cdf0e10cSrcweir virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); 69cdf0e10cSrcweir 70cdf0e10cSrcweir public: 71cdf0e10cSrcweir SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUserId = UNDO_EMPTY ); 72cdf0e10cSrcweir 73cdf0e10cSrcweir sal_Bool CanGrouping( const SwUndoRedlineDelete& rPrev ); 74cdf0e10cSrcweir 75cdf0e10cSrcweir // SwUndoTblCpyTbl needs this information: NodeDiff() const76cdf0e10cSrcweir long NodeDiff() const { return nSttNode - nEndNode; } ContentStart() const77cdf0e10cSrcweir xub_StrLen ContentStart() const { return nSttCntnt; } 78cdf0e10cSrcweir }; 79cdf0e10cSrcweir 80cdf0e10cSrcweir class SwUndoRedlineSort : public SwUndoRedline 81cdf0e10cSrcweir { 82cdf0e10cSrcweir SwSortOptions* pOpt; 83cdf0e10cSrcweir sal_uLong nSaveEndNode, nOffset; 84cdf0e10cSrcweir xub_StrLen nSaveEndCntnt; 85cdf0e10cSrcweir 86cdf0e10cSrcweir virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); 87cdf0e10cSrcweir virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); 88cdf0e10cSrcweir 89cdf0e10cSrcweir public: 90cdf0e10cSrcweir SwUndoRedlineSort( const SwPaM& rRange, const SwSortOptions& rOpt ); 91cdf0e10cSrcweir 92cdf0e10cSrcweir virtual ~SwUndoRedlineSort(); 93cdf0e10cSrcweir 94cdf0e10cSrcweir virtual void RepeatImpl( ::sw::RepeatContext & ); 95cdf0e10cSrcweir 96cdf0e10cSrcweir void SetSaveRange( const SwPaM& rRange ); 97cdf0e10cSrcweir void SetOffset( const SwNodeIndex& rIdx ); 98cdf0e10cSrcweir }; 99cdf0e10cSrcweir 100cdf0e10cSrcweir class SwUndoAcceptRedline : public SwUndoRedline 101cdf0e10cSrcweir { 102cdf0e10cSrcweir private: 103cdf0e10cSrcweir virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); 104cdf0e10cSrcweir 105cdf0e10cSrcweir public: 106cdf0e10cSrcweir SwUndoAcceptRedline( const SwPaM& rRange ); 107cdf0e10cSrcweir 108cdf0e10cSrcweir virtual void RepeatImpl( ::sw::RepeatContext & ); 109cdf0e10cSrcweir }; 110cdf0e10cSrcweir 111cdf0e10cSrcweir class SwUndoRejectRedline : public SwUndoRedline 112cdf0e10cSrcweir { 113cdf0e10cSrcweir private: 114cdf0e10cSrcweir virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); 115cdf0e10cSrcweir 116cdf0e10cSrcweir public: 117cdf0e10cSrcweir SwUndoRejectRedline( const SwPaM& rRange ); 118cdf0e10cSrcweir 119cdf0e10cSrcweir virtual void RepeatImpl( ::sw::RepeatContext & ); 120cdf0e10cSrcweir }; 121cdf0e10cSrcweir 122cdf0e10cSrcweir //-------------------------------------------------------------------- 123cdf0e10cSrcweir 124cdf0e10cSrcweir class SwUndoCompDoc : public SwUndo, public SwUndRng 125cdf0e10cSrcweir { 126cdf0e10cSrcweir SwRedlineData* pRedlData; 127cdf0e10cSrcweir SwUndoDelete* pUnDel, *pUnDel2; 128cdf0e10cSrcweir SwRedlineSaveDatas* pRedlSaveData; 129cdf0e10cSrcweir sal_Bool bInsert; 130cdf0e10cSrcweir public: 131cdf0e10cSrcweir SwUndoCompDoc( const SwPaM& rRg, sal_Bool bIns ); 132cdf0e10cSrcweir SwUndoCompDoc( const SwRedline& rRedl ); 133cdf0e10cSrcweir 134cdf0e10cSrcweir virtual ~SwUndoCompDoc(); 135cdf0e10cSrcweir 136cdf0e10cSrcweir virtual void UndoImpl( ::sw::UndoRedoContext & ); 137cdf0e10cSrcweir virtual void RedoImpl( ::sw::UndoRedoContext & ); 138cdf0e10cSrcweir }; 139cdf0e10cSrcweir 140cdf0e10cSrcweir #endif // SW_UNDO_REDLINE_HXX 141cdf0e10cSrcweir 142