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: scextopt.hxx,v $
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 ************************************************************************/
43 // ACHTUNG1: einzelne Einstellungen sollten stimmen
44 // -> Absicherung nur ueber Assertions
45 // ACHTUNG2: Plausibilitaet der Einstellungen untereinander ist nicht
48 struct ScExtTabOptions
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
62 ScRange aDim
; // original Excel size
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
86 inline CodenameList( void );
87 CodenameList( const CodenameList
& );
88 virtual ~CodenameList();
90 inline void Append( const String
& );
101 ScExtTabOptions
** ppExtTabOpts
;
104 CodenameList
* pCodenames
;
106 BOOL bChanged
; // for import: copy data only first time to doc
107 bool bWinProtection
; // Excel Workbook Windows protection flag
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 %
118 UINT16 nCurCol
; // aktuelle Cursor-Position
120 // -------------------------------------------------------------------
121 ScExtDocOptions( void );
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;
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
;
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
;
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
221 inline CodenameList
* ScExtDocOptions::GetCodenames( void )
227 } //namespace binfilter