LibreOffice Module sc (master)  1
viewsettings.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_VIEWSETTINGS_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_VIEWSETTINGS_HXX
22 
23 #include <rangelst.hxx>
24 #include "stylesbuffer.hxx"
25 #include "worksheethelper.hxx"
26 #include "workbookhelper.hxx"
27 
28 namespace oox::xls {
29 
32 {
35  sal_Int32 mnActiveCellId;
36 
37  explicit PaneSelectionModel();
38 };
39 
42 {
44 
45  PaneSelectionModelMap maPaneSelMap;
49  sal_Int32 mnWorkbookViewId;
50  sal_Int32 mnViewType;
51  sal_Int32 mnActivePaneId;
52  sal_Int32 mnPaneState;
53  double mfSplitX;
54  double mfSplitY;
55  sal_Int32 mnCurrentZoom;
56  sal_Int32 mnNormalZoom;
57  sal_Int32 mnSheetLayoutZoom;
58  sal_Int32 mnPageLayoutZoom;
59  bool mbSelected;
63  bool mbShowGrid;
65  bool mbShowZeros;
67  bool mbZoomToFit;
68 
69  explicit SheetViewModel();
70 
72  bool isPageBreakPreview() const;
74  sal_Int32 getNormalZoom() const;
76  sal_Int32 getPageBreakZoom() const;
78  ::Color getGridColor( const ::oox::core::FilterBase& rFilter ) const;
79 
83  PaneSelectionModel& createPaneSelection( sal_Int32 nPaneId );
84 };
85 
86 typedef std::shared_ptr< SheetViewModel > SheetViewModelRef;
87 
89 {
90 public:
91  explicit SheetViewSettings( const WorksheetHelper& rHelper );
92 
94  void importSheetView( const AttributeList& rAttribs );
96  void importPane( const AttributeList& rAttribs );
98  void importSelection( const AttributeList& rAttribs );
100  void importChartSheetView( const AttributeList& rAttribs );
101 
105  void importPane( SequenceInputStream& rStrm );
107  void importSelection( SequenceInputStream& rStrm );
110 
112  void finalizeImport();
113 
115  bool isSheetRightToLeft() const;
116 
117 private:
118  SheetViewModelRef createSheetView();
119 
120 private:
122  SheetViewModelVec maSheetViews;
123 };
124 
127 {
128  sal_Int32 mnWinX;
129  sal_Int32 mnWinY;
130  sal_Int32 mnWinWidth;
131  sal_Int32 mnWinHeight;
132  sal_Int32 mnActiveSheet;
133  sal_Int32 mnFirstVisSheet;
134  sal_Int32 mnTabBarWidth;
135  sal_Int32 mnVisibility;
139  bool mbMinimized;
140 
141  explicit WorkbookViewModel();
142 };
143 
144 typedef std::shared_ptr< WorkbookViewModel > WorkbookViewModelRef;
145 
147 {
148 public:
149  explicit ViewSettings( const WorkbookHelper& rHelper );
150 
152  void importWorkbookView( const AttributeList& rAttribs );
154  void importOleSize( const AttributeList& rAttribs );
158  void importOleSize( SequenceInputStream& rStrm );
159 
161  void setSheetViewSettings( sal_Int16 nSheet,
162  const SheetViewModelRef& rxSheetView,
163  const css::uno::Any& rProperties );
165  void setSheetUsedArea( const ScRange& rUsedArea );
166 
168  void finalizeImport();
169 
171  sal_Int16 getActiveCalcSheet() const;
172 
173 private:
175 
176 private:
179 
180  WorkbookViewModelVec maBookViews;
181  SheetViewModelMap maSheetViews;
182  std::map< sal_Int16, css::uno::Any > maSheetProps;
183  std::map< sal_Int16, ScRange > maSheetUsedAreas;
186 };
187 
188 } // namespace oox::xls
189 
190 #endif
191 
192 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper class to provide access to global workbook data.
sal_Int32 mnWinWidth
Y position of the workbook window (twips).
bool isSheetRightToLeft() const
Returns true, if the sheet layout is set to right-to-left.
bool mbZoomToFit
True = show outlines.
sal_Int32 mnWinHeight
Width of the workbook window (twips).
WorkbookViewModelVec maBookViews
double mfSplitY
Split X position (twips), or number of frozen columns.
sal_Int32 mnTabBarWidth
First visible sheet in sheet tabbar.
sal_Int32 mnActivePaneId
View type (normal, page break, layout).
sal_Int32 mnNormalZoom
Zoom factor for current view.
bool mbShowGrid
True = show formulas instead of results.
ScRange maOleSize
Used area (cell range) of every sheet.
sal_Int32 mnCurrentZoom
Split Y position (twips), or number of frozen rows.
::Color getGridColor(const ::oox::core::FilterBase &rFilter) const
Returns the grid color as RGB value.
Contains all view settings for the entire document.
void finalizeImport()
Converts all imported sheet view settings.
ScRangeList maSelection
Position of active cell (cursor).
ScAddress maFirstPos
Grid color.
bool mbMinimized
True = show vertical sheet scrollbars.
void importChartSheetView(const AttributeList &rAttribs)
Imports the sheetView element containing view settings of a chart sheet.
void setSheetViewSettings(sal_Int16 nSheet, const SheetViewModelRef &rxSheetView, const css::uno::Any &rProperties)
Stores converted view settings for a specific worksheet.
sal_Int32 mnWinY
X position of the workbook window (twips).
bool mbShowZeros
True = show column/row headings.
ScAddress maSecondPos
First visible cell.
PaneSelectionModel()
Index of active cell in selection list.
bool isPageBreakPreview() const
Returns true, if page break preview is active.
sal_Int32 mnViewType
Index into list of workbookView elements.
SheetViewModel()
True = zoom chart sheet to fit window.
std::shared_ptr< SheetViewModel > SheetViewModelRef
sal_Int32 mnVisibility
Width of sheet tabbar (1/1000 of window width).
sal_Int16 getActiveCalcSheet() const
Returns the Calc index of the active sheet.
SheetViewModelMap maSheetViews
Workbook view models.
Contains all settings for a selection in a single pane of a sheet.
bool mbRightToLeft
True = sheet is selected.
RefMap< sal_Int16, SheetViewModel > SheetViewModelMap
sal_Int32 getPageBreakZoom() const
Returns the zoom in pagebreak preview (returns default, if current value is 0).
std::shared_ptr< WorkbookViewModel > WorkbookViewModelRef
SheetViewModelRef createSheetView()
void importSelection(const AttributeList &rAttribs)
Imports the selection element containing selection settings for a pane.
sal_Int32 mnPaneState
Active pane (with cell cursor).
SheetViewSettings(const WorksheetHelper &rHelper)
bool mbDefGridColor
True = sheet in right-to-left mode.
RefVector< WorkbookViewModel > WorkbookViewModelVec
sal_Int32 mnPageLayoutZoom
Zoom factor for pagebreak preview.
WorkbookViewModel()
True = workbook window is minimized.
SheetViewModelVec maSheetViews
sal_Int32 getNormalZoom() const
Returns the zoom in normal view (returns default, if current value is 0).
sal_Int32 mnFirstVisSheet
Displayed (active) sheet.
double mfSplitX
Pane state (frozen, split).
bool mbSelected
Zoom factor for page layout view.
void setSheetUsedArea(const ScRange &rUsedArea)
Stores the used area for a specific worksheet.
WorkbookViewModel & createWorkbookView()
std::map< sal_Int16, ScRange > maSheetUsedAreas
Converted property sequences for each sheet.
void importWorkbookView(const AttributeList &rAttribs)
Imports the workbookView element containing workbook view settings.
ViewSettings(const WorkbookHelper &rHelper)
bool mbShowOutline
True = show zero value zells.
void finalizeImport()
Converts all imported document view settings.
void importSheetView(const AttributeList &rAttribs)
Imports the sheetView element containing sheet view settings.
RefMap< sal_Int32, PaneSelectionModel > PaneSelectionModelMap
const PaneSelectionModel * getActiveSelection() const
Returns the selection data of the active pane.
sal_Int32 mnSheetLayoutZoom
Zoom factor for normal view.
PaneSelectionModel & createPaneSelection(sal_Int32 nPaneId)
Returns read/write access to the selection data of the specified pane.
bool mbShowHeadings
True = show cell grid.
bool mbShowHorScroll
True = show sheet tabbar.
sal_Int32 mnActiveCellId
Selected cell ranges.
bool mbValidOleSize
Visible area if this is an embedded OLE object.
Color maGridColor
Selections of all panes.
void SvStream & rStrm
sal_Int32 mnWorkbookViewId
First visible cell in additional panes.
bool mbShowVerScroll
True = show horizontal sheet scrollbars.
void importPane(const AttributeList &rAttribs)
Imports the pane element containing sheet pane settings.
bool mbShowTabBar
Visibility state of workbook window.
bool mbShowFormulas
True = default grid color.
std::map< sal_Int16, css::uno::Any > maSheetProps
Active view model for each sheet.
Contains all view settings for a single sheet.
PaneSelectionModelMap maPaneSelMap
sal_Int32 mnActiveSheet
Height of the workbook window (twips).
RefVector< SheetViewModel > SheetViewModelVec
void importOleSize(const AttributeList &rAttribs)
Imports the oleSize element containing the visible size of the workbook.