update emoji autocorrect entries from po-files
[LibreOffice.git] / sc / inc / clipcontext.hxx
blob787b964a699b4ea25331bea1374c62f62b55c7a5
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/.
8 */
10 #ifndef INCLUDED_SC_INC_CLIPCONTEXT_HXX
11 #define INCLUDED_SC_INC_CLIPCONTEXT_HXX
13 #include "address.hxx"
14 #include "cellvalue.hxx"
15 #include <celltextattr.hxx>
17 #include <vector>
18 #include <boost/noncopyable.hpp>
19 #include <boost/scoped_ptr.hpp>
21 class ScDocument;
22 class ScColumn;
23 class ScPatternAttr;
24 class ScPostIt;
25 class ScConditionalFormatList;
27 namespace sc {
29 struct ColumnBlockPosition;
30 class ColumnBlockPositionSet;
32 class ClipContextBase : boost::noncopyable
34 boost::scoped_ptr<ColumnBlockPositionSet> mpSet;
36 ClipContextBase(); // disabled
38 public:
39 ClipContextBase(ScDocument& rDoc);
40 virtual ~ClipContextBase();
42 ColumnBlockPosition* getBlockPosition(SCTAB nTab, SCCOL nCol);
45 class CopyFromClipContext : public ClipContextBase
47 SCCOL mnDestCol1;
48 SCCOL mnDestCol2;
49 SCROW mnDestRow1;
50 SCROW mnDestRow2;
51 SCTAB mnTabStart;
52 SCTAB mnTabEnd;
53 ScDocument& mrDestDoc;
54 ScDocument* mpRefUndoDoc;
55 ScDocument* mpClipDoc;
56 InsertDeleteFlags mnInsertFlag;
57 InsertDeleteFlags mnDeleteFlag;
59 std::vector<ScCellValue> maSingleCells;
60 std::vector<sc::CellTextAttr> maSingleCellAttrs;
61 std::vector<const ScPatternAttr*> maSinglePatterns;
62 std::vector<const ScPostIt*> maSingleNotes;
64 ScConditionalFormatList* mpCondFormatList;
65 bool mbAsLink:1;
66 bool mbSkipAttrForEmptyCells:1;
67 bool mbCloneNotes:1;
68 bool mbTableProtected:1;
70 CopyFromClipContext(); // disabled
72 public:
74 struct Range
76 SCCOL mnCol1;
77 SCCOL mnCol2;
78 SCROW mnRow1;
79 SCROW mnRow2;
82 CopyFromClipContext(ScDocument& rDoc,
83 ScDocument* pRefUndoDoc, ScDocument* pClipDoc, InsertDeleteFlags nInsertFlag,
84 bool bAsLink, bool bSkipAttrForEmptyCells);
86 virtual ~CopyFromClipContext();
88 void setTabRange(SCTAB nStart, SCTAB nEnd);
90 SCTAB getTabStart() const;
91 SCTAB getTabEnd() const;
93 void setDestRange( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
94 Range getDestRange() const;
96 ScDocument* getUndoDoc();
97 ScDocument* getClipDoc();
98 InsertDeleteFlags getInsertFlag() const;
100 void setDeleteFlag( InsertDeleteFlags nFlag );
101 InsertDeleteFlags getDeleteFlag() const;
104 * Set the column size of a "single cell" row, which is used when copying
105 * a single row of cells in a clip doc and pasting it into multiple
106 * rows by replicating it.
108 void setSingleCellColumnSize( size_t nSize );
110 ScCellValue& getSingleCell( size_t nColOffset );
111 sc::CellTextAttr& getSingleCellAttr( size_t nColOffset );
113 void setSingleCell( const ScAddress& rSrcPos, const ScColumn& rSrcCol );
116 const ScPatternAttr* getSingleCellPattern( size_t nColOffset ) const;
117 void setSingleCellPattern( size_t nColOffset, const ScPatternAttr* pAttr );
119 const ScPostIt* getSingleCellNote( size_t nColOffset ) const;
120 void setSingleCellNote( size_t nColOffset, const ScPostIt* pNote );
122 void setCondFormatList( ScConditionalFormatList* pCondFormatList );
123 ScConditionalFormatList* getCondFormatList();
125 void setTableProtected( bool b );
126 bool isTableProtected() const;
128 bool isAsLink() const;
129 bool isSkipAttrForEmptyCells() const;
130 bool isCloneNotes() const;
131 bool isDateCell( const ScColumn& rCol, SCROW nRow ) const;
134 class CopyToClipContext : public ClipContextBase
136 bool mbKeepScenarioFlags:1;
137 bool mbCloneNotes:1;
139 CopyToClipContext(); // disabled
141 public:
142 CopyToClipContext(ScDocument& rDoc, bool bKeepScenarioFlags, bool bCloneNotes);
143 virtual ~CopyToClipContext();
145 bool isKeepScenarioFlags() const;
146 bool isCloneNotes() const;
149 class CopyToDocContext : public ClipContextBase
151 bool mbStartListening;
153 public:
154 CopyToDocContext(ScDocument& rDoc);
155 virtual ~CopyToDocContext();
157 void setStartListening( bool b );
158 bool isStartListening() const;
161 class MixDocContext : public ClipContextBase
163 public:
164 MixDocContext(ScDocument& rDoc);
165 virtual ~MixDocContext();
170 #endif
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */