LibreOffice Module sc (master) 1
XMLExportIterator.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <vector>
23#include <list>
24#include <com/sun/star/table/CellContentType.hpp>
25#include <detfunc.hxx>
26#include <detdata.hxx>
27#include <cellvalue.hxx>
28
29#include <memory>
30
31namespace com::sun::star::drawing { class XShape; }
32namespace com::sun::star::sheet { class XSpreadsheet; }
33namespace com::sun::star::table { class XCellRange; }
34namespace com::sun::star::table { struct CellRangeAddress; }
35
36class ScPostIt;
38struct ScMyCell;
39class ScXMLExport;
41
43{
44protected:
45 virtual bool GetFirstAddress( ScAddress& rCellAddress ) = 0;
46
47public:
49 virtual ~ScMyIteratorBase();
50
55
56 virtual void SetCellData( ScMyCell& rMyCell ) = 0;
57 virtual void Sort() = 0;
58
59 void UpdateAddress( ScAddress& rCellAddress );
60};
61
63{
66 sal_Int32 nEndX;
67 sal_Int32 nEndY;
68 css::uno::Reference<css::drawing::XShape> xShape;
69
70 bool operator<(const ScMyShape& aShape) const;
71};
72
73typedef std::list<ScMyShape> ScMyShapeList;
74
76{
77private:
79protected:
80 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
81public:
83 virtual ~ScMyShapesContainer() override;
84
86 void AddNewShape(const ScMyShape& aShape);
87 const ScMyShapeList& GetShapes() const { return aShapeList; }
88 virtual void SetCellData( ScMyCell& rMyCell ) override;
89 virtual void Sort() override;
90 void SkipTable(SCTAB nSkip);
91};
92
94{
95 css::uno::Reference<css::drawing::XShape> xShape;
97
98 bool operator<(const ScMyNoteShape& aNote) const;
99};
100
101typedef std::list<ScMyNoteShape> ScMyNoteShapeList;
102
104{
105private:
107protected:
108 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
109public:
111 virtual ~ScMyNoteShapesContainer() override;
112
114 void AddNewNote(const ScMyNoteShape& aNote);
115 const ScMyNoteShapeList& GetNotes() const { return aNoteShapeList; }
116 virtual void SetCellData( ScMyCell& rMyCell ) override;
117 virtual void Sort() override;
118 void SkipTable(SCTAB nSkip);
119};
120
122{
124 sal_Int32 nRows;
126 bool operator<(const ScMyMergedRange& aRange) const;
127};
128
129typedef std::list<ScMyMergedRange> ScMyMergedRangeList;
130
132{
133private:
135protected:
136 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
137public:
139 virtual ~ScMyMergedRangesContainer() override;
140 void AddRange(const ScRange& rMergedRange);
141
143 virtual void SetCellData( ScMyCell& rMyCell ) override;
144 virtual void Sort() override; // + remove doublets
145 void SkipTable(SCTAB nSkip);
146};
147
149{
150 OUString sFilter;
152 OUString sURL;
153 OUString sSourceStr;
156
158
159 sal_Int32 GetColCount() const { return aDestRange.aEnd.Col() - aDestRange.aStart.Col() + 1; }
160 sal_Int32 GetRowCount() const { return aDestRange.aEnd.Row() - aDestRange.aStart.Row() + 1; }
161
162 bool Compare( const ScMyAreaLink& rAreaLink ) const;
163 bool operator<(const ScMyAreaLink& rAreaLink ) const;
164};
165
166typedef ::std::list< ScMyAreaLink > ScMyAreaLinkList;
167
169{
170private:
172protected:
173 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
174public:
176 virtual ~ScMyAreaLinksContainer() override;
177
178 void AddNewAreaLink( const ScMyAreaLink& rAreaLink )
179 { aAreaLinkList.push_back( rAreaLink ); }
180
182 virtual void SetCellData( ScMyCell& rMyCell ) override;
183 virtual void Sort() override;
184 void SkipTable(SCTAB nSkip);
185};
186
187typedef std::list<ScRange> ScMyEmptyDatabaseRangeList;
188
190{
191private:
193protected:
194 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
195public:
197 virtual ~ScMyEmptyDatabaseRangesContainer() override;
198
203
204 void AddNewEmptyDatabaseRange(const css::table::CellRangeAddress& aCellRangeAddress);
205
207 virtual void SetCellData( ScMyCell& rMyCell ) override;
208 virtual void Sort() override;
209 void SkipTable(SCTAB nSkip);
210};
211
213{
218 bool operator<(const ScMyDetectiveObj& rDetObj) const;
219};
220
221typedef ::std::list< ScMyDetectiveObj > ScMyDetectiveObjList;
222typedef ::std::vector< ScMyDetectiveObj > ScMyDetectiveObjVec;
223
225{
226private:
228protected:
229 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
230public:
232 virtual ~ScMyDetectiveObjContainer() override;
233
234 void AddObject(
235 ScDetectiveObjType eObjType,
236 const SCTAB nSheet,
237 const ScAddress& rPosition,
238 const ScRange& rSourceRange,
239 bool bHasError );
240
242 virtual void SetCellData( ScMyCell& rMyCell ) override;
243 virtual void Sort() override;
244 void SkipTable(SCTAB nSkip);
245};
246
248{
251 sal_Int32 nIndex;
252 bool operator<(const ScMyDetectiveOp& rDetOp) const;
253};
254
255typedef ::std::list< ScMyDetectiveOp > ScMyDetectiveOpList;
256typedef ::std::vector< ScMyDetectiveOp > ScMyDetectiveOpVec;
257
259{
260private:
262protected:
263 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
264public:
266 virtual ~ScMyDetectiveOpContainer() override;
267
268 void AddOperation( ScDetOpType eOpType, const ScAddress& rPosition, sal_uInt32 nIndex );
269
271 virtual void SetCellData( ScMyCell& rMyCell ) override;
272 virtual void Sort() override;
273 void SkipTable(SCTAB nSkip);
274};
275
276// contains data to export for the current cell position
278{
280
284
289
291
293 sal_Int32 nStyleIndex;
294 sal_Int32 nNumberFormat;
295 css::table::CellContentType nType;
296
298
300
308
312
313 ScMyCell();
314};
315
317{
320
321 css::uno::Reference<css::sheet::XSpreadsheet> xTable;
322 css::uno::Reference<css::table::XCellRange> xCellRange;
324
332
334 std::unique_ptr<ScHorizontalCellIterator> mpCellItr;
335
339
340 void UpdateAddress( ScAddress& rAddress );
341 void SetCellData( ScMyCell& rMyCell, const ScAddress& rAddress );
342
343 void HasAnnotation( ScMyCell& aCell );
344public:
347
348 void Clear();
349
351 { pShapes = pNewShapes; }
353 { pNoteShapes = pNewNoteShapes; }
355 { pEmptyDatabaseRanges = pNewEmptyDatabaseRanges; }
357 { pMergedRanges = pNewMergedRanges; }
359 { pAreaLinks = pNewAreaLinks; }
361 { pDetectiveObj = pNewDetectiveObj; }
363 { pDetectiveOp = pNewDetectiveOp; }
364
365 void SetCurrentTable(const SCTAB nTable,
366 const css::uno::Reference<css::sheet::XSpreadsheet>& rxTable);
367 void SkipTable(SCTAB nSkip);
368
369 bool GetNext(ScMyCell& aCell, ScFormatRangeStyles* pCellStyles);
370};
371
372/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::vector< ScMyDetectiveObj > ScMyDetectiveObjVec
::std::list< ScMyDetectiveOp > ScMyDetectiveOpList
std::list< ScMyMergedRange > ScMyMergedRangeList
std::list< ScRange > ScMyEmptyDatabaseRangeList
std::list< ScMyShape > ScMyShapeList
::std::list< ScMyDetectiveObj > ScMyDetectiveObjList
::std::vector< ScMyDetectiveOp > ScMyDetectiveOpVec
::std::list< ScMyAreaLink > ScMyAreaLinkList
std::list< ScMyNoteShape > ScMyNoteShapeList
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
virtual bool GetFirstAddress(ScAddress &rCellAddress) override
virtual void Sort() override
virtual ~ScMyDetectiveObjContainer() override
ScMyDetectiveObjList aDetectiveObjList
void AddObject(ScDetectiveObjType eObjType, const SCTAB nSheet, const ScAddress &rPosition, const ScRange &rSourceRange, bool bHasError)
virtual void SetCellData(ScMyCell &rMyCell) override
void AddOperation(ScDetOpType eOpType, const ScAddress &rPosition, sal_uInt32 nIndex)
virtual void Sort() override
ScMyDetectiveOpList aDetectiveOpList
virtual void SetCellData(ScMyCell &rMyCell) override
virtual ~ScMyDetectiveOpContainer() override
virtual bool GetFirstAddress(ScAddress &rCellAddress) override
void AddNewEmptyDatabaseRange(const css::table::CellRangeAddress &aCellRangeAddress)
ScMyEmptyDatabaseRangesContainer(ScMyEmptyDatabaseRangesContainer const &)=default
virtual bool GetFirstAddress(ScAddress &rCellAddress) override
virtual ~ScMyEmptyDatabaseRangesContainer() override
ScMyEmptyDatabaseRangesContainer(ScMyEmptyDatabaseRangesContainer &&)=default
virtual void SetCellData(ScMyCell &rMyCell) override
ScMyEmptyDatabaseRangesContainer & operator=(ScMyEmptyDatabaseRangesContainer const &)=default
ScMyEmptyDatabaseRangeList aDatabaseList
ScMyIteratorBase(ScMyIteratorBase const &)=default
ScMyIteratorBase(ScMyIteratorBase &&)=default
ScMyIteratorBase & operator=(ScMyIteratorBase const &)=default
virtual bool GetFirstAddress(ScAddress &rCellAddress)=0
virtual void Sort()=0
void UpdateAddress(ScAddress &rCellAddress)
virtual void SetCellData(ScMyCell &rMyCell)=0
virtual bool GetFirstAddress(ScAddress &rCellAddress) override
void AddRange(const ScRange &rMergedRange)
virtual void SetCellData(ScMyCell &rMyCell) override
ScMyMergedRangeList aRangeList
virtual void Sort() override
virtual ~ScMyMergedRangesContainer() override
void SetAreaLinks(ScMyAreaLinksContainer *pNewAreaLinks)
void SetNoteShapes(ScMyNoteShapesContainer *pNewNoteShapes)
ScMyDetectiveObjContainer * pDetectiveObj
void SetCurrentTable(const SCTAB nTable, const css::uno::Reference< css::sheet::XSpreadsheet > &rxTable)
css::uno::Reference< css::sheet::XSpreadsheet > xTable
std::unique_ptr< ScHorizontalCellIterator > mpCellItr
void HasAnnotation(ScMyCell &aCell)
ScMyNoteShapesContainer * pNoteShapes
void SetShapes(ScMyShapesContainer *pNewShapes)
bool GetNext(ScMyCell &aCell, ScFormatRangeStyles *pCellStyles)
ScMyMergedRangesContainer * pMergedRanges
ScMyAreaLinksContainer * pAreaLinks
void SetCellData(ScMyCell &rMyCell, const ScAddress &rAddress)
ScMyShapesContainer * pShapes
void SetMergedRanges(ScMyMergedRangesContainer *pNewMergedRanges)
css::uno::Reference< css::table::XCellRange > xCellRange
ScMyNotEmptyCellsIterator(const ScMyNotEmptyCellsIterator &)=delete
void SetDetectiveOp(ScMyDetectiveOpContainer *pNewDetectiveOp)
ScMyDetectiveOpContainer * pDetectiveOp
void UpdateAddress(ScAddress &rAddress)
void SetDetectiveObj(ScMyDetectiveObjContainer *pNewDetectiveObj)
const ScMyNotEmptyCellsIterator & operator=(const ScMyNotEmptyCellsIterator &)=delete
ScMyEmptyDatabaseRangesContainer * pEmptyDatabaseRanges
void SetEmptyDatabaseRanges(ScMyEmptyDatabaseRangesContainer *pNewEmptyDatabaseRanges)
virtual void Sort() override
void AddNewNote(const ScMyNoteShape &aNote)
virtual bool GetFirstAddress(ScAddress &rCellAddress) override
ScMyNoteShapeList aNoteShapeList
const ScMyNoteShapeList & GetNotes() const
virtual ~ScMyNoteShapesContainer() override
virtual void SetCellData(ScMyCell &rMyCell) override
virtual void Sort() override
virtual void SetCellData(ScMyCell &rMyCell) override
virtual bool GetFirstAddress(ScAddress &rCellAddress) override
const ScMyShapeList & GetShapes() const
void AddNewShape(const ScMyShape &aShape)
virtual ~ScMyShapesContainer() override
void SkipTable(SCTAB nSkip)
Additional class containing cell annotation data.
Definition: postit.hxx:58
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
ScDetOpType
Definition: detdata.hxx:27
ScDetectiveObjType
Definition: detfunc.hxx:39
ScPostIt * pNote
sal_Int32 nStyleIndex
ScRange aMergeRange
sal_Int32 nValidationIndex
ScRefCellValue maBaseCell
ScMyDetectiveObjVec aDetectiveObjVec
ScMyShapeList aShapeList
ScMyAreaLink aAreaLink
ScRange aMatrixRange
ScMyDetectiveOpVec aDetectiveOpVec
css::table::CellContentType nType
sal_Int32 nNumberFormat
ScAddress aCellAddress
Use this instead of the UNO one.
ScAddress maCellAddress
bool operator<(const ScMyDetectiveObj &rDetObj) const
ScDetectiveObjType eObjType
bool operator<(const ScMyDetectiveOp &rDetOp) const
bool operator<(const ScMyMergedRange &aRange) const
bool operator<(const ScMyNoteShape &aNote) const
css::uno::Reference< css::drawing::XShape > xShape
sal_Int32 nEndX
css::uno::Reference< css::drawing::XShape > xShape
ScAddress aEndAddress
sal_Int32 nEndY
ScAddress aAddress
bool operator<(const ScMyShape &aShape) const
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:108
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17