1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef INCLUDED_SC_INC_CLIPCONTEXT_HXX
11 #define INCLUDED_SC_INC_CLIPCONTEXT_HXX
13 #include "address.hxx"
14 #include "cellvalue.hxx"
17 #include <boost/unordered_map.hpp>
18 #include <boost/noncopyable.hpp>
19 #include <boost/scoped_ptr.hpp>
25 class ScConditionalFormatList
;
29 struct ColumnBlockPosition
;
30 class ColumnBlockPositionSet
;
32 class ClipContextBase
: boost::noncopyable
34 boost::scoped_ptr
<ColumnBlockPositionSet
> mpSet
;
36 ClipContextBase(); // disabled
39 ClipContextBase(ScDocument
& rDoc
);
40 virtual ~ClipContextBase();
42 ColumnBlockPosition
* getBlockPosition(SCTAB nTab
, SCCOL nCol
);
45 class CopyFromClipContext
: public ClipContextBase
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
;
62 bool mbSkipAttrForEmptyCells
:1;
64 bool mbTableProtected
:1;
66 CopyFromClipContext(); // disabled
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;
124 CopyToClipContext(); // disabled
127 CopyToClipContext(ScDocument
& rDoc
, bool bKeepScenarioFlags
, bool bCloneNotes
);
128 virtual ~CopyToClipContext();
130 bool isKeepScenarioFlags() const;
131 bool isCloneNotes() const;
134 class CopyToDocContext
: public ClipContextBase
137 CopyToDocContext(ScDocument
& rDoc
);
138 virtual ~CopyToDocContext();
141 class MixDocContext
: public ClipContextBase
144 MixDocContext(ScDocument
& rDoc
);
145 virtual ~MixDocContext();
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */