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;
69 css::uno::Reference<css::drawing::XShape> xShape;
70
71 bool operator<(const ScMyShape& aShape) const;
72};
73
74typedef std::list<ScMyShape> ScMyShapeList;
75
77{
78private:
80protected:
81 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
82public:
84 virtual ~ScMyShapesContainer() override;
85
87 void AddNewShape(const ScMyShape& aShape);
88 bool HasShapes() const { return !aShapeList.empty(); }
89 const ScMyShapeList& GetShapes() const { return aShapeList; }
90 virtual void SetCellData( ScMyCell& rMyCell ) override;
91 virtual void Sort() override;
92 void SkipTable(SCTAB nSkip);
93};
94
96{
97 css::uno::Reference<css::drawing::XShape> xShape;
99
100 bool operator<(const ScMyNoteShape& aNote) const;
101};
102
103typedef std::list<ScMyNoteShape> ScMyNoteShapeList;
104
106{
107private:
109protected:
110 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
111public:
113 virtual ~ScMyNoteShapesContainer() override;
114
116 void AddNewNote(const ScMyNoteShape& aNote);
117 const ScMyNoteShapeList& GetNotes() const { return aNoteShapeList; }
118 virtual void SetCellData( ScMyCell& rMyCell ) override;
119 virtual void Sort() override;
120 void SkipTable(SCTAB nSkip);
121};
122
124{
126 sal_Int32 nRows;
128 bool operator<(const ScMyMergedRange& aRange) const;
129};
130
131typedef std::list<ScMyMergedRange> ScMyMergedRangeList;
132
134{
135private:
137protected:
138 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
139public:
141 virtual ~ScMyMergedRangesContainer() override;
142 void AddRange(const ScRange& rMergedRange);
143
145 virtual void SetCellData( ScMyCell& rMyCell ) override;
146 virtual void Sort() override; // + remove doublets
147 void SkipTable(SCTAB nSkip);
148};
149
151{
152 OUString sFilter;
154 OUString sURL;
155 OUString sSourceStr;
158
160
161 sal_Int32 GetColCount() const { return aDestRange.aEnd.Col() - aDestRange.aStart.Col() + 1; }
162 sal_Int32 GetRowCount() const { return aDestRange.aEnd.Row() - aDestRange.aStart.Row() + 1; }
163
164 bool Compare( const ScMyAreaLink& rAreaLink ) const;
165 bool operator<(const ScMyAreaLink& rAreaLink ) const;
166};
167
168typedef ::std::list< ScMyAreaLink > ScMyAreaLinkList;
169
171{
172private:
174protected:
175 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
176public:
178 virtual ~ScMyAreaLinksContainer() override;
179
180 void AddNewAreaLink( const ScMyAreaLink& rAreaLink )
181 { aAreaLinkList.push_back( rAreaLink ); }
182
184 virtual void SetCellData( ScMyCell& rMyCell ) override;
185 virtual void Sort() override;
186 void SkipTable(SCTAB nSkip);
187};
188
189typedef std::list<ScRange> ScMyEmptyDatabaseRangeList;
190
192{
193private:
195protected:
196 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
197public:
199 virtual ~ScMyEmptyDatabaseRangesContainer() override;
200
205
206 void AddNewEmptyDatabaseRange(const css::table::CellRangeAddress& aCellRangeAddress);
207
209 virtual void SetCellData( ScMyCell& rMyCell ) override;
210 virtual void Sort() override;
211 void SkipTable(SCTAB nSkip);
212};
213
215{
220 bool operator<(const ScMyDetectiveObj& rDetObj) const;
221};
222
223typedef ::std::list< ScMyDetectiveObj > ScMyDetectiveObjList;
224typedef ::std::vector< ScMyDetectiveObj > ScMyDetectiveObjVec;
225
227{
228private:
230protected:
231 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
232public:
234 virtual ~ScMyDetectiveObjContainer() override;
235
236 void AddObject(
237 ScDetectiveObjType eObjType,
238 const SCTAB nSheet,
239 const ScAddress& rPosition,
240 const ScRange& rSourceRange,
241 bool bHasError );
242
244 virtual void SetCellData( ScMyCell& rMyCell ) override;
245 virtual void Sort() override;
246 void SkipTable(SCTAB nSkip);
247};
248
250{
253 sal_Int32 nIndex;
254 bool operator<(const ScMyDetectiveOp& rDetOp) const;
255};
256
257typedef ::std::list< ScMyDetectiveOp > ScMyDetectiveOpList;
258typedef ::std::vector< ScMyDetectiveOp > ScMyDetectiveOpVec;
259
261{
262private:
264protected:
265 virtual bool GetFirstAddress( ScAddress& rCellAddress ) override;
266public:
268 virtual ~ScMyDetectiveOpContainer() override;
269
270 void AddOperation( ScDetOpType eOpType, const ScAddress& rPosition, sal_uInt32 nIndex );
271
273 virtual void SetCellData( ScMyCell& rMyCell ) override;
274 virtual void Sort() override;
275 void SkipTable(SCTAB nSkip);
276};
277
278// contains data to export for the current cell position
280{
282
286
291
293
295 sal_Int32 nStyleIndex;
296 sal_Int32 nNumberFormat;
297 css::table::CellContentType nType;
298
300
302
310
314
315 ScMyCell();
316};
317
319{
322
323 css::uno::Reference<css::sheet::XSpreadsheet> xTable;
324 css::uno::Reference<css::table::XCellRange> xCellRange;
326
334
336 std::unique_ptr<ScHorizontalCellIterator> mpCellItr;
337
341
342 void UpdateAddress( ScAddress& rAddress );
343 void SetCellData( ScMyCell& rMyCell, const ScAddress& rAddress );
344
345 void HasAnnotation( ScMyCell& aCell );
346public:
349
350 void Clear();
351
353 { pShapes = pNewShapes; }
355 { pNoteShapes = pNewNoteShapes; }
357 { pEmptyDatabaseRanges = pNewEmptyDatabaseRanges; }
359 { pMergedRanges = pNewMergedRanges; }
361 { pAreaLinks = pNewAreaLinks; }
363 { pDetectiveObj = pNewDetectiveObj; }
365 { pDetectiveOp = pNewDetectiveOp; }
366
367 void SetCurrentTable(const SCTAB nTable,
368 const css::uno::Reference<css::sheet::XSpreadsheet>& rxTable);
369 void SkipTable(SCTAB nSkip);
370
371 bool GetNext(ScMyCell& aCell, ScFormatRangeStyles* pCellStyles);
372};
373
374/* 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