merge the formfield patch from ooo-build
[ooovba.git] / sw / inc / SwUndoField.hxx
blobd53db41450990b6ce85d1e0024407dd900331e4b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SwUndoField.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SW_UNDO_FIELD_HXX
31 #define _SW_UNDO_FIELD_HXX
33 #include <undobj.hxx>
35 class SwDoc;
36 class SwField;
37 class SwMsgPoolItem;
39 class SwUndoField : public SwUndo
41 ULONG nNodeIndex;
42 xub_StrLen nOffset;
44 protected:
45 SwDoc * pDoc;
46 SwPosition GetPosition();
48 public:
49 SwUndoField(const SwPosition & rPos, SwUndoId nId = UNDO_FIELD );
50 virtual ~SwUndoField();
53 class SwUndoFieldFromDoc : public SwUndoField
55 SwField * pOldField, * pNewField;
56 SwMsgPoolItem * pHnt;
57 BOOL bUpdate;
59 public:
60 SwUndoFieldFromDoc(const SwPosition & rPos, const SwField & aOldField,
61 const SwField & aNewField,
62 SwMsgPoolItem * pHnt, BOOL bUpdate,
63 SwUndoId nId = UNDO_FIELD );
64 virtual ~SwUndoFieldFromDoc();
66 virtual void Undo(SwUndoIter & rIt);
67 virtual void Redo(SwUndoIter & rIt);
68 virtual void Repeat(SwUndoIter & rIt);
71 class SwUndoFieldFromAPI : public SwUndoField
73 com::sun::star::uno::Any aOldVal, aNewVal;
74 USHORT nWhich;
76 public:
77 SwUndoFieldFromAPI(const SwPosition & rPos,
78 const com::sun::star::uno::Any & rOldVal,
79 const com::sun::star::uno::Any & rNewVal,
80 USHORT nWhich);
81 virtual ~SwUndoFieldFromAPI();
83 virtual void Undo(SwUndoIter & rIt);
84 virtual void Redo(SwUndoIter & rIt);
85 virtual void Repeat(SwUndoIter & rIt);
88 #endif // _SW_UNDO_FIELD_HXX