LibreOffice Module sc (master)  1
XMLExportSharedData.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 <address.hxx>
23 #include <com/sun/star/uno/Reference.hxx>
24 
25 #include <vector>
26 #include <list>
27 #include <memory>
28 
29 namespace com::sun::star::drawing { class XDrawPage; }
30 namespace com::sun::star::drawing { class XShape; }
31 
33 {
34  css::uno::Reference<css::drawing::XDrawPage> xDrawPage;
35  bool bHasForms;
36 
37  ScMyDrawPage() : bHasForms(false) {}
38 };
39 
40 typedef std::list< css::uno::Reference<css::drawing::XShape> > ScMyTableXShapes;
41 typedef std::vector<ScMyTableXShapes> ScMyTableShapes;
42 typedef std::vector<ScMyDrawPage> ScMyDrawPages;
43 
46 struct ScMyShape;
48 
50 {
51  std::vector<sal_Int32> nLastColumns;
52  std::vector<sal_Int32> nLastRows;
53  std::unique_ptr<ScMyTableShapes> pTableShapes;
54  std::unique_ptr<ScMyDrawPages> pDrawPages;
55  std::unique_ptr<ScMyShapesContainer> pShapesContainer;
56  std::unique_ptr<ScMyDetectiveObjContainer> pDetectiveObjContainer;
57  std::unique_ptr<ScMyNoteShapesContainer> pNoteShapes;
58  sal_Int32 nTableCount;
59 public:
60  explicit ScMySharedData(const sal_Int32 nTableCount);
62 
63  void SetLastColumn(const sal_Int32 nTable, const sal_Int32 nCol);
64  void SetLastRow(const sal_Int32 nTable, const sal_Int32 nRow);
65  sal_Int32 GetLastColumn(const sal_Int32 nTable) const;
66  sal_Int32 GetLastRow(const sal_Int32 nTable) const;
67  void AddDrawPage(const ScMyDrawPage& aDrawPage, const sal_Int32 nTable);
68  void SetDrawPageHasForms(const sal_Int32 nTable, bool bHasForms);
69  css::uno::Reference<css::drawing::XDrawPage> GetDrawPage(const sal_Int32 nTable);
70  bool HasDrawPage() const { return pDrawPages != nullptr; }
71  bool HasForm(const sal_Int32 nTable, css::uno::Reference<css::drawing::XDrawPage>& xDrawPage);
72  void AddNewShape(const ScMyShape& aMyShape);
73  void SortShapesContainer();
74  ScMyShapesContainer* GetShapesContainer() { return pShapesContainer.get(); }
75  bool HasShapes() const;
76  void AddTableShape(const sal_Int32 nTable, const css::uno::Reference<css::drawing::XShape>& xShape);
77  ScMyTableShapes* GetTableShapes() { return pTableShapes.get(); }
78  ScMyDetectiveObjContainer* GetDetectiveObjContainer() { return pDetectiveObjContainer.get(); }
79  void AddNoteObj(const css::uno::Reference<css::drawing::XShape>& xShape, const ScAddress& rPos);
80  void SortNoteShapes();
81  ScMyNoteShapesContainer* GetNoteShapes() { return pNoteShapes.get(); }
82 };
83 
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScMyNoteShapesContainer * GetNoteShapes()
ScMyShapesContainer * GetShapesContainer()
std::vector< sal_Int32 > nLastRows
void AddNewShape(const ScMyShape &aMyShape)
bool HasShapes() const
void SetDrawPageHasForms(const sal_Int32 nTable, bool bHasForms)
css::uno::Reference< css::drawing::XDrawPage > xDrawPage
void AddTableShape(const sal_Int32 nTable, const css::uno::Reference< css::drawing::XShape > &xShape)
bool HasForm(const sal_Int32 nTable, css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
std::unique_ptr< ScMyDetectiveObjContainer > pDetectiveObjContainer
ScMySharedData(const sal_Int32 nTableCount)
std::vector< sal_Int32 > nLastColumns
void AddDrawPage(const ScMyDrawPage &aDrawPage, const sal_Int32 nTable)
std::unique_ptr< ScMyShapesContainer > pShapesContainer
std::unique_ptr< ScMyTableShapes > pTableShapes
css::uno::Reference< css::drawing::XDrawPage > GetDrawPage(const sal_Int32 nTable)
std::vector< ScMyDrawPage > ScMyDrawPages
sal_Int32 GetLastColumn(const sal_Int32 nTable) const
std::unique_ptr< ScMyDrawPages > pDrawPages
sal_Int32 GetLastRow(const sal_Int32 nTable) const
void SetLastRow(const sal_Int32 nTable, const sal_Int32 nRow)
void SetLastColumn(const sal_Int32 nTable, const sal_Int32 nCol)
std::vector< ScMyTableXShapes > ScMyTableShapes
std::unique_ptr< ScMyNoteShapesContainer > pNoteShapes
void AddNoteObj(const css::uno::Reference< css::drawing::XShape > &xShape, const ScAddress &rPos)
std::list< css::uno::Reference< css::drawing::XShape > > ScMyTableXShapes
ScMyTableShapes * GetTableShapes()
bool HasDrawPage() const
ScMyDetectiveObjContainer * GetDetectiveObjContainer()