Fix build
[LibreOffice.git] / sc / inc / scextopt.hxx
blob843dfa6ebab04945ad7dd66c6b846341f3508b47
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
21 #include <memory>
22 #include <tools/gen.hxx>
23 #include <tools/color.hxx>
24 #include "rangelst.hxx"
26 /** Extended settings for the document, used in import/export filters. */
27 struct ScExtDocSettings
29 OUString maGlobCodeName; ///< Global codename (VBA module name).
30 double mfTabBarWidth; ///< Width of the tabbar, relative to frame window width (0.0 ... 1.0).
31 sal_uInt32 mnLinkCnt; ///< Recursive counter for loading external documents.
32 SCTAB mnDisplTab; ///< Index of displayed sheet.
34 explicit ScExtDocSettings();
37 /** Enumerates possible positions of panes in split sheets. */
38 enum ScExtPanePos
40 SCEXT_PANE_TOPLEFT, ///< Single, top, left, or top-left pane.
41 SCEXT_PANE_TOPRIGHT, ///< Right, or top-right pane.
42 SCEXT_PANE_BOTTOMLEFT, ///< Bottom, or bottom-left pane.
43 SCEXT_PANE_BOTTOMRIGHT ///< Bottom-right pane.
46 /** Extended settings for a sheet, used in import/export filters. */
47 struct ScExtTabSettings
49 ScRange maUsedArea; ///< Used area in the sheet (columns/rows only).
50 ScRangeList maSelection; ///< Selected cell ranges (columns/rows only).
51 ScAddress maCursor; ///< The cursor position (column/row only).
52 ScAddress maFirstVis; ///< Top-left visible cell (column/row only).
53 ScAddress maSecondVis; ///< Top-left visible cell in add. panes (column/row only).
54 ScAddress maFreezePos; ///< Position of frozen panes (column/row only).
55 Point maSplitPos; ///< Position of split.
56 ScExtPanePos meActivePane; ///< Active (focused) pane.
57 Color maGridColor; ///< Grid color.
58 tools::Long mnNormalZoom; ///< Zoom in percent for normal view.
59 tools::Long mnPageZoom; ///< Zoom in percent for pagebreak preview.
60 bool mbSelected; ///< true = Sheet is selected.
61 bool mbFrozenPanes; ///< true = Frozen panes; false = Normal splits.
62 bool mbPageMode; ///< true = Pagebreak mode; false = Normal view mode.
63 bool mbShowGrid; ///< Whether or not to display gridlines.
65 explicit ScExtTabSettings();
68 struct ScExtDocOptionsImpl;
70 /** Extended options held by an ScDocument containing additional settings for filters.
72 This object is owned by a Calc document. It contains global document settings
73 (struct ScExtDocSettings), settings for all sheets in the document
74 (struct ScExtTabSettings), and a list of codenames used for VBA import/export.
76 class SC_DLLPUBLIC ScExtDocOptions
78 public:
79 explicit ScExtDocOptions();
80 ScExtDocOptions( const ScExtDocOptions& rSrc );
81 ~ScExtDocOptions();
83 ScExtDocOptions& operator=( const ScExtDocOptions& rSrc );
85 /** @return true, if the data needs to be copied to the view data after import. */
86 bool IsChanged() const;
87 /** If set to true, the data will be copied to the view data after import. */
88 void SetChanged( bool bChanged );
90 /** @return read access to the global document settings. */
91 const ScExtDocSettings& GetDocSettings() const;
92 /** @return read/write access to the global document settings. */
93 ScExtDocSettings& GetDocSettings();
95 /** @return read access to the settings of a sheet, if extant; otherwise 0. */
96 const ScExtTabSettings* GetTabSettings( SCTAB nTab ) const;
98 /**
99 * @return index of the last sheet that has settings, or -1 if no tab
100 * settings are present.
102 SCTAB GetLastTab() const;
104 /** @return read/write access to the settings of a sheet, may create a new struct. */
105 ScExtTabSettings& GetOrCreateTabSettings( SCTAB nTab );
107 /** @return the number of sheet codenames. */
108 SCTAB GetCodeNameCount() const;
109 /** @return the specified codename (empty string = no codename). */
110 OUString GetCodeName( SCTAB nTab ) const;
111 /** Appends a codename for a sheet. */
112 void SetCodeName( SCTAB nTab, const OUString& rCodeName );
114 private:
115 ::std::unique_ptr< ScExtDocOptionsImpl > mxImpl;
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */