Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _OUTLUNDO_HXX
30 : : #define _OUTLUNDO_HXX
31 : :
32 : : #include <editeng/outliner.hxx>
33 : : #include <editeng/editdata.hxx>
34 : : #include <editeng/editund2.hxx>
35 : :
36 [ - + ]: 52 : class OutlinerUndoBase : public EditUndo
37 : : {
38 : : private:
39 : : Outliner* mpOutliner;
40 : :
41 : : public:
42 : : OutlinerUndoBase( sal_uInt16 nId, Outliner* pOutliner );
43 : :
44 : 0 : Outliner* GetOutliner() const { return mpOutliner; }
45 : : };
46 : :
47 [ # # ]: 0 : class OutlinerUndoChangeParaFlags : public OutlinerUndoBase
48 : : {
49 : : private:
50 : : sal_uInt16 mnPara;
51 : : sal_uInt16 mnOldFlags;
52 : : sal_uInt16 mnNewFlags;
53 : :
54 : : void ImplChangeFlags( sal_uInt16 nFlags );
55 : :
56 : : public:
57 : : OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_uInt16 nPara, sal_uInt16 nOldDepth, sal_uInt16 nNewDepth );
58 : :
59 : : virtual void Undo();
60 : : virtual void Redo();
61 : : };
62 : :
63 [ - + ]: 32 : class OutlinerUndoChangeParaNumberingRestart : public OutlinerUndoBase
64 : : {
65 : : private:
66 : : sal_uInt16 mnPara;
67 : :
68 : : struct ParaRestartData
69 : : {
70 : : sal_Int16 mnNumberingStartValue;
71 : : sal_Bool mbParaIsNumberingRestart;
72 : : };
73 : :
74 : : ParaRestartData maUndoData;
75 : : ParaRestartData maRedoData;
76 : :
77 : : void ImplApplyData( const ParaRestartData& rData );
78 : : public:
79 : : OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_uInt16 nPara,
80 : : sal_Int16 nOldNumberingStartValue, sal_Int16 mnNewNumberingStartValue,
81 : : sal_Bool nOldbParaIsNumberingRestart, sal_Bool nbNewParaIsNumberingRestart );
82 : :
83 : : virtual void Undo();
84 : : virtual void Redo();
85 : : };
86 : :
87 [ # # ]: 0 : class OutlinerUndoChangeDepth : public OutlinerUndoBase
88 : : {
89 : : using SfxUndoAction::Repeat;
90 : : private:
91 : : sal_uInt16 mnPara;
92 : : sal_Int16 mnOldDepth;
93 : : sal_Int16 mnNewDepth;
94 : :
95 : : public:
96 : : OutlinerUndoChangeDepth( Outliner* pOutliner, sal_uInt16 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth );
97 : :
98 : : virtual void Undo();
99 : : virtual void Redo();
100 : : virtual void Repeat();
101 : : };
102 : :
103 : : // Help-Undo: If it does not exist an OutlinerUndoAction for a certain action
104 : : // because this is handled by the EditEngine, but for example the bullet has
105 : : // to be recalculated.
106 [ - + ]: 72 : class OutlinerUndoCheckPara : public OutlinerUndoBase
107 : : {
108 : : using SfxUndoAction::Repeat;
109 : : private:
110 : : sal_uInt16 mnPara;
111 : :
112 : : public:
113 : : OutlinerUndoCheckPara( Outliner* pOutliner, sal_uInt16 nPara );
114 : :
115 : : virtual void Undo();
116 : : virtual void Redo();
117 : : virtual void Repeat();
118 : : };
119 : :
120 : :
121 : :
122 : : // -------------------------------------
123 : :
124 : :
125 : : class OLUndoExpand : public EditUndo
126 : : {
127 : : using SfxUndoAction::Repeat;
128 : : void Restore( sal_Bool bUndo );
129 : : public:
130 : : OLUndoExpand( Outliner* pOut, sal_uInt16 nId );
131 : : ~OLUndoExpand();
132 : : virtual void Undo();
133 : : virtual void Redo();
134 : : virtual void Repeat();
135 : :
136 : : sal_uInt16* pParas; // 0 == nCount contains paragraph number
137 : : Outliner* pOutliner;
138 : : sal_uInt16 nCount;
139 : : };
140 : :
141 : : #endif
142 : :
143 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|