update credits
[LibreOffice.git] / sw / inc / SwUndoField.hxx
blob0d52126fc078a43214640116cef6ea8423ae84fe
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef SW_UNDO_FIELD_HXX
20 #define SW_UNDO_FIELD_HXX
22 #include <undobj.hxx>
24 #include <com/sun/star/uno/Any.h>
27 class SwDoc;
28 class SwField;
29 class SwMsgPoolItem;
31 class SwUndoField : public SwUndo
33 sal_uLong nNodeIndex;
34 xub_StrLen nOffset;
36 protected:
37 SwDoc * pDoc;
38 SwPosition GetPosition();
40 public:
41 SwUndoField(const SwPosition & rPos, SwUndoId nId = UNDO_FIELD );
42 virtual ~SwUndoField();
45 class SwUndoFieldFromDoc : public SwUndoField
47 SwField * pOldField, * pNewField;
48 SwMsgPoolItem * pHnt;
49 sal_Bool bUpdate;
51 void DoImpl();
53 public:
54 SwUndoFieldFromDoc(const SwPosition & rPos, const SwField & aOldField,
55 const SwField & aNewField,
56 SwMsgPoolItem * pHnt, sal_Bool bUpdate,
57 SwUndoId nId = UNDO_FIELD );
59 virtual ~SwUndoFieldFromDoc();
61 virtual void UndoImpl( ::sw::UndoRedoContext & );
62 virtual void RedoImpl( ::sw::UndoRedoContext & );
63 virtual void RepeatImpl( ::sw::RepeatContext & );
66 class SwUndoFieldFromAPI : public SwUndoField
68 com::sun::star::uno::Any aOldVal, aNewVal;
69 sal_uInt16 nWhich;
71 void DoImpl();
73 public:
74 SwUndoFieldFromAPI(const SwPosition & rPos,
75 const com::sun::star::uno::Any & rOldVal,
76 const com::sun::star::uno::Any & rNewVal,
77 sal_uInt16 nWhich);
78 virtual ~SwUndoFieldFromAPI();
80 virtual void UndoImpl( ::sw::UndoRedoContext & );
81 virtual void RedoImpl( ::sw::UndoRedoContext & );
82 virtual void RepeatImpl( ::sw::RepeatContext & );
85 #endif // SW_UNDO_FIELD_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */