LibreOffice Module sw (master)  1
SwUndoField.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SW_INC_SWUNDOFIELD_HXX
20 #define INCLUDED_SW_INC_SWUNDOFIELD_HXX
21 
22 #include "undobj.hxx"
23 
24 #include <com/sun/star/uno/Any.h>
25 
26 class SwDoc;
27 class SwField;
28 class SwMsgPoolItem;
29 
30 class SwUndoField : public SwUndo
31 {
33  sal_Int32 nOffset;
34 
35 protected:
38 
39 public:
40  SwUndoField(const SwPosition & rPos );
41  virtual ~SwUndoField() override;
42 };
43 
44 class SwUndoFieldFromDoc final : public SwUndoField
45 {
46  std::unique_ptr<SwField> pOldField, pNewField;
48  bool const bUpdate;
49 
50  void DoImpl();
51 
52 public:
53  SwUndoFieldFromDoc(const SwPosition & rPos, const SwField & aOldField,
54  const SwField & aNewField,
55  SwMsgPoolItem * pHint, bool bUpdate);
56 
57  virtual ~SwUndoFieldFromDoc() override;
58 
59  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
60  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
61  virtual void RepeatImpl( ::sw::RepeatContext & ) override;
62 };
63 
64 class SwUndoFieldFromAPI final : public SwUndoField
65 {
66  css::uno::Any aOldVal, aNewVal;
67  sal_uInt16 const nWhich;
68 
69  void DoImpl();
70 
71 public:
72  SwUndoFieldFromAPI(const SwPosition & rPos,
73  const css::uno::Any & rOldVal,
74  const css::uno::Any & rNewVal,
75  sal_uInt16 nWhich);
76  virtual ~SwUndoFieldFromAPI() override;
77 
78  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
79  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
80  virtual void RepeatImpl( ::sw::RepeatContext & ) override;
81 };
82 
83 #endif // INCLUDED_SW_INC_SWUNDOFIELD_HXX
84 
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 nOffset
Definition: SwUndoField.hxx:33
Marks a position in the document model.
Definition: pam.hxx:35
css::uno::Any aOldVal
Definition: SwUndoField.hxx:66
virtual void RedoImpl(::sw::UndoRedoContext &) override
sal_uIntPtr sal_uLong
Base class of all fields.
Definition: fldbas.hxx:280
SwUndoField(const SwPosition &rPos)
Definition: SwUndoField.cxx:37
Definition: doc.hxx:185
sal_uLong nNodeIndex
Definition: SwUndoField.hxx:32
SwDoc * pDoc
Definition: SwUndoField.hxx:36
virtual void UndoImpl(::sw::UndoRedoContext &) override
virtual void RepeatImpl(::sw::RepeatContext &) override
std::unique_ptr< SwField > pNewField
Definition: SwUndoField.hxx:46
SwPosition GetPosition()
Definition: SwUndoField.cxx:49
SwUndoFieldFromAPI(const SwPosition &rPos, const css::uno::Any &rOldVal, const css::uno::Any &rNewVal, sal_uInt16 nWhich)
SwUndoFieldFromDoc(const SwPosition &rPos, const SwField &aOldField, const SwField &aNewField, SwMsgPoolItem *pHint, bool bUpdate)
Definition: SwUndoField.cxx:59
virtual void RepeatImpl(::sw::RepeatContext &) override
SwMsgPoolItem *const pHint
Definition: SwUndoField.hxx:47
virtual ~SwUndoField() override
Definition: SwUndoField.cxx:45
std::unique_ptr< SwField > pOldField
Definition: SwUndoField.hxx:46
sal_uInt16 const nWhich
Definition: SwUndoField.hxx:67
virtual void RedoImpl(::sw::UndoRedoContext &) override
virtual ~SwUndoFieldFromAPI() override
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoField.cxx:78
css::uno::Any aNewVal
Definition: SwUndoField.hxx:66
virtual ~SwUndoFieldFromDoc() override
Definition: SwUndoField.cxx:74
bool const bUpdate
Definition: SwUndoField.hxx:48