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 24 #ifndef SW_UNDO_BOOKMARK_HXX 25 #define SW_UNDO_BOOKMARK_HXX 26 27 #include <undobj.hxx> 28 29 30 class SwHistoryBookmark; 31 32 namespace sw { 33 namespace mark { 34 class IMark; 35 } 36 } 37 38 39 class SwUndoBookmark : public SwUndo 40 { 41 const ::std::auto_ptr<SwHistoryBookmark> m_pHistoryBookmark; 42 43 protected: 44 SwUndoBookmark( SwUndoId nUndoId, const ::sw::mark::IMark& ); 45 46 void SetInDoc( SwDoc* ); 47 void ResetInDoc( SwDoc* ); 48 49 public: 50 virtual ~SwUndoBookmark(); 51 52 // #111827# 53 /** 54 Returns the rewriter for this undo object. 55 56 The rewriter contains the following rule: 57 58 $1 -> <name of bookmark> 59 60 <name of bookmark> is the name of the bookmark whose 61 insertion/deletion is recorded by this undo object. 62 63 @return the rewriter for this undo object 64 */ 65 virtual SwRewriter GetRewriter() const; 66 }; 67 68 69 class SwUndoInsBookmark : public SwUndoBookmark 70 { 71 public: 72 SwUndoInsBookmark( const ::sw::mark::IMark& ); 73 74 virtual void UndoImpl( ::sw::UndoRedoContext & ); 75 virtual void RedoImpl( ::sw::UndoRedoContext & ); 76 }; 77 78 #endif // SW_UNDO_BOOKMARK_HXX 79 80