LibreOffice Module sw (master) 1
formatclipboard.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_UIBASE_INC_FORMATCLIPBOARD_HXX
21#define INCLUDED_SW_SOURCE_UIBASE_INC_FORMATCLIPBOARD_HXX
22
23#include <sal/config.h>
24
25#include <memory>
26
27#include "wrtsh.hxx"
28#include <svl/itemset.hxx>
29#include <svl/style.hxx>
30
35{
36public:
38
42 bool HasContent() const;
43 bool HasContentForThisType(SelectionType nSelectionType) const;
44 static bool CanCopyThisType(SelectionType nSelectionType);
45
52 void Copy(SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bPersistentCopy);
53
63 void Paste(SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPool, bool bNoCharacterFormats,
64 bool bNoParagraphFormats);
65
69 void Erase();
70
71private:
73
75 std::unique_ptr<SfxItemSet> m_pItemSet_TextAttr;
78 std::unique_ptr<SfxItemSet> m_pItemSet_ParAttr;
79
81 std::unique_ptr<SfxItemSet> m_pTableItemSet;
82
84 OUString m_aCharStyle;
86 OUString m_aParaStyle;
87 //no frame style because it contains position information
88
91};
92
93#endif
94
95/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class acts as data container and execution class for the format paintbrush feature in writer.
SelectionType m_nSelectionType
void Copy(SwWrtShell &rWrtShell, SfxItemPool &rPool, bool bPersistentCopy)
Store/Backup the text and paragraph attribute of the current selection.
void Paste(SwWrtShell &rWrtShell, SfxStyleSheetBasePool *pPool, bool bNoCharacterFormats, bool bNoParagraphFormats)
Paste the stored text and paragraph attributes on the current selection and current paragraph.
void Erase()
Clear the currently stored text and paragraph attributes.
bool m_bPersistentCopy
specify if the Paste function have to clear the current object
OUString m_aCharStyle
name of the character format (if it exist)
std::unique_ptr< SfxItemSet > m_pItemSet_ParAttr
automatic/named paragraph attribute set (it can be character attribute applied to the paragraph)
static bool CanCopyThisType(SelectionType nSelectionType)
std::unique_ptr< SfxItemSet > m_pItemSet_TextAttr
automatic/named character attribute set
bool HasContentForThisType(SelectionType nSelectionType) const
std::unique_ptr< SfxItemSet > m_pTableItemSet
table attribute set
OUString m_aParaStyle
name of the paragraph format (if it exist)
bool HasContent() const
Test if the object contains text or paragraph attribute.
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
SelectionType