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 "Sparkline.hxx"
16
17#include <memory>
18#include <vector>
19
20class ScDocument;
21class ScColumn;
22class ScPatternAttr;
23class ScPostIt;
25
26namespace sc {
27
28struct ColumnBlockPosition;
29class ColumnBlockPositionSet;
30
32{
33 std::unique_ptr<ColumnBlockPositionSet> mpSet;
34
35public:
36 ClipContextBase() = delete;
38 const ClipContextBase& operator=(const ClipContextBase&) = delete;
40 virtual ~ClipContextBase();
41
44};
45
47{
59
60 std::vector<ScCellValue> maSingleCells;
61 std::vector<sc::CellTextAttr> maSingleCellAttrs;
62 std::vector<const ScPatternAttr*> maSinglePatterns;
63 std::vector<const ScPostIt*> maSingleNotes;
64 std::vector<std::shared_ptr<sc::Sparkline>> maSingleSparkline;
65
67 bool mbAsLink:1;
70
71public:
72
73 struct Range
74 {
79 };
80
83 ScDocument* pRefUndoDoc, ScDocument* pClipDoc, InsertDeleteFlags nInsertFlag,
84 bool bAsLink, bool bSkipAttrForEmptyCells);
85
86 virtual ~CopyFromClipContext() override;
87
88 void setTabRange(SCTAB nStart, SCTAB nEnd);
89
90 SCTAB getTabStart() const;
91 SCTAB getTabEnd() const;
92
93 void setDestRange( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
94 Range getDestRange() const;
95
96 ScDocument* getUndoDoc();
97 ScDocument* getClipDoc();
98 ScDocument* getDestDoc() { return &mrDestDoc; }
99 InsertDeleteFlags getInsertFlag() const;
100
101 void setDeleteFlag( InsertDeleteFlags nFlag );
102 InsertDeleteFlags getDeleteFlag() const;
103
109 void setSingleCellColumnSize( size_t nSize );
110
111 ScCellValue& getSingleCell( size_t nColOffset );
112 sc::CellTextAttr& getSingleCellAttr( size_t nColOffset );
113
114 void setSingleCell( const ScAddress& rSrcPos, const ScColumn& rSrcCol );
115
116
117 const ScPatternAttr* getSingleCellPattern( size_t nColOffset ) const;
118 void setSingleCellPattern( size_t nColOffset, const ScPatternAttr* pAttr );
119
120 const ScPostIt* getSingleCellNote( size_t nColOffset ) const;
121 void setSingleCellNote( size_t nColOffset, const ScPostIt* pNote );
122
123 std::shared_ptr<sc::Sparkline> const& getSingleSparkline(size_t nColOffset) const;
124 void setSingleSparkline(size_t nColOffset, std::shared_ptr<sc::Sparkline> const& pSparkline);
125
126 void setCondFormatList( ScConditionalFormatList* pCondFormatList );
127 ScConditionalFormatList* getCondFormatList();
128
129 void setTableProtected( bool b );
130 bool isTableProtected() const;
131
132 bool isAsLink() const;
133
140 bool isSkipEmptyCells() const;
141 bool isCloneNotes() const;
142 bool isCloneSparklines() const;
143 bool isDateCell( const ScColumn& rCol, SCROW nRow ) const;
144};
145
147{
149
150public:
151 CopyToClipContext(ScDocument& rDoc, bool bKeepScenarioFlags);
152 virtual ~CopyToClipContext() override;
153
154 bool isKeepScenarioFlags() const;
155};
156
158{
160
161public:
163 virtual ~CopyToDocContext() override;
164
165 void setStartListening( bool b );
166 bool isStartListening() const;
167};
168
169class MixDocContext final : public ClipContextBase
170{
171public:
173 virtual ~MixDocContext() override;
174};
175
176}
177
178/* 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:32
ClipContextBase(const ClipContextBase &)=delete
ClipContextBase()=delete
std::unique_ptr< ColumnBlockPositionSet > mpSet
Definition: clipcontext.hxx:33
const ClipContextBase & operator=(const ClipContextBase &)=delete
ColumnBlockPositionSet * getBlockPositionSet()
Definition: clipcontext.hxx:43
virtual ~ClipContextBase()
Definition: clipcontext.cxx:30
std::vector< const ScPatternAttr * > maSinglePatterns
Definition: clipcontext.hxx:62
ScDocument * mpRefUndoDoc
Definition: clipcontext.hxx:55
std::vector< sc::CellTextAttr > maSingleCellAttrs
Definition: clipcontext.hxx:61
std::vector< std::shared_ptr< sc::Sparkline > > maSingleSparkline
Definition: clipcontext.hxx:64
InsertDeleteFlags mnDeleteFlag
Definition: clipcontext.hxx:58
InsertDeleteFlags mnInsertFlag
Definition: clipcontext.hxx:57
std::vector< const ScPostIt * > maSingleNotes
Definition: clipcontext.hxx:63
ScDocument * getDestDoc()
Definition: clipcontext.hxx:98
ScConditionalFormatList * mpCondFormatList
Definition: clipcontext.hxx:66
std::vector< ScCellValue > maSingleCells
Definition: clipcontext.hxx:60
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
InsertDeleteFlags
Definition: global.hxx:149
CAUTION! The following defines must be in the same namespace as the respective type.
#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