1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef SC_SCEXTOPT_HXX 28*cdf0e10cSrcweir #define SC_SCEXTOPT_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <memory> 31*cdf0e10cSrcweir #include <tools/gen.hxx> 32*cdf0e10cSrcweir #include <tools/color.hxx> 33*cdf0e10cSrcweir #include "global.hxx" 34*cdf0e10cSrcweir #include "rangelst.hxx" 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir // ============================================================================ 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir /** Extended settings for the document, used in import/export filters. */ 39*cdf0e10cSrcweir struct ScExtDocSettings 40*cdf0e10cSrcweir { 41*cdf0e10cSrcweir String maGlobCodeName; /// Global codename (VBA module name). 42*cdf0e10cSrcweir double mfTabBarWidth; /// Width of the tabbar, relative to frame window width (0.0 ... 1.0). 43*cdf0e10cSrcweir sal_uInt32 mnLinkCnt; /// Recursive counter for loading external documents. 44*cdf0e10cSrcweir SCTAB mnDisplTab; /// Index of displayed sheet. 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir explicit ScExtDocSettings(); 47*cdf0e10cSrcweir }; 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir // ============================================================================ 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir /** Enumerates possible positions of panes in split sheets. */ 52*cdf0e10cSrcweir enum ScExtPanePos 53*cdf0e10cSrcweir { 54*cdf0e10cSrcweir SCEXT_PANE_TOPLEFT, /// Single, top, left, or top-left pane. 55*cdf0e10cSrcweir SCEXT_PANE_TOPRIGHT, /// Right, or top-right pane. 56*cdf0e10cSrcweir SCEXT_PANE_BOTTOMLEFT, /// Bottom, or bottom-left pane. 57*cdf0e10cSrcweir SCEXT_PANE_BOTTOMRIGHT /// Bottom-right pane. 58*cdf0e10cSrcweir }; 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir // ---------------------------------------------------------------------------- 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir /** Extended settings for a sheet, used in import/export filters. */ 63*cdf0e10cSrcweir struct ScExtTabSettings 64*cdf0e10cSrcweir { 65*cdf0e10cSrcweir ScRange maUsedArea; /// Used area in the sheet (columns/rows only). 66*cdf0e10cSrcweir ScRangeList maSelection; /// Selected cell ranges (columns/rows only). 67*cdf0e10cSrcweir ScAddress maCursor; /// The cursor position (column/row only). 68*cdf0e10cSrcweir ScAddress maFirstVis; /// Top-left visible cell (column/row only). 69*cdf0e10cSrcweir ScAddress maSecondVis; /// Top-left visible cell in add. panes (column/row only). 70*cdf0e10cSrcweir ScAddress maFreezePos; /// Position of frozen panes (column/row only). 71*cdf0e10cSrcweir Point maSplitPos; /// Position of split. 72*cdf0e10cSrcweir ScExtPanePos meActivePane; /// Active (focused) pane. 73*cdf0e10cSrcweir Color maGridColor; /// Grid color. 74*cdf0e10cSrcweir long mnNormalZoom; /// Zoom in percent for normal view. 75*cdf0e10cSrcweir long mnPageZoom; /// Zoom in percent for pagebreak preview. 76*cdf0e10cSrcweir bool mbSelected; /// true = Sheet is selected. 77*cdf0e10cSrcweir bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits. 78*cdf0e10cSrcweir bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode. 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir explicit ScExtTabSettings(); 81*cdf0e10cSrcweir }; 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir // ============================================================================ 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir struct ScExtDocOptionsImpl; 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir /** Extended options held by an ScDocument containing additional settings for filters. 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir This object is owned by a Calc document. It contains global document settings 90*cdf0e10cSrcweir (struct ScExtDocSettings), settings for all sheets in the document 91*cdf0e10cSrcweir (struct ScExtTabSettings), and a list of codenames used for VBA import/export. 92*cdf0e10cSrcweir */ 93*cdf0e10cSrcweir class SC_DLLPUBLIC ScExtDocOptions 94*cdf0e10cSrcweir { 95*cdf0e10cSrcweir public: 96*cdf0e10cSrcweir explicit ScExtDocOptions(); 97*cdf0e10cSrcweir ScExtDocOptions( const ScExtDocOptions& rSrc ); 98*cdf0e10cSrcweir ~ScExtDocOptions(); 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir ScExtDocOptions& operator=( const ScExtDocOptions& rSrc ); 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir /** Returns true, if the data needs to be copied to the view data after import. */ 103*cdf0e10cSrcweir bool IsChanged() const; 104*cdf0e10cSrcweir /** If set to true, the data will be copied to the view data after import. */ 105*cdf0e10cSrcweir void SetChanged( bool bChanged ); 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir /** Returns read access to the global document settings. */ 108*cdf0e10cSrcweir const ScExtDocSettings& GetDocSettings() const; 109*cdf0e10cSrcweir /** Returns read/write access to the global document settings. */ 110*cdf0e10cSrcweir ScExtDocSettings& GetDocSettings(); 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir /** Returns read access to the settings of a sheet, if extant; otherwise 0. */ 113*cdf0e10cSrcweir const ScExtTabSettings* GetTabSettings( SCTAB nTab ) const; 114*cdf0e10cSrcweir /** Returns read/write access to the settings of a sheet, may create a new struct. */ 115*cdf0e10cSrcweir ScExtTabSettings& GetOrCreateTabSettings( SCTAB nTab ); 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir /** Returns the number of sheet codenames. */ 118*cdf0e10cSrcweir SCTAB GetCodeNameCount() const; 119*cdf0e10cSrcweir /** Returns the specified codename (empty string = no codename). */ 120*cdf0e10cSrcweir const String& GetCodeName( SCTAB nTab ) const; 121*cdf0e10cSrcweir /** Appends a codename for a sheet. */ 122*cdf0e10cSrcweir void SetCodeName( SCTAB nTab, const String& rCodeName ); 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir private: 125*cdf0e10cSrcweir ::std::auto_ptr< ScExtDocOptionsImpl > mxImpl; 126*cdf0e10cSrcweir }; 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir // ============================================================================ 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir #endif 131*cdf0e10cSrcweir 132