1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SC_INC_SCEXTOPT_HXX
20 #define INCLUDED_SC_INC_SCEXTOPT_HXX
23 #include <tools/gen.hxx>
24 #include <tools/color.hxx>
25 #include "rangelst.hxx"
27 /** Extended settings for the document, used in import/export filters. */
28 struct ScExtDocSettings
30 OUString maGlobCodeName
; ///< Global codename (VBA module name).
31 double mfTabBarWidth
; ///< Width of the tabbar, relative to frame window width (0.0 ... 1.0).
32 sal_uInt32 mnLinkCnt
; ///< Recursive counter for loading external documents.
33 SCTAB mnDisplTab
; ///< Index of displayed sheet.
35 explicit ScExtDocSettings();
38 /** Enumerates possible positions of panes in split sheets. */
41 SCEXT_PANE_TOPLEFT
, ///< Single, top, left, or top-left pane.
42 SCEXT_PANE_TOPRIGHT
, ///< Right, or top-right pane.
43 SCEXT_PANE_BOTTOMLEFT
, ///< Bottom, or bottom-left pane.
44 SCEXT_PANE_BOTTOMRIGHT
///< Bottom-right pane.
47 /** Extended settings for a sheet, used in import/export filters. */
48 struct ScExtTabSettings
50 ScRange maUsedArea
; ///< Used area in the sheet (columns/rows only).
51 ScRangeList maSelection
; ///< Selected cell ranges (columns/rows only).
52 ScAddress maCursor
; ///< The cursor position (column/row only).
53 ScAddress maFirstVis
; ///< Top-left visible cell (column/row only).
54 ScAddress maSecondVis
; ///< Top-left visible cell in add. panes (column/row only).
55 ScAddress maFreezePos
; ///< Position of frozen panes (column/row only).
56 Point maSplitPos
; ///< Position of split.
57 ScExtPanePos meActivePane
; ///< Active (focused) pane.
58 Color maGridColor
; ///< Grid color.
59 long mnNormalZoom
; ///< Zoom in percent for normal view.
60 long mnPageZoom
; ///< Zoom in percent for pagebreak preview.
61 bool mbSelected
; ///< true = Sheet is selected.
62 bool mbFrozenPanes
; ///< true = Frozen panes; false = Normal splits.
63 bool mbPageMode
; ///< true = Pagebreak mode; false = Normal view mode.
64 bool mbShowGrid
; ///< Whether or not to display gridlines.
66 explicit ScExtTabSettings();
69 struct ScExtDocOptionsImpl
;
71 /** Extended options held by an ScDocument containing additional settings for filters.
73 This object is owned by a Calc document. It contains global document settings
74 (struct ScExtDocSettings), settings for all sheets in the document
75 (struct ScExtTabSettings), and a list of codenames used for VBA import/export.
77 class SC_DLLPUBLIC ScExtDocOptions
80 explicit ScExtDocOptions();
81 ScExtDocOptions( const ScExtDocOptions
& rSrc
);
84 ScExtDocOptions
& operator=( const ScExtDocOptions
& rSrc
);
86 /** @return true, if the data needs to be copied to the view data after import. */
87 bool IsChanged() const;
88 /** If set to true, the data will be copied to the view data after import. */
89 void SetChanged( bool bChanged
);
91 /** @return read access to the global document settings. */
92 const ScExtDocSettings
& GetDocSettings() const;
93 /** @return read/write access to the global document settings. */
94 ScExtDocSettings
& GetDocSettings();
96 /** @return read access to the settings of a sheet, if extant; otherwise 0. */
97 const ScExtTabSettings
* GetTabSettings( SCTAB nTab
) const;
100 * @return index of the last sheet that has settings, or -1 if no tab
101 * settings are present.
103 SCTAB
GetLastTab() const;
105 /** @return read/write access to the settings of a sheet, may create a new struct. */
106 ScExtTabSettings
& GetOrCreateTabSettings( SCTAB nTab
);
108 /** @return the number of sheet codenames. */
109 SCTAB
GetCodeNameCount() const;
110 /** @return the specified codename (empty string = no codename). */
111 const OUString
& GetCodeName( SCTAB nTab
) const;
112 /** Appends a codename for a sheet. */
113 void SetCodeName( SCTAB nTab
, const OUString
& rCodeName
);
116 ::std::unique_ptr
< ScExtDocOptionsImpl
> mxImpl
;
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */