Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / inc / formatclipboard.hxx
blobe83267bd700b8407bf8b7a0abab5c85a62531ee6
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 .
20 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_FORMATCLIPBOARD_HXX
21 #define INCLUDED_SW_SOURCE_UIBASE_INC_FORMATCLIPBOARD_HXX
23 #include <sal/config.h>
25 #include <memory>
27 #include "wrtsh.hxx"
28 #include <svl/itemset.hxx>
29 #include <svl/style.hxx>
31 /** This class acts as data container and execution class for the format paintbrush feature in writer.
34 class SwFormatClipboard
36 public:
37 SwFormatClipboard();
39 /**
40 * Test if the object contains text or paragraph attribute
42 bool HasContent() const;
43 bool HasContentForThisType(SelectionType nSelectionType) const;
44 static bool CanCopyThisType(SelectionType nSelectionType);
46 /**
47 * Store/Backup the text and paragraph attribute of the current selection.
49 * @param bPersistentCopy
50 * input parameter - specify if the Paste function will erase the current object.
52 void Copy(SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bPersistentCopy);
54 /**
55 * Paste the stored text and paragraph attributes on the current selection and current paragraph.
57 * @param bNoCharacterFormats
58 * Do not paste the character formats.
60 * @param bNoParagraphFormats
61 * Do not paste the paragraph formats.
63 void Paste(SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPool, bool bNoCharacterFormats,
64 bool bNoParagraphFormats);
66 /**
67 * Clear the currently stored text and paragraph attributes.
69 void Erase();
71 private:
72 SelectionType m_nSelectionType;
74 /** automatic/named character attribute set */
75 std::unique_ptr<SfxItemSet> m_pItemSet_TextAttr;
76 /** automatic/named paragraph attribute set
77 * (it can be character attribute applied to the paragraph) */
78 std::unique_ptr<SfxItemSet> m_pItemSet_ParAttr;
80 /** table attribute set */
81 std::unique_ptr<SfxItemSet> m_pTableItemSet;
83 /** name of the character format (if it exist) */
84 OUString m_aCharStyle;
85 /** name of the paragraph format (if it exist) */
86 OUString m_aParaStyle;
87 //no frame style because it contains position information
89 /** specify if the Paste function have to clear the current object */
90 bool m_bPersistentCopy;
93 #endif
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */