tdf#62032 use style list level when changing style
[LibreOffice.git] / sc / inc / consoli.hxx
blob46b952a3e778565390b26898c1340e7f8de0484d
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include "global.hxx"
23 #include "address.hxx"
24 #include <vector>
26 class ScDocument;
27 class ScFunctionData;
29 // Sequence:
30 // 1) create ScConsData
31 // 2) Parameter (Size/Flags)
32 // 3) AddFields for all areas (only needed for bColByName or bRowByName)
33 // 4) DoneFields ( " " )
34 // 5) AddData for all areas
35 // perhaps AddName after each area
36 // 6) OutputToDocument
38 //! Use structure ScDocument if a certain size is exceeded?
40 class ScConsData
42 private:
43 struct ScReferenceEntry // without constructor !
45 SCCOL nCol;
46 SCROW nRow;
47 SCTAB nTab;
49 typedef std::vector<ScReferenceEntry> ScReferenceList;
50 ScSubTotalFunc eFunction;
51 bool bReference;
52 bool bColByName;
53 bool bRowByName;
54 SCSIZE nColCount;
55 SCSIZE nRowCount;
56 std::unique_ptr<std::unique_ptr<bool[]>[]> ppUsed;
57 std::unique_ptr<std::unique_ptr<ScFunctionData[]>[]> ppFunctionData;
58 std::unique_ptr<std::unique_ptr<ScReferenceList[]>[]> ppRefs;
59 ::std::vector<OUString> maColHeaders;
60 ::std::vector<OUString> maRowHeaders;
61 ::std::vector<OUString> maTitles;
62 SCSIZE nDataCount;
63 std::unique_ptr<std::unique_ptr<SCSIZE[]>[]> ppTitlePos;
64 bool bCornerUsed;
65 OUString aCornerText; // only for bColByName && bRowByName
67 public:
68 ScConsData();
69 ~ScConsData();
71 void SetSize( SCCOL nCols, SCROW nRows );
72 void SetFlags( ScSubTotalFunc eFunc, bool bColName, bool bRowName, bool bRef );
74 void InitData();
75 void DeleteData();
77 void AddFields( const ScDocument* pSrcDoc, SCTAB nTab,
78 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
79 void DoneFields();
81 void AddData( ScDocument* pSrcDoc, SCTAB nTab,
82 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
83 void AddName( const OUString& rName );
85 void OutputToDocument( ScDocument& rDestDoc, SCCOL nCol, SCROW nRow, SCTAB nTab );
87 void GetSize( SCCOL& rCols, SCROW& rRows ) const;
88 SCROW GetInsertCount() const;
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */