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#pragma once
21
22#include <rangelst.hxx>
23#include "stylesbuffer.hxx"
24#include "worksheethelper.hxx"
25#include "workbookhelper.hxx"
26
27namespace oox::xls {
28
31{
34 sal_Int32 mnActiveCellId;
35
36 explicit PaneSelectionModel();
37};
38
41{
43
48 sal_Int32 mnWorkbookViewId;
49 sal_Int32 mnViewType;
50 sal_Int32 mnActivePaneId;
51 sal_Int32 mnPaneState;
52 double mfSplitX;
53 double mfSplitY;
54 sal_Int32 mnCurrentZoom;
55 sal_Int32 mnNormalZoom;
57 sal_Int32 mnPageLayoutZoom;
67
68 explicit SheetViewModel();
69
71 bool isPageBreakPreview() const;
73 sal_Int32 getNormalZoom() const;
75 sal_Int32 getPageBreakZoom() const;
77 ::Color getGridColor( const ::oox::core::FilterBase& rFilter ) const;
78
82 PaneSelectionModel& createPaneSelection( sal_Int32 nPaneId );
83};
84
85typedef std::shared_ptr< SheetViewModel > SheetViewModelRef;
86
88{
89public:
90 explicit SheetViewSettings( const WorksheetHelper& rHelper );
91
93 void importSheetView( const AttributeList& rAttribs );
95 void importPane( const AttributeList& rAttribs );
97 void importSelection( const AttributeList& rAttribs );
99 void importChartSheetView( const AttributeList& rAttribs );
100
109
111 void finalizeImport();
112
114 bool isSheetRightToLeft() const;
115
116private:
118
119private:
122};
123
126{
127 sal_Int32 mnWinX;
128 sal_Int32 mnWinY;
129 sal_Int32 mnWinWidth;
130 sal_Int32 mnWinHeight;
131 sal_Int32 mnActiveSheet;
132 sal_Int32 mnFirstVisSheet;
133 sal_Int32 mnTabBarWidth;
134 sal_Int32 mnVisibility;
139
140 explicit WorkbookViewModel();
141};
142
143typedef std::shared_ptr< WorkbookViewModel > WorkbookViewModelRef;
144
146{
147public:
148 explicit ViewSettings( const WorkbookHelper& rHelper );
149
151 void importWorkbookView( const AttributeList& rAttribs );
153 void importOleSize( const AttributeList& rAttribs );
158
160 void setSheetViewSettings( sal_Int16 nSheet,
161 const SheetViewModelRef& rxSheetView,
162 const css::uno::Any& rProperties );
164 void setSheetUsedArea( const ScRange& rUsedArea );
165
167 void finalizeImport();
168
170 sal_Int16 getActiveCalcSheet() const;
171
172private:
174
175private:
178
181 std::map< sal_Int16, css::uno::Any > maSheetProps;
182 std::map< sal_Int16, ScRange > maSheetUsedAreas;
185};
186
187} // namespace oox::xls
188
189/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void importPane(const AttributeList &rAttribs)
Imports the pane element containing sheet pane settings.
bool isSheetRightToLeft() const
Returns true, if the sheet layout is set to right-to-left.
void finalizeImport()
Converts all imported sheet view settings.
void importChartSheetView(const AttributeList &rAttribs)
Imports the sheetView element containing view settings of a chart sheet.
SheetViewModelRef createSheetView()
SheetViewModelVec maSheetViews
void importSelection(const AttributeList &rAttribs)
Imports the selection element containing selection settings for a pane.
void importSheetView(const AttributeList &rAttribs)
Imports the sheetView element containing sheet view settings.
SheetViewSettings(const WorksheetHelper &rHelper)
RefVector< SheetViewModel > SheetViewModelVec
RefVector< WorkbookViewModel > WorkbookViewModelVec
void finalizeImport()
Converts all imported document view settings.
std::map< sal_Int16, css::uno::Any > maSheetProps
Active view model for each sheet.
bool mbValidOleSize
Visible area if this is an embedded OLE object.
ViewSettings(const WorkbookHelper &rHelper)
WorkbookViewModel & createWorkbookView()
void setSheetUsedArea(const ScRange &rUsedArea)
Stores the used area for a specific worksheet.
void importOleSize(const AttributeList &rAttribs)
Imports the oleSize element containing the visible size of the workbook.
WorkbookViewModelVec maBookViews
void setSheetViewSettings(sal_Int16 nSheet, const SheetViewModelRef &rxSheetView, const css::uno::Any &rProperties)
Stores converted view settings for a specific worksheet.
SheetViewModelMap maSheetViews
Workbook view models.
void importWorkbookView(const AttributeList &rAttribs)
Imports the workbookView element containing workbook view settings.
RefMap< sal_Int16, SheetViewModel > SheetViewModelMap
sal_Int16 getActiveCalcSheet() const
Returns the Calc index of the active sheet.
std::map< sal_Int16, ScRange > maSheetUsedAreas
Converted property sequences for each sheet.
ScRange maOleSize
Used area (cell range) of every sheet.
Helper class to provide access to global workbook data.
void SvStream & rStrm
std::shared_ptr< WorkbookViewModel > WorkbookViewModelRef
std::shared_ptr< SheetViewModel > SheetViewModelRef
Contains all settings for a selection in a single pane of a sheet.
ScRangeList maSelection
Position of active cell (cursor).
sal_Int32 mnActiveCellId
Selected cell ranges.
PaneSelectionModel()
Index of active cell in selection list.
Contains all view settings for a single sheet.
sal_Int32 mnActivePaneId
View type (normal, page break, layout).
const PaneSelectionModel * getActiveSelection() const
Returns the selection data of the active pane.
double mfSplitX
Pane state (frozen, split).
sal_Int32 mnSheetLayoutZoom
Zoom factor for normal view.
sal_Int32 getNormalZoom() const
Returns the zoom in normal view (returns default, if current value is 0).
sal_Int32 mnCurrentZoom
Split Y position (twips), or number of frozen rows.
bool mbSelected
Zoom factor for page layout view.
double mfSplitY
Split X position (twips), or number of frozen columns.
bool mbShowFormulas
True = default grid color.
sal_Int32 mnPaneState
Active pane (with cell cursor).
sal_Int32 getPageBreakZoom() const
Returns the zoom in pagebreak preview (returns default, if current value is 0).
RefMap< sal_Int32, PaneSelectionModel > PaneSelectionModelMap
bool mbDefGridColor
True = sheet in right-to-left mode.
bool mbRightToLeft
True = sheet is selected.
bool mbShowOutline
True = show zero value zells.
sal_Int32 mnViewType
Index into list of workbookView elements.
PaneSelectionModelMap maPaneSelMap
sal_Int32 mnWorkbookViewId
First visible cell in additional panes.
::Color getGridColor(const ::oox::core::FilterBase &rFilter) const
Returns the grid color as RGB value.
sal_Int32 mnNormalZoom
Zoom factor for current view.
bool isPageBreakPreview() const
Returns true, if page break preview is active.
ScAddress maFirstPos
Grid color.
ScAddress maSecondPos
First visible cell.
sal_Int32 mnPageLayoutZoom
Zoom factor for pagebreak preview.
bool mbShowZeros
True = show column/row headings.
SheetViewModel()
True = zoom chart sheet to fit window.
bool mbShowGrid
True = show formulas instead of results.
bool mbShowHeadings
True = show cell grid.
PaneSelectionModel & createPaneSelection(sal_Int32 nPaneId)
Returns read/write access to the selection data of the specified pane.
bool mbZoomToFit
True = show outlines.
Color maGridColor
Selections of all panes.
Contains all view settings for the entire document.
sal_Int32 mnVisibility
Width of sheet tabbar (1/1000 of window width).
bool mbMinimized
True = show vertical sheet scrollbars.
sal_Int32 mnWinY
X position of the workbook window (twips).
WorkbookViewModel()
True = workbook window is minimized.
sal_Int32 mnWinWidth
Y position of the workbook window (twips).
sal_Int32 mnFirstVisSheet
Displayed (active) sheet.
sal_Int32 mnActiveSheet
Height of the workbook window (twips).
bool mbShowTabBar
Visibility state of workbook window.
bool mbShowHorScroll
True = show sheet tabbar.
sal_Int32 mnWinHeight
Width of the workbook window (twips).
bool mbShowVerScroll
True = show horizontal sheet scrollbars.
sal_Int32 mnTabBarWidth
First visible sheet in sheet tabbar.