Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / filter / inc / excimp8.hxx
blobdc01c5ebcf865fb84c8b75c8a7e2c1de305fe770
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 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_EXCIMP8_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_EXCIMP8_HXX
23 #include <string.h>
25 #include "imp_op.hxx"
26 #include "root.hxx"
27 #include "excscen.hxx"
28 #include "excdefs.hxx"
29 #include "ftools.hxx"
30 #include "queryparam.hxx"
32 class ScDBData;
33 class XclImpStream;
35 class ImportExcel8 : public ImportExcel
37 public:
38 ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm );
39 virtual ~ImportExcel8();
41 virtual FltError Read() override;
43 void Calccount(); // 0x0C
44 void Precision(); // 0x0E
45 void Delta(); // 0x10
46 void Iteration(); // 0x11
47 void Boundsheet(); // 0x85
48 void FilterMode(); // 0x9B
49 void AutoFilterInfo(); // 0x9D
50 void AutoFilter(); // 0x9E
51 void Scenman(); // 0xAE
52 void Scenario(); // 0xAF
53 void ReadBasic(); // 0xD3
54 void Labelsst(); // 0xFD
56 void FeatHdr(); // 0x0867
57 void Feat(); // 0x0868
59 virtual void EndSheet() override;
60 virtual void PostDocLoad() override;
62 private:
63 void LoadDocumentProperties();
65 private:
66 // represents codename ( and associated modules )
67 // not speficied directly in the binary format
68 std::vector<OUString> maAutoGeneratedCodeNames;
69 ExcScenarioList maScenList;
72 // classes AutoFilterData, AutoFilterBuffer
74 class XclImpAutoFilterData : private ExcRoot
76 private:
77 ScDBData* pCurrDBData;
78 ScQueryParam aParam;
79 ScRange aCriteriaRange;
80 bool bActive:1;
81 bool bCriteria:1;
82 bool bAutoOrAdvanced:1;
84 void SetCellAttribs();
85 void InsertQueryParam();
87 protected:
88 public:
89 XclImpAutoFilterData(
90 RootData* pRoot,
91 const ScRange& rRange);
93 inline bool IsActive() const { return bActive; }
94 inline bool IsFiltered() const { return bAutoOrAdvanced; }
95 inline SCTAB Tab() const { return aParam.nTab; }
96 inline SCCOL StartCol() const { return aParam.nCol1; }
97 inline SCROW StartRow() const { return aParam.nRow1; }
98 inline SCCOL EndCol() const { return aParam.nCol2; }
99 inline SCROW EndRow() const { return aParam.nRow2; }
101 void ReadAutoFilter( XclImpStream& rStrm, svl::SharedStringPool& rPool );
103 inline void Activate() { bActive = true; }
104 void SetAdvancedRange( const ScRange* pRange );
105 void SetExtractPos( const ScAddress& rAddr );
106 inline void SetAutoOrAdvanced() { bAutoOrAdvanced = true; }
107 void Apply();
108 void CreateScDBData();
109 void EnableRemoveFilter();
112 class XclImpAutoFilterBuffer
114 public:
116 void Insert( RootData* pRoot, const ScRange& rRange);
117 void AddAdvancedRange( const ScRange& rRange );
118 void AddExtractPos( const ScRange& rRange );
119 void Apply();
121 XclImpAutoFilterData* GetByTab( SCTAB nTab );
123 private:
124 typedef std::shared_ptr<XclImpAutoFilterData> XclImpAutoFilterSharePtr;
125 std::vector<XclImpAutoFilterSharePtr> maFilters;
128 #endif
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */