xref: /trunk/main/sw/source/core/inc/UndoBookmark.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SW_UNDO_BOOKMARK_HXX
29 #define SW_UNDO_BOOKMARK_HXX
30 
31 #include <undobj.hxx>
32 
33 
34 class SwHistoryBookmark;
35 
36 namespace sw {
37     namespace mark {
38         class IMark;
39     }
40 }
41 
42 
43 class SwUndoBookmark : public SwUndo
44 {
45     const ::std::auto_ptr<SwHistoryBookmark> m_pHistoryBookmark;
46 
47 protected:
48     SwUndoBookmark( SwUndoId nUndoId, const ::sw::mark::IMark& );
49 
50     void SetInDoc( SwDoc* );
51     void ResetInDoc( SwDoc* );
52 
53 public:
54     virtual ~SwUndoBookmark();
55 
56     // #111827#
57     /**
58        Returns the rewriter for this undo object.
59 
60        The rewriter contains the following rule:
61 
62            $1 -> <name of bookmark>
63 
64        <name of bookmark> is the name of the bookmark whose
65        insertion/deletion is recorded by this undo object.
66 
67        @return the rewriter for this undo object
68      */
69     virtual SwRewriter GetRewriter() const;
70 };
71 
72 
73 class SwUndoInsBookmark : public SwUndoBookmark
74 {
75 public:
76     SwUndoInsBookmark( const ::sw::mark::IMark& );
77 
78     virtual void UndoImpl( ::sw::UndoRedoContext & );
79     virtual void RedoImpl( ::sw::UndoRedoContext & );
80 };
81 
82 #endif // SW_UNDO_BOOKMARK_HXX
83 
84