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>
26 #include "rangelst.hxx"
28 /** Extended settings for the document, used in import/export filters. */
29 struct ScExtDocSettings
31 OUString maGlobCodeName
; ///< Global codename (VBA module name).
32 double mfTabBarWidth
; ///< Width of the tabbar, relative to frame window width (0.0 ... 1.0).
33 sal_uInt32 mnLinkCnt
; ///< Recursive counter for loading external documents.
34 SCTAB mnDisplTab
; ///< Index of displayed sheet.
36 explicit ScExtDocSettings();
39 /** Enumerates possible positions of panes in split sheets. */
42 SCEXT_PANE_TOPLEFT
, ///< Single, top, left, or top-left pane.
43 SCEXT_PANE_TOPRIGHT
, ///< Right, or top-right pane.
44 SCEXT_PANE_BOTTOMLEFT
, ///< Bottom, or bottom-left pane.
45 SCEXT_PANE_BOTTOMRIGHT
///< Bottom-right pane.
48 /** Extended settings for a sheet, used in import/export filters. */
49 struct ScExtTabSettings
51 ScRange maUsedArea
; ///< Used area in the sheet (columns/rows only).
52 ScRangeList maSelection
; ///< Selected cell ranges (columns/rows only).
53 ScAddress maCursor
; ///< The cursor position (column/row only).
54 ScAddress maFirstVis
; ///< Top-left visible cell (column/row only).
55 ScAddress maSecondVis
; ///< Top-left visible cell in add. panes (column/row only).
56 ScAddress maFreezePos
; ///< Position of frozen panes (column/row only).
57 Point maSplitPos
; ///< Position of split.
58 ScExtPanePos meActivePane
; ///< Active (focused) pane.
59 Color maGridColor
; ///< Grid color.
60 long mnNormalZoom
; ///< Zoom in percent for normal view.
61 long mnPageZoom
; ///< Zoom in percent for pagebreak preview.
62 bool mbSelected
; ///< true = Sheet is selected.
63 bool mbFrozenPanes
; ///< true = Frozen panes; false = Normal splits.
64 bool mbPageMode
; ///< true = Pagebreak mode; false = Normal view mode.
65 bool mbShowGrid
; ///< Whether or not to display gridlines.
67 explicit ScExtTabSettings();
70 struct ScExtDocOptionsImpl
;
72 /** Extended options held by an ScDocument containing additional settings for filters.
74 This object is owned by a Calc document. It contains global document settings
75 (struct ScExtDocSettings), settings for all sheets in the document
76 (struct ScExtTabSettings), and a list of codenames used for VBA import/export.
78 class SC_DLLPUBLIC ScExtDocOptions
81 explicit ScExtDocOptions();
82 ScExtDocOptions( const ScExtDocOptions
& rSrc
);
85 ScExtDocOptions
& operator=( const ScExtDocOptions
& rSrc
);
87 /** @return true, if the data needs to be copied to the view data after import. */
88 bool IsChanged() const;
89 /** If set to true, the data will be copied to the view data after import. */
90 void SetChanged( bool bChanged
);
92 /** @return read access to the global document settings. */
93 const ScExtDocSettings
& GetDocSettings() const;
94 /** @return read/write access to the global document settings. */
95 ScExtDocSettings
& GetDocSettings();
97 /** @return read access to the settings of a sheet, if extant; otherwise 0. */
98 const ScExtTabSettings
* GetTabSettings( SCTAB nTab
) const;
101 * @return index of the last sheet that has settings, or -1 if no tab
102 * settings are present.
104 SCTAB
GetLastTab() const;
106 /** @return read/write access to the settings of a sheet, may create a new struct. */
107 ScExtTabSettings
& GetOrCreateTabSettings( SCTAB nTab
);
109 /** @return the number of sheet codenames. */
110 SCTAB
GetCodeNameCount() const;
111 /** @return the specified codename (empty string = no codename). */
112 const OUString
& GetCodeName( SCTAB nTab
) const;
113 /** Appends a codename for a sheet. */
114 void SetCodeName( SCTAB nTab
, const OUString
& rCodeName
);
117 ::std::unique_ptr
< ScExtDocOptionsImpl
> mxImpl
;
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */