Bump version to 4.3-4
[LibreOffice.git] / sc / inc / clipcontext.hxx
blob7791a938fddc4950f7301a659aa2c59e97df0725
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"
16 #include <vector>
17 #include <boost/unordered_map.hpp>
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* mpRefUndoDoc;
54 ScDocument* mpClipDoc;
55 sal_uInt16 mnInsertFlag;
56 sal_uInt16 mnDeleteFlag;
57 ScCellValue maSingleCell;
58 ScConditionalFormatList* mpCondFormatList;
59 const ScPatternAttr* mpSinglePattern;
60 const ScPostIt* mpSingleNote;
61 bool mbAsLink:1;
62 bool mbSkipAttrForEmptyCells:1;
63 bool mbCloneNotes:1;
64 bool mbTableProtected:1;
66 CopyFromClipContext(); // disabled
68 public:
70 struct Range
72 SCCOL mnCol1;
73 SCCOL mnCol2;
74 SCROW mnRow1;
75 SCROW mnRow2;
78 CopyFromClipContext(ScDocument& rDoc,
79 ScDocument* pRefUndoDoc, ScDocument* pClipDoc, sal_uInt16 nInsertFlag,
80 bool bAsLink, bool bSkipAttrForEmptyCells);
82 virtual ~CopyFromClipContext();
84 void setTabRange(SCTAB nStart, SCTAB nEnd);
86 SCTAB getTabStart() const;
87 SCTAB getTabEnd() const;
89 void setDestRange( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
90 Range getDestRange() const;
92 ScDocument* getUndoDoc();
93 ScDocument* getClipDoc();
94 sal_uInt16 getInsertFlag() const;
96 void setDeleteFlag( sal_uInt16 nFlag );
97 sal_uInt16 getDeleteFlag() const;
99 ScCellValue& getSingleCell();
101 void setCondFormatList( ScConditionalFormatList* pCondFormatList );
102 ScConditionalFormatList* getCondFormatList();
104 const ScPatternAttr* getSingleCellPattern() const;
105 void setSingleCellPattern( const ScPatternAttr* pAttr );
107 const ScPostIt* getSingleCellNote() const;
108 void setSingleCellNote( const ScPostIt* pNote );
110 void setTableProtected( bool b );
111 bool isTableProtected() const;
113 bool isAsLink() const;
114 bool isSkipAttrForEmptyCells() const;
115 bool isCloneNotes() const;
116 bool isDateCell( const ScColumn& rCol, SCROW nRow ) const;
119 class CopyToClipContext : public ClipContextBase
121 bool mbKeepScenarioFlags:1;
122 bool mbCloneNotes:1;
124 CopyToClipContext(); // disabled
126 public:
127 CopyToClipContext(ScDocument& rDoc, bool bKeepScenarioFlags, bool bCloneNotes);
128 virtual ~CopyToClipContext();
130 bool isKeepScenarioFlags() const;
131 bool isCloneNotes() const;
134 class CopyToDocContext : public ClipContextBase
136 public:
137 CopyToDocContext(ScDocument& rDoc);
138 virtual ~CopyToDocContext();
141 class MixDocContext : public ClipContextBase
143 public:
144 MixDocContext(ScDocument& rDoc);
145 virtual ~MixDocContext();
150 #endif
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */