Line data Source code
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 : #ifndef INCLUDED_SC_SOURCE_FILTER_INC_EXCIMP8_HXX
21 : #define INCLUDED_SC_SOURCE_FILTER_INC_EXCIMP8_HXX
22 :
23 : #include <string.h>
24 :
25 : #include <boost/ptr_container/ptr_vector.hpp>
26 :
27 : #include "imp_op.hxx"
28 : #include "root.hxx"
29 : #include "excscen.hxx"
30 : #include "excdefs.hxx"
31 : #include "ftools.hxx"
32 : #include "queryparam.hxx"
33 :
34 : class ScDBData;
35 : class XclImpStream;
36 :
37 : class ImportExcel8 : public ImportExcel
38 : {
39 : public:
40 : ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm );
41 : virtual ~ImportExcel8( void );
42 :
43 : virtual FltError Read( void ) SAL_OVERRIDE;
44 :
45 : void Calccount( void ); // 0x0C
46 : void Precision( void ); // 0x0E
47 : void Delta( void ); // 0x10
48 : void Iteration( void ); // 0x11
49 : void Boundsheet( void ); // 0x85
50 : void FilterMode( void ); // 0x9B
51 : void AutoFilterInfo( void ); // 0x9D
52 : void AutoFilter( void ); // 0x9E
53 : void Scenman( void ); // 0xAE
54 : void Scenario( void ); // 0xAF
55 : void ReadBasic( void ); // 0xD3
56 : void Labelsst( void ); // 0xFD
57 :
58 : void Hlink( void ); // 0x01B8
59 : void FeatHdr( void ); // 0x0867
60 : void Feat( void ); // 0x0868
61 :
62 : virtual void EndSheet( void ) SAL_OVERRIDE;
63 : virtual void PostDocLoad( void ) SAL_OVERRIDE;
64 :
65 : private:
66 : void LoadDocumentProperties();
67 :
68 : private:
69 : // represents codename ( and associated modules )
70 : // not speficied directly in the binary format
71 : std::vector<OUString> maAutoGeneratedCodeNames;
72 : ExcScenarioList maScenList;
73 : };
74 :
75 : // classes AutoFilterData, AutoFilterBuffer
76 :
77 52 : class XclImpAutoFilterData : private ExcRoot
78 : {
79 : private:
80 : ScDBData* pCurrDBData;
81 : ScQueryParam aParam;
82 : ScRange aCriteriaRange;
83 : bool bActive:1;
84 : bool bCriteria:1;
85 : bool bAutoOrAdvanced:1;
86 :
87 : void SetCellAttribs();
88 : void InsertQueryParam();
89 :
90 : protected:
91 : public:
92 : XclImpAutoFilterData(
93 : RootData* pRoot,
94 : const ScRange& rRange);
95 :
96 52 : inline bool IsActive() const { return bActive; }
97 16 : inline bool IsFiltered() const { return bAutoOrAdvanced; }
98 654 : inline SCTAB Tab() const { return aParam.nTab; }
99 42 : inline SCCOL StartCol() const { return aParam.nCol1; }
100 122 : inline SCROW StartRow() const { return aParam.nRow1; }
101 80 : inline SCCOL EndCol() const { return aParam.nCol2; }
102 26 : inline SCROW EndRow() const { return aParam.nRow2; }
103 :
104 : void ReadAutoFilter( XclImpStream& rStrm, svl::SharedStringPool& rPool );
105 :
106 16 : inline void Activate() { bActive = true; }
107 : void SetAdvancedRange( const ScRange* pRange );
108 : void SetExtractPos( const ScAddress& rAddr );
109 10 : inline void SetAutoOrAdvanced() { bAutoOrAdvanced = true; }
110 : void Apply();
111 : void CreateScDBData();
112 : void EnableRemoveFilter();
113 : };
114 :
115 284 : class XclImpAutoFilterBuffer
116 : {
117 : public:
118 :
119 : void Insert( RootData* pRoot, const ScRange& rRange);
120 : void AddAdvancedRange( const ScRange& rRange );
121 : void AddExtractPos( const ScRange& rRange );
122 : void Apply();
123 :
124 : XclImpAutoFilterData* GetByTab( SCTAB nTab );
125 :
126 : private:
127 :
128 : boost::ptr_vector<XclImpAutoFilterData> maFilters;
129 : };
130 :
131 : #endif
132 :
133 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|