merge the formfield patch from ooo-build
[ooovba.git] / sc / source / filter / inc / excimp8.hxx
blob8a5471184ee133e39b51dcf4c1d87671013e882f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: excimp8.hxx,v $
10 * $Revision: 1.71.14.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_EXCIMP8_HXX
32 #define SC_EXCIMP8_HXX
34 #include <string.h>
35 #include "imp_op.hxx"
36 #include "root.hxx"
37 #include "excscen.hxx"
38 #include "excdefs.hxx"
39 #include "ftools.hxx"
40 #include "queryparam.hxx"
42 class SotStorage;
44 class ScBaseCell;
45 class ScRangeList;
46 class ScDBData;
48 class ScfSimpleProgressBar;
50 class XclImpStream;
54 class ImportExcel8 : public ImportExcel
56 SCTAB mnTab;
57 protected:
58 // represents codename ( and associated modules )
59 // not speficied directly in the binary format
60 std::vector< String > AutoGeneratedCodeNames;
61 ExcScenarioList aScenList;
63 BOOL bHasBasic;
65 void Calccount( void ); // 0x0C
66 void Precision( void ); // 0x0E
67 void Delta( void ); // 0x10
68 void Iteration( void ); // 0x11
69 void Boundsheet( void ); // 0x85
70 void FilterMode( void ); // 0x9B
71 void AutoFilterInfo( void ); // 0x9D
72 void AutoFilter( void ); // 0x9E
73 void Scenman( void ); // 0xAE
74 void Scenario( void ); // 0xAF
75 void ReadBasic( void ); // 0xD3
76 void Labelsst( void ); // 0xFD
78 void Hlink( void ); // 0x01B8
79 void Codename( BOOL bWBGlobals ); // 0x01BA
80 void SheetProtection( void ); // 0x0867
82 virtual void EndSheet( void );
83 virtual void PostDocLoad( void );
85 public:
86 ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm );
87 virtual ~ImportExcel8( void );
89 virtual FltError Read( void );
94 //___________________________________________________________________
95 // classes AutoFilterData, AutoFilterBuffer
97 class XclImpAutoFilterData : private ExcRoot
99 private:
100 ScDBData* pCurrDBData;
101 ScQueryParam aParam;
102 SCSIZE nFirstEmpty;
103 BOOL bActive;
104 BOOL bHasConflict;
105 BOOL bCriteria;
106 BOOL bAutoOrAdvanced;
107 ScRange aCriteriaRange;
108 String aFilterName;
110 void CreateFromDouble( String& rStr, double fVal );
111 void SetCellAttribs();
112 void InsertQueryParam();
113 void AmendAFName(const BOOL bUseUnNamed);
115 protected:
116 public:
117 XclImpAutoFilterData(
118 RootData* pRoot,
119 const ScRange& rRange,
120 const String& rName );
122 inline bool IsActive() const { return bActive; }
123 inline bool IsFiltered() const { return bAutoOrAdvanced; }
124 inline SCTAB Tab() const { return aParam.nTab; }
125 inline SCCOL StartCol() const { return aParam.nCol1; }
126 inline SCROW StartRow() const { return aParam.nRow1; }
127 inline SCCOL EndCol() const { return aParam.nCol2; }
128 inline SCROW EndRow() const { return aParam.nRow2; }
130 void ReadAutoFilter( XclImpStream& rStrm );
132 inline void Activate() { bActive = TRUE; }
133 void SetAdvancedRange( const ScRange* pRange );
134 void SetExtractPos( const ScAddress& rAddr );
135 inline void SetAutoOrAdvanced() { bAutoOrAdvanced = TRUE; }
136 void Apply( const BOOL bUseUnNamed = FALSE );
137 void CreateScDBData( const BOOL bUseUnNamed );
138 void EnableRemoveFilter();
142 class XclImpAutoFilterBuffer : private List
144 private:
145 using List::Insert;
147 UINT16 nAFActiveCount;
149 inline XclImpAutoFilterData* _First() { return (XclImpAutoFilterData*) List::First(); }
150 inline XclImpAutoFilterData* _Next() { return (XclImpAutoFilterData*) List::Next(); }
152 inline void Append( XclImpAutoFilterData* pData )
153 { List::Insert( pData, LIST_APPEND ); }
154 protected:
155 public:
156 XclImpAutoFilterBuffer();
157 virtual ~XclImpAutoFilterBuffer();
159 void Insert( RootData* pRoot, const ScRange& rRange,
160 const String& rName );
161 void AddAdvancedRange( const ScRange& rRange );
162 void AddExtractPos( const ScRange& rRange );
163 void Apply();
165 XclImpAutoFilterData* GetByTab( SCTAB nTab );
166 inline void IncrementActiveAF() { nAFActiveCount++; }
167 inline BOOL UseUnNamed() { return nAFActiveCount == 1; }
170 #endif