sync master with lastest vba changes
[ooovba.git] / sc / inc / scextopt.hxx
blobba1eea20d580030e367d3aeb2df3503b40c5e3fe
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.13 $
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 ************************************************************************/
30 #ifndef SC_SCEXTOPT_HXX
31 #define SC_SCEXTOPT_HXX
33 #include <memory>
34 #include <tools/gen.hxx>
35 #include <tools/color.hxx>
36 #include "global.hxx"
37 #include "rangelst.hxx"
39 // ============================================================================
41 /** Extended settings for the document, used in import/export filters. */
42 struct ScExtDocSettings
44 ScRange maOleSize; /// Visible range if embedded.
45 String maGlobCodeName; /// Global codename (VBA module name).
46 double mfTabBarWidth; /// Width of the tabbar, relative to frame window width (0.0 ... 1.0).
47 sal_uInt32 mnLinkCnt; /// Recursive counter for loading external documents.
48 SCTAB mnDisplTab; /// Index of displayed sheet.
50 explicit ScExtDocSettings();
53 // ============================================================================
55 /** Enumerates possible positions of panes in split sheets. */
56 enum ScExtPanePos
58 SCEXT_PANE_TOPLEFT, /// Single, top, left, or top-left pane.
59 SCEXT_PANE_TOPRIGHT, /// Right, or top-right pane.
60 SCEXT_PANE_BOTTOMLEFT, /// Bottom, or bottom-left pane.
61 SCEXT_PANE_BOTTOMRIGHT /// Bottom-right pane.
64 // ----------------------------------------------------------------------------
66 /** Extended settings for a sheet, used in import/export filters. */
67 struct ScExtTabSettings
69 ScRange maUsedArea; /// Used area in the sheet (columns/rows only).
70 ScRangeList maSelection; /// Selected cell ranges (columns/rows only).
71 ScAddress maCursor; /// The cursor position (column/row only).
72 ScAddress maFirstVis; /// Top-left visible cell (column/row only).
73 ScAddress maSecondVis; /// Top-left visible cell in add. panes (column/row only).
74 ScAddress maFreezePos; /// Position of frozen panes (column/row only).
75 Point maSplitPos; /// Position of split.
76 ScExtPanePos meActivePane; /// Active (focused) pane.
77 Color maGridColor; /// Grid color.
78 long mnNormalZoom; /// Zoom in percent for normal view.
79 long mnPageZoom; /// Zoom in percent for pagebreak preview.
80 bool mbSelected; /// true = Sheet is selected.
81 bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits.
82 bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode.
83 bool mbShowGrid; /// Whether or not to display gridlines.
84 Color maTabBgColor; /// Tab Bg Color
85 bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; };
87 explicit ScExtTabSettings();
90 // ============================================================================
92 struct ScExtDocOptionsImpl;
94 /** Extended options held by an ScDocument containing additional settings for filters.
96 This object is owned by a Calc document. It contains global document settings
97 (struct ScExtDocSettings), settings for all sheets in the document
98 (struct ScExtTabSettings), and a list of codenames used for VBA import/export.
100 class SC_DLLPUBLIC ScExtDocOptions
102 public:
103 explicit ScExtDocOptions();
104 ScExtDocOptions( const ScExtDocOptions& rSrc );
105 ~ScExtDocOptions();
107 ScExtDocOptions& operator=( const ScExtDocOptions& rSrc );
109 /** Returns true, if the data needs to be copied to the view data after import. */
110 bool IsChanged() const;
111 /** If set to true, the data will be copied to the view data after import. */
112 void SetChanged( bool bChanged );
114 /** Returns read access to the global document settings. */
115 const ScExtDocSettings& GetDocSettings() const;
116 /** Returns read/write access to the global document settings. */
117 ScExtDocSettings& GetDocSettings();
119 /** Returns read access to the settings of a sheet, if extant; otherwise 0. */
120 const ScExtTabSettings* GetTabSettings( SCTAB nTab ) const;
121 /** Returns read/write access to the settings of a sheet, may create a new struct. */
122 ScExtTabSettings& GetOrCreateTabSettings( SCTAB nTab );
124 /** Returns the number of sheet codenames. */
125 size_t GetCodeNameCount() const;
126 /** Returns the specified codename (empty string = no codename). */
127 const String& GetCodeName( size_t nIdx ) const;
128 /** Appends a codename for a sheet. */
129 void AppendCodeName( const String& rCodeName );
130 void SetCodeName( const String& rCodeName, size_t nIdx );
131 void DeleteCodeName( size_t nIdx );
133 private:
134 ::std::auto_ptr< ScExtDocOptionsImpl > mxImpl;
137 // ============================================================================
139 #endif