LibreOffice Module sw (master)  1
UndoOverwrite.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 
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNDOOVERWRITE_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNDOOVERWRITE_HXX
22 
23 #include <memory>
24 #include <rtl/ustring.hxx>
25 #include <undobj.hxx>
26 
27 class SwRedlineSaveDatas;
28 class SwTextNode;
29 enum class TransliterationFlags;
30 namespace utl {
31  class TransliterationWrapper;
32 }
33 
35 {
36  OUString aDelStr, aInsStr;
37  std::unique_ptr<SwRedlineSaveDatas> pRedlSaveData;
39  sal_Int32 nSttContent;
40  bool bInsChar : 1; // no Overwrite, but Insert
41  bool bGroup : 1; // TRUE: is already grouped; evaluated in CanGrouping()
42 
43 public:
45 
46  virtual ~SwUndoOverwrite() override;
47 
48  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
49  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
50  virtual void RepeatImpl( ::sw::RepeatContext & ) override;
51 
63  virtual SwRewriter GetRewriter() const override;
64 
65  bool CanGrouping( SwDoc*, SwPosition&, sal_Unicode cIns );
66 };
67 
69 class SwUndoTransliterate : public SwUndo, public SwUndRng
70 {
71  std::vector< std::unique_ptr<UndoTransliterate_Data> > aChanges;
73 
74  void DoTransliterate(SwDoc & rDoc, SwPaM const & rPam);
75 
76 public:
77  SwUndoTransliterate( const SwPaM& rPam,
78  const utl::TransliterationWrapper& rTrans );
79 
80  virtual ~SwUndoTransliterate() override;
81 
82  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
83  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
84  virtual void RepeatImpl( ::sw::RepeatContext & ) override;
85 
86  void AddChanges( SwTextNode& rTNd, sal_Int32 nStart, sal_Int32 nLen,
87  css::uno::Sequence <sal_Int32> const & rOffsets );
88  bool HasData() const { return aChanges.size() > 0; }
89 };
90 
91 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOOVERWRITE_HXX
92 
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwUndoOverwrite(SwDoc *, SwPosition &, sal_Unicode cIns)
Definition: unovwr.cxx:41
Marks a position in the document model.
Definition: pam.hxx:35
virtual ~SwUndoOverwrite() override
Definition: unovwr.cxx:98
SwUndoTransliterate(const SwPaM &rPam, const utl::TransliterationWrapper &rTrans)
Definition: unovwr.cxx:343
sal_uIntPtr sal_uLong
Definition: doc.hxx:185
void DoTransliterate(SwDoc &rDoc, SwPaM const &rPam)
Definition: unovwr.cxx:379
sal_uInt16 sal_Unicode
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unovwr.cxx:374
TransliterationFlags const nType
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unovwr.cxx:260
TransliterationFlags
virtual SwRewriter GetRewriter() const override
Returns the rewriter of this undo object.
Definition: unovwr.cxx:311
std::vector< std::unique_ptr< UndoTransliterate_Data > > aChanges
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unovwr.cxx:244
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unovwr.cxx:178
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool HasData() const
sal_Int32 nSttContent
std::unique_ptr< SwRedlineSaveDatas > pRedlSaveData
virtual ~SwUndoTransliterate() override
Definition: unovwr.cxx:350
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unovwr.cxx:368
bool CanGrouping(SwDoc *, SwPosition &, sal_Unicode cIns)
Definition: unovwr.cxx:102
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
sal_uLong nSttNode
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unovwr.cxx:354
void AddChanges(SwTextNode &rTNd, sal_Int32 nStart, sal_Int32 nLen, css::uno::Sequence< sal_Int32 > const &rOffsets)
Definition: unovwr.cxx:385