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
28class SwTextNode;
29enum class TransliterationFlags;
30namespace utl {
31 class TransliterationWrapper;
32}
33
34class SwUndoOverwrite final : public SwUndo, private SwUndoSaveContent
35{
37 std::unique_ptr<SwRedlineSaveDatas> m_pRedlSaveData;
39 sal_Int32 m_nStartContent;
40 bool m_bInsChar : 1; // no Overwrite, but Insert
41 bool m_bGroup : 1; // TRUE: is already grouped; evaluated in CanGrouping()
42
43public:
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
69class SwUndoTransliterate final : public SwUndo, public SwUndRng
70{
71 std::vector< std::unique_ptr<UndoTransliterate_Data> > m_aChanges;
73
74 void DoTransliterate(SwDoc & rDoc, SwPaM const & rPam);
75
76public:
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 m_aChanges.size() > 0; }
89};
90
91#endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOOVERWRITE_HXX
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
SwUndoOverwrite(SwDoc &, SwPosition &, sal_Unicode cIns)
Definition: unovwr.cxx:43
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unovwr.cxx:179
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unovwr.cxx:245
bool CanGrouping(SwDoc &, SwPosition &, sal_Unicode cIns)
Definition: unovwr.cxx:103
virtual SwRewriter GetRewriter() const override
Returns the rewriter of this undo object.
Definition: unovwr.cxx:312
virtual ~SwUndoOverwrite() override
Definition: unovwr.cxx:99
std::unique_ptr< SwRedlineSaveDatas > m_pRedlSaveData
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unovwr.cxx:261
SwNodeOffset m_nStartNode
sal_Int32 m_nStartContent
SwUndoTransliterate(const SwPaM &rPam, const utl::TransliterationWrapper &rTrans)
Definition: unovwr.cxx:341
TransliterationFlags m_nType
std::vector< std::unique_ptr< UndoTransliterate_Data > > m_aChanges
void AddChanges(SwTextNode &rTNd, sal_Int32 nStart, sal_Int32 nLen, css::uno::Sequence< sal_Int32 > const &rOffsets)
Definition: unovwr.cxx:383
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unovwr.cxx:352
virtual ~SwUndoTransliterate() override
Definition: unovwr.cxx:348
void DoTransliterate(SwDoc &rDoc, SwPaM const &rPam)
Definition: unovwr.cxx:377
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unovwr.cxx:366
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unovwr.cxx:372
bool HasData() const
Marks a position in the document model.
Definition: pam.hxx:38
TransliterationFlags
sal_uInt16 sal_Unicode