xref: /trunk/main/sw/source/core/inc/SwUndoPageDesc.hxx (revision 1d2dbeb0)
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 #ifndef SW_UNDO_PAGE_DESC_HXX
24 #define SW_UNDO_PAGE_DESC_HXX
25 
26 #include <undobj.hxx>
27 #include <pagedesc.hxx>
28 
29 class SwDoc;
30 class SwPageDesc;
31 
32 
33 class SwUndoPageDesc : public SwUndo
34 {
35     SwPageDescExt aOld, aNew;
36     SwDoc * pDoc;
37     bool bExchange;
38 
39     // To avoid duplication of (header/footer)content nodes for simple page desc changes
40     void ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDest );
41 
42 public:
43     SwUndoPageDesc(const SwPageDesc & aOld, const SwPageDesc & aNew,
44                    SwDoc * pDoc);
45     virtual ~SwUndoPageDesc();
46 
47     virtual void UndoImpl( ::sw::UndoRedoContext & );
48     virtual void RedoImpl( ::sw::UndoRedoContext & );
49 
50     virtual SwRewriter GetRewriter() const;
51 };
52 
53 class SwUndoPageDescCreate : public SwUndo
54 {
55     const SwPageDesc * pDesc; // #116530#
56     SwPageDescExt aNew;
57     SwDoc * pDoc;
58 
59     void DoImpl();
60 
61 public:
62     SwUndoPageDescCreate(const SwPageDesc * pNew, SwDoc * pDoc); // #116530#
63     virtual ~SwUndoPageDescCreate();
64 
65     virtual void UndoImpl( ::sw::UndoRedoContext & );
66     virtual void RedoImpl( ::sw::UndoRedoContext & );
67     virtual void RepeatImpl( ::sw::RepeatContext & );
68 
69     virtual SwRewriter GetRewriter() const;
70 };
71 
72 class SwUndoPageDescDelete : public SwUndo
73 {
74     SwPageDescExt aOld;
75     SwDoc * pDoc;
76 
77     void DoImpl();
78 
79 public:
80     SwUndoPageDescDelete(const SwPageDesc & aOld, SwDoc * pDoc);
81     virtual ~SwUndoPageDescDelete();
82 
83     virtual void UndoImpl( ::sw::UndoRedoContext & );
84     virtual void RedoImpl( ::sw::UndoRedoContext & );
85     virtual void RepeatImpl( ::sw::RepeatContext & );
86 
87     virtual SwRewriter GetRewriter() const;
88 };
89 #endif // _SW_UNDO_PAGE_DESC_CHANGE_HXX
90