merged tag ooo/OOO330_m14
[LibreOffice.git] / sw / inc / SwUndoField.hxx
blob33f5cfd85e497e8049c0116a0b38c17062a29392
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef _SW_UNDO_FIELD_HXX
28 #define _SW_UNDO_FIELD_HXX
30 #include <undobj.hxx>
32 class SwDoc;
33 class SwField;
34 class SwMsgPoolItem;
36 class SwUndoField : public SwUndo
38 ULONG nNodeIndex;
39 xub_StrLen nOffset;
41 protected:
42 SwDoc * pDoc;
43 SwPosition GetPosition();
45 public:
46 SwUndoField(const SwPosition & rPos, SwUndoId nId = UNDO_FIELD );
47 virtual ~SwUndoField();
50 class SwUndoFieldFromDoc : public SwUndoField
52 SwField * pOldField, * pNewField;
53 SwMsgPoolItem * pHnt;
54 BOOL bUpdate;
56 public:
57 SwUndoFieldFromDoc(const SwPosition & rPos, const SwField & aOldField,
58 const SwField & aNewField,
59 SwMsgPoolItem * pHnt, BOOL bUpdate,
60 SwUndoId nId = UNDO_FIELD );
61 virtual ~SwUndoFieldFromDoc();
63 virtual void Undo(SwUndoIter & rIt);
64 virtual void Redo(SwUndoIter & rIt);
65 virtual void Repeat(SwUndoIter & rIt);
68 class SwUndoFieldFromAPI : public SwUndoField
70 com::sun::star::uno::Any aOldVal, aNewVal;
71 USHORT nWhich;
73 public:
74 SwUndoFieldFromAPI(const SwPosition & rPos,
75 const com::sun::star::uno::Any & rOldVal,
76 const com::sun::star::uno::Any & rNewVal,
77 USHORT nWhich);
78 virtual ~SwUndoFieldFromAPI();
80 virtual void Undo(SwUndoIter & rIt);
81 virtual void Redo(SwUndoIter & rIt);
82 virtual void Repeat(SwUndoIter & rIt);
85 #endif // _SW_UNDO_FIELD_HXX