LibreOffice Module sc (master) 1
clipcontext.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
10#pragma once
11
12#include "address.hxx"
13#include "cellvalue.hxx"
14#include "celltextattr.hxx"
15#include "columnspanset.hxx"
16#include "Sparkline.hxx"
17
18#include <memory>
19#include <vector>
20
21class ScDocument;
22class ScColumn;
23class ScPatternAttr;
24class ScPostIt;
26
27namespace sc {
28
29struct ColumnBlockPosition;
30class ColumnBlockPositionSet;
31
33{
34 std::unique_ptr<ColumnBlockPositionSet> mpSet;
35
36public:
37 ClipContextBase() = delete;
39 const ClipContextBase& operator=(const ClipContextBase&) = delete;
41 virtual ~ClipContextBase();
42
45};
46
48{
51
63
64 std::vector<ScCellValue> maSingleCells;
65 std::vector<sc::CellTextAttr> maSingleCellAttrs;
66 std::vector<const ScPatternAttr*> maSinglePatterns;
67 std::vector<const ScPostIt*> maSingleNotes;
68 std::vector<std::shared_ptr<sc::Sparkline>> maSingleSparkline;
69
71 bool mbAsLink:1;
74
75public:
76
77 struct Range
78 {
83 };
84
87 ScDocument* pRefUndoDoc, ScDocument* pClipDoc, InsertDeleteFlags nInsertFlag,
88 bool bAsLink, bool bSkipAttrForEmptyCells);
89
90 virtual ~CopyFromClipContext() override;
91
92 void setTabRange(SCTAB nStart, SCTAB nEnd);
93
94 SCTAB getTabStart() const;
95 SCTAB getTabEnd() const;
96
97 void setDestRange( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
98 Range getDestRange() const;
99
100 ScDocument* getUndoDoc();
101 ScDocument* getClipDoc();
103 InsertDeleteFlags getInsertFlag() const;
104
105 void setDeleteFlag( InsertDeleteFlags nFlag );
106 InsertDeleteFlags getDeleteFlag() const;
107
112 void setListeningFormulaSpans( SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
113
117 void startListeningFormulas();
118
124 void setSingleCellColumnSize( size_t nSize );
125
126 ScCellValue& getSingleCell( size_t nColOffset );
127 sc::CellTextAttr& getSingleCellAttr( size_t nColOffset );
128
129 void setSingleCell( const ScAddress& rSrcPos, const ScColumn& rSrcCol );
130
131
132 const ScPatternAttr* getSingleCellPattern( size_t nColOffset ) const;
133 void setSingleCellPattern( size_t nColOffset, const ScPatternAttr* pAttr );
134
135 const ScPostIt* getSingleCellNote( size_t nColOffset ) const;
136 void setSingleCellNote( size_t nColOffset, const ScPostIt* pNote );
137
138 std::shared_ptr<sc::Sparkline> const& getSingleSparkline(size_t nColOffset) const;
139 void setSingleSparkline(size_t nColOffset, std::shared_ptr<sc::Sparkline> const& pSparkline);
140
141 void setCondFormatList( ScConditionalFormatList* pCondFormatList );
142 ScConditionalFormatList* getCondFormatList();
143
144 void setTableProtected( bool b );
145 bool isTableProtected() const;
146
147 bool isAsLink() const;
148
155 bool isSkipEmptyCells() const;
156 bool isCloneNotes() const;
157 bool isCloneSparklines() const;
158 bool isDateCell( const ScColumn& rCol, SCROW nRow ) const;
159};
160
162{
164
165public:
166 CopyToClipContext(ScDocument& rDoc, bool bKeepScenarioFlags);
167 virtual ~CopyToClipContext() override;
168
169 bool isKeepScenarioFlags() const;
170};
171
173{
175
176public:
178 virtual ~CopyToDocContext() override;
179
180 void setStartListening( bool b );
181 bool isStartListening() const;
182};
183
184class MixDocContext final : public ClipContextBase
185{
186public:
188 virtual ~MixDocContext() override;
189};
190
191}
192
193/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Additional class containing cell annotation data.
Definition: postit.hxx:58
ColumnBlockPosition * getBlockPosition(SCTAB nTab, SCCOL nCol)
Definition: clipcontext.cxx:33
ClipContextBase(const ClipContextBase &)=delete
ClipContextBase()=delete
std::unique_ptr< ColumnBlockPositionSet > mpSet
Definition: clipcontext.hxx:34
const ClipContextBase & operator=(const ClipContextBase &)=delete
ColumnBlockPositionSet * getBlockPositionSet()
Definition: clipcontext.hxx:44
virtual ~ClipContextBase()
Definition: clipcontext.cxx:31
Structure that stores segments of boolean flags per column, and perform custom action on those segmen...
std::vector< const ScPatternAttr * > maSinglePatterns
Definition: clipcontext.hxx:66
ScDocument * mpRefUndoDoc
Definition: clipcontext.hxx:59
std::vector< sc::CellTextAttr > maSingleCellAttrs
Definition: clipcontext.hxx:65
std::vector< std::shared_ptr< sc::Sparkline > > maSingleSparkline
Definition: clipcontext.hxx:68
sc::ColumnSpanSet maListeningFormulaSpans
Tracks modified formula group spans.
Definition: clipcontext.hxx:50
InsertDeleteFlags mnDeleteFlag
Definition: clipcontext.hxx:62
InsertDeleteFlags mnInsertFlag
Definition: clipcontext.hxx:61
std::vector< const ScPostIt * > maSingleNotes
Definition: clipcontext.hxx:67
ScDocument * getDestDoc()
ScConditionalFormatList * mpCondFormatList
Definition: clipcontext.hxx:70
std::vector< ScCellValue > maSingleCells
Definition: clipcontext.hxx:64
bool isKeepScenarioFlags() const
virtual ~CopyToClipContext() override
CopyToClipContext(ScDocument &rDoc, bool bKeepScenarioFlags)
virtual ~CopyToDocContext() override
bool isStartListening() const
CopyToDocContext(ScDocument &rDoc)
void setStartListening(bool b)
MixDocContext(ScDocument &rDoc)
virtual ~MixDocContext() override
ScDocument & mrDestDoc
InsertDeleteFlags
Definition: global.hxx:149
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
Store arbitrary cell value of any kind.
Definition: cellvalue.hxx:32
Store position data for column array storage.
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17