merged tag ooo/OOO330_m14
[LibreOffice.git] / sc / source / filter / inc / excimp8.hxx
blob7e4cca15dfe157a953e01d847ba465440a362956
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SC_EXCIMP8_HXX
29 #define SC_EXCIMP8_HXX
31 #include <string.h>
32 #include "imp_op.hxx"
33 #include "root.hxx"
34 #include "excscen.hxx"
35 #include "excdefs.hxx"
36 #include "ftools.hxx"
37 #include "queryparam.hxx"
39 class SotStorage;
41 class ScBaseCell;
42 class ScRangeList;
43 class ScDBData;
45 class ScfSimpleProgressBar;
47 class XclImpStream;
51 class ImportExcel8 : public ImportExcel
53 public:
54 ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm );
55 virtual ~ImportExcel8( void );
57 virtual FltError Read( void );
59 protected:
60 ExcScenarioList aScenList;
62 void Calccount( void ); // 0x0C
63 void Precision( void ); // 0x0E
64 void Delta( void ); // 0x10
65 void Iteration( void ); // 0x11
66 void Boundsheet( void ); // 0x85
67 void FilterMode( void ); // 0x9B
68 void AutoFilterInfo( void ); // 0x9D
69 void AutoFilter( void ); // 0x9E
70 void Scenman( void ); // 0xAE
71 void Scenario( void ); // 0xAF
72 void ReadBasic( void ); // 0xD3
73 void Labelsst( void ); // 0xFD
75 void Hlink( void ); // 0x01B8
76 void Codename( BOOL bWBGlobals ); // 0x01BA
77 void SheetProtection( void ); // 0x0867
79 virtual void EndSheet( void );
80 virtual void PostDocLoad( void );
82 private:
83 void LoadDocumentProperties();
88 //___________________________________________________________________
89 // classes AutoFilterData, AutoFilterBuffer
91 class XclImpAutoFilterData : private ExcRoot
93 private:
94 ScDBData* pCurrDBData;
95 ScQueryParam aParam;
96 SCSIZE nFirstEmpty;
97 BOOL bActive;
98 BOOL bHasConflict;
99 BOOL bCriteria;
100 BOOL bAutoOrAdvanced;
101 ScRange aCriteriaRange;
102 String aFilterName;
104 void CreateFromDouble( String& rStr, double fVal );
105 void SetCellAttribs();
106 void InsertQueryParam();
107 void AmendAFName(const BOOL bUseUnNamed);
109 protected:
110 public:
111 XclImpAutoFilterData(
112 RootData* pRoot,
113 const ScRange& rRange,
114 const String& rName );
116 inline bool IsActive() const { return bActive; }
117 inline bool IsFiltered() const { return bAutoOrAdvanced; }
118 inline SCTAB Tab() const { return aParam.nTab; }
119 inline SCCOL StartCol() const { return aParam.nCol1; }
120 inline SCROW StartRow() const { return aParam.nRow1; }
121 inline SCCOL EndCol() const { return aParam.nCol2; }
122 inline SCROW EndRow() const { return aParam.nRow2; }
124 void ReadAutoFilter( XclImpStream& rStrm );
126 inline void Activate() { bActive = TRUE; }
127 void SetAdvancedRange( const ScRange* pRange );
128 void SetExtractPos( const ScAddress& rAddr );
129 inline void SetAutoOrAdvanced() { bAutoOrAdvanced = TRUE; }
130 void Apply( const BOOL bUseUnNamed = FALSE );
131 void CreateScDBData( const BOOL bUseUnNamed );
132 void EnableRemoveFilter();
136 class XclImpAutoFilterBuffer : private List
138 private:
139 using List::Insert;
141 UINT16 nAFActiveCount;
143 inline XclImpAutoFilterData* _First() { return (XclImpAutoFilterData*) List::First(); }
144 inline XclImpAutoFilterData* _Next() { return (XclImpAutoFilterData*) List::Next(); }
146 inline void Append( XclImpAutoFilterData* pData )
147 { List::Insert( pData, LIST_APPEND ); }
148 protected:
149 public:
150 XclImpAutoFilterBuffer();
151 virtual ~XclImpAutoFilterBuffer();
153 void Insert( RootData* pRoot, const ScRange& rRange,
154 const String& rName );
155 void AddAdvancedRange( const ScRange& rRange );
156 void AddExtractPos( const ScRange& rRange );
157 void Apply();
159 XclImpAutoFilterData* GetByTab( SCTAB nTab );
160 inline void IncrementActiveAF() { nAFActiveCount++; }
161 inline BOOL UseUnNamed() { return nAFActiveCount == 1; }
164 #endif