Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sc / scextopt.hxx
blob7b88bdbfdceabc961932d02958eb6c5a9839e2c0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: scextopt.hxx,v $
10 * $Revision: 1.6 $
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 _SCEXTOPT_HXX
32 #define _SCEXTOPT_HXX
35 #ifndef SC_SCGLOB_HXX
36 #include "global.hxx"
37 #endif
38 namespace binfilter {
43 // ACHTUNG1: einzelne Einstellungen sollten stimmen
44 // -> Absicherung nur ueber Assertions
45 // ACHTUNG2: Plausibilitaet der Einstellungen untereinander ist nicht
46 // gewaehrleistet
48 struct ScExtTabOptions
50 // Split -Info
51 UINT16 nTabNum;
52 UINT16 nSplitX; // horiz. pos. in twips, 0 = no split
53 UINT16 nSplitY; // vert. pos. ~
54 UINT16 nLeftCol; // leftmost column visible
55 UINT16 nTopRow; // topmost row visible
56 UINT16 nLeftSplitCol; // leftmost column after horizontal split
57 UINT16 nTopSplitRow; // topmost row after vertical split
58 UINT16 nActPane; // 0: br, 1: tr, 2: bl, 3: tl
60 ScRange aLastSel; // last selection
61 BOOL bValidSel;
62 ScRange aDim; // original Excel size
63 BOOL bValidDim;
65 BOOL bSelected;
66 BOOL bFrozen; // = TRUE -> nSplitX / nSplitY contain
67 // count of visible columns/rows
69 inline ScExtTabOptions( void );
70 inline ScExtTabOptions( const ScExtTabOptions& rCpy );
71 inline void operator =( const ScExtTabOptions& rCpy );
73 void SetSelection( const ScRange& rSelection );
74 void SetDimension( const ScRange& rDim );
80 class CodenameList : protected List
82 // Code: colrowst.cxx
83 private:
84 protected:
85 public:
86 inline CodenameList( void );
87 CodenameList( const CodenameList& );
88 virtual ~CodenameList();
90 inline void Append( const String& );
96 class ScExtDocOptions
98 // Code: colrowst.cxx
99 private:
100 // Window -Info
101 ScExtTabOptions** ppExtTabOpts;
103 String* pCodenameWB;
104 CodenameList* pCodenames;
106 BOOL bChanged; // for import: copy data only first time to doc
107 bool bWinProtection; // Excel Workbook Windows protection flag
109 public:
110 UINT32 nLinkCnt; // Zaehlt die Rekursionstufe beim Laden
111 // von externen Dokumenten
112 UINT16 nActTab; // aktuelle Tabelle
113 ScRange* pOleSize; // visible range if embedded
114 UINT16 nSelTabs; // count of selected sheets
115 Color* pGridCol; // Farbe Grid und Row-/Col-Heading
116 UINT16 nZoom; // in %
117 // Cursor
118 UINT16 nCurCol; // aktuelle Cursor-Position
119 UINT16 nCurRow;
120 // -------------------------------------------------------------------
121 ScExtDocOptions( void );
122 ~ScExtDocOptions();
124 inline const ScExtTabOptions* GetExtTabOptions( const UINT16 nTabNum ) const;
125 inline ScExtTabOptions* GetExtTabOptions( const UINT16 nTabNum );
126 inline const String* GetCodename( void ) const; // for Workbook globals
127 inline CodenameList* GetCodenames( void ); // for tables
129 inline void SetWinProtection(bool bImportWinProtection) {bWinProtection = bImportWinProtection; }
130 inline bool IsWinProtected() { return bWinProtection; }
136 inline CodenameList::CodenameList( void )
141 inline void CodenameList::Append( const String& r )
143 List::Insert( new String( r ), LIST_APPEND );
155 inline ScExtTabOptions::ScExtTabOptions( void )
157 nTabNum = nSplitX = nSplitY = nLeftCol = nTopRow = nLeftSplitCol = nTopSplitRow = 0;
158 nActPane = 3;
159 bSelected = bFrozen = bValidSel = bValidDim = FALSE;
163 inline ScExtTabOptions::ScExtTabOptions( const ScExtTabOptions& rCpy )
165 nTabNum = rCpy.nTabNum;
166 nSplitX = rCpy.nSplitX;
167 nSplitY = rCpy.nSplitY;
168 nLeftCol = rCpy.nLeftCol;
169 nTopRow = rCpy.nTopRow;
170 nLeftSplitCol = rCpy.nLeftSplitCol;
171 nTopSplitRow = rCpy.nTopSplitRow;
172 nActPane = rCpy.nActPane;
173 aLastSel = rCpy.aLastSel;
174 aDim = rCpy.aDim;
175 bSelected = rCpy.bSelected;
176 bFrozen = rCpy.bFrozen;
177 bValidSel = rCpy.bValidSel;
178 bValidDim = rCpy.bValidDim;
182 inline void ScExtTabOptions::operator =( const ScExtTabOptions& rCpy )
184 nTabNum = rCpy.nTabNum;
185 nSplitX = rCpy.nSplitX;
186 nSplitY = rCpy.nSplitY;
187 nLeftCol = rCpy.nLeftCol;
188 nTopRow = rCpy.nTopRow;
189 nLeftSplitCol = rCpy.nLeftSplitCol;
190 nTopSplitRow = rCpy.nTopSplitRow;
191 nActPane = rCpy.nActPane;
192 aLastSel = rCpy.aLastSel;
193 aDim = rCpy.aDim;
194 bSelected = rCpy.bSelected;
195 bFrozen = rCpy.bFrozen;
196 bValidSel = rCpy.bValidSel;
197 bValidDim = rCpy.bValidDim;
203 inline const ScExtTabOptions* ScExtDocOptions::GetExtTabOptions( const UINT16 nTab ) const
205 return (nTab <= MAXTAB) ? ppExtTabOpts[ nTab ] : NULL;
209 inline ScExtTabOptions* ScExtDocOptions::GetExtTabOptions( const UINT16 nTab )
211 return (nTab <= MAXTAB) ? ppExtTabOpts[ nTab ] : NULL;
215 inline const String* ScExtDocOptions::GetCodename( void ) const
217 return pCodenameWB;
221 inline CodenameList* ScExtDocOptions::GetCodenames( void )
223 return pCodenames;
227 } //namespace binfilter
228 #endif