LibreOffice Module sc (master)  1
xlview.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_XLVIEW_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_XLVIEW_HXX
22 
23 #include <tools/color.hxx>
24 #include "xladdress.hxx"
25 #include <map>
26 #include <memory>
27 
28 // Constants and enumerations =================================================
29 
30 const sal_uInt16 EXC_ZOOM_MIN = 10;
31 const sal_uInt16 EXC_ZOOM_MAX = 400;
32 
33 // (0x001D) SELECTION ---------------------------------------------------------
34 
35 const sal_uInt16 EXC_ID_SELECTION = 0x001D;
36 
37 // (0x003D) WINDOW1 -----------------------------------------------------------
38 
39 const sal_uInt16 EXC_ID_WINDOW1 = 0x003D;
40 
41 const sal_uInt16 EXC_WIN1_HIDDEN = 0x0001;
42 const sal_uInt16 EXC_WIN1_MINIMIZED = 0x0002;
43 const sal_uInt16 EXC_WIN1_HOR_SCROLLBAR = 0x0008;
44 const sal_uInt16 EXC_WIN1_VER_SCROLLBAR = 0x0010;
45 const sal_uInt16 EXC_WIN1_TABBAR = 0x0020;
46 
47 // (0x003E, 0x023E) WINDOW2 ---------------------------------------------------
48 
49 const sal_uInt16 EXC_ID2_WINDOW2 = 0x003E;
50 const sal_uInt16 EXC_ID_WINDOW2 = 0x023E;
51 
52 const sal_uInt16 EXC_WIN2_SHOWFORMULAS = 0x0001;
53 const sal_uInt16 EXC_WIN2_SHOWGRID = 0x0002;
54 const sal_uInt16 EXC_WIN2_SHOWHEADINGS = 0x0004;
55 const sal_uInt16 EXC_WIN2_FROZEN = 0x0008;
56 const sal_uInt16 EXC_WIN2_SHOWZEROS = 0x0010;
57 const sal_uInt16 EXC_WIN2_DEFGRIDCOLOR = 0x0020;
58 const sal_uInt16 EXC_WIN2_MIRRORED = 0x0040;
59 const sal_uInt16 EXC_WIN2_SHOWOUTLINE = 0x0080;
60 const sal_uInt16 EXC_WIN2_FROZENNOSPLIT = 0x0100;
61 const sal_uInt16 EXC_WIN2_SELECTED = 0x0200;
62 const sal_uInt16 EXC_WIN2_DISPLAYED = 0x0400;
63 const sal_uInt16 EXC_WIN2_PAGEBREAKMODE = 0x0800;
64 
65 const sal_uInt16 EXC_WIN2_NORMALZOOM_DEF = 100;
66 const sal_uInt16 EXC_WIN2_PAGEZOOM_DEF = 60;
67 
68 // (0x0041) PANE --------------------------------------------------------------
69 
70 const sal_uInt16 EXC_ID_PANE = 0x0041;
71 
76 
77 // (0x00A0) SCL ---------------------------------------------------------------
78 
79 const sal_uInt16 EXC_ID_SCL = 0x00A0;
80 
81 // (0x0862) SHEETEXT ----------------------------------------------------------
82 
83 const sal_uInt16 EXC_ID_SHEETEXT = 0x0862;
85 const sal_uInt16 EXC_COLOR_NOTABBG = 0x7F;
86 // Structs ====================================================================
87 
90 {
91  sal_uInt16 mnWinX;
92  sal_uInt16 mnWinY;
93  sal_uInt16 mnWinWidth;
94  sal_uInt16 mnWinHeight;
95  sal_uInt16 mnFlags;
96  sal_uInt16 mnDisplXclTab;
97  sal_uInt16 mnFirstVisXclTab;
98  sal_uInt16 mnXclSelectCnt;
99  sal_uInt16 mnTabBarWidth;
100 
101  explicit XclDocViewData();
102 };
103 
106 {
109  sal_uInt16 mnCursorIdx;
110 
111  explicit XclSelectionData() : mnCursorIdx( 0 ) {}
112 };
113 
114 typedef std::shared_ptr< XclSelectionData > XclSelectionDataRef;
115 
118 {
119  typedef ::std::map< sal_uInt8, XclSelectionDataRef > XclSelectionMap;
120 
121  XclSelectionMap maSelMap;
125  sal_uInt16 mnSplitX;
126  sal_uInt32 mnSplitY;
127  sal_uInt16 mnNormalZoom;
128  sal_uInt16 mnPageZoom;
129  sal_uInt16 mnCurrentZoom;
131  bool mbSelected;
132  bool mbDisplayed;
133  bool mbMirrored;
135  bool mbPageMode;
138  bool mbShowGrid;
140  bool mbShowZeros;
143  bool IsDefaultTabBgColor() const { return maTabBgColor == COL_AUTO; };
144  sal_uInt32 mnTabBgColorId;
145 
146  explicit XclTabViewData();
147  ~XclTabViewData();
148 
150  void SetDefaults();
151 
153  bool IsSplit() const;
155  bool HasPane( sal_uInt8 nPaneId ) const;
156 
158  const XclSelectionData* GetSelectionData( sal_uInt8 nPane ) const;
161 };
162 
163 #endif
164 
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_uInt16 EXC_WIN2_FROZENNOSPLIT
Definition: xlview.hxx:60
bool mbPageMode
true = Frozen panes; false = split window.
Definition: xlview.hxx:135
sal_uInt16 mnDisplXclTab
Additional flags.
Definition: xlview.hxx:96
XclAddress maFirstXclPos
Grid color.
Definition: xlview.hxx:123
XclDocViewData()
Width of sheet tabbar (1/1000 of window width).
Definition: xlview.cxx:25
sal_uInt32 mnSplitY
Split X position, or number of frozen columns.
Definition: xlview.hxx:126
const sal_uInt16 EXC_WIN1_HIDDEN
Definition: xlview.hxx:41
const sal_uInt8 EXC_PANE_TOPRIGHT
Bottom-right pane.
Definition: xlview.hxx:73
bool IsSplit() const
Returns true, if the window is split in any direction.
Definition: xlview.cxx:71
bool mbShowOutline
true = Show zero value zells.
Definition: xlview.hxx:141
sal_uInt32 mnTabBgColorId
Definition: xlview.hxx:143
const sal_uInt16 EXC_ID_SELECTION
Definition: xlview.hxx:35
const sal_uInt16 EXC_ZOOM_MIN
Definition: xlview.hxx:30
const sal_uInt16 EXC_WIN2_MIRRORED
Definition: xlview.hxx:58
bool mbFrozenPanes
true = Mirrored (right-to-left) sheet.
Definition: xlview.hxx:134
const sal_uInt16 EXC_WIN2_SHOWHEADINGS
Definition: xlview.hxx:54
const sal_uInt16 EXC_ID_WINDOW1
Definition: xlview.hxx:39
const sal_uInt16 EXC_ID_SCL
Single, top, left, or top-left pane.
Definition: xlview.hxx:79
const sal_uInt8 EXC_SHEETEXT_TABCOLOR
header id for sheetext
Definition: xlview.hxx:84
sal_uInt16 mnWinX
Definition: xlview.hxx:91
constexpr::Color COL_AUTO(0xFF, 0xFF, 0xFF, 0xFF)
XclRangeList maXclSelection
Cell cursor position.
Definition: xlview.hxx:108
XclSelectionData()
Index of cursor in selection list.
Definition: xlview.hxx:111
const sal_uInt16 EXC_WIN2_PAGEZOOM_DEF
Default zoom for normal view.
Definition: xlview.hxx:66
bool mbSelected
Active pane (with cell cursor).
Definition: xlview.hxx:131
const sal_uInt8 EXC_PANE_BOTTOMRIGHT
Definition: xlview.hxx:72
XclSelectionData & CreateSelectionData(sal_uInt8 nPane)
Returns read/write access to the selection data of the specified pane.
Definition: xlview.cxx:95
const sal_uInt16 EXC_WIN2_DISPLAYED
Definition: xlview.hxx:62
const sal_uInt16 EXC_ID_PANE
Default zoom for pagebreak preview.
Definition: xlview.hxx:70
Contains all settings for a selection in a single pane of a sheet.
Definition: xlview.hxx:105
const sal_uInt16 EXC_ZOOM_MAX
Definition: xlview.hxx:31
std::shared_ptr< XclSelectionData > XclSelectionDataRef
Definition: xlview.hxx:114
const sal_uInt16 EXC_WIN2_SELECTED
Definition: xlview.hxx:61
bool mbDefGridColor
true = Pagebreak preview; false = Normal view.
Definition: xlview.hxx:136
bool mbShowFormulas
true = Default grid color.
Definition: xlview.hxx:137
const sal_uInt16 EXC_WIN2_NORMALZOOM_DEF
Definition: xlview.hxx:65
const sal_uInt16 EXC_ID2_WINDOW2
Definition: xlview.hxx:49
const sal_uInt16 EXC_WIN1_MINIMIZED
Definition: xlview.hxx:42
XclAddress maXclCursor
Definition: xlview.hxx:107
const sal_uInt16 EXC_WIN2_PAGEBREAKMODE
Definition: xlview.hxx:63
A 2D cell range address list with Excel column and row indexes.
Definition: xladdress.hxx:101
sal_uInt16 mnCursorIdx
Selected cell ranges.
Definition: xlview.hxx:109
const sal_uInt16 EXC_WIN1_TABBAR
Definition: xlview.hxx:45
Color maGridColor
Selections of all panes.
Definition: xlview.hxx:122
const sal_uInt16 EXC_WIN2_DEFGRIDCOLOR
Definition: xlview.hxx:57
void SetDefaults()
Sets Excel default view settings.
Definition: xlview.cxx:49
const sal_uInt16 EXC_WIN1_VER_SCROLLBAR
Definition: xlview.hxx:44
const sal_uInt16 EXC_WIN2_SHOWFORMULAS
Definition: xlview.hxx:52
A 2D cell address struct with Excel column and row indexes.
Definition: xladdress.hxx:30
Excel ignores Tab color when set to this value...
Definition: xlview.hxx:89
XclTabViewData()
palette color id
Definition: xlview.cxx:38
const sal_uInt16 EXC_WIN2_SHOWZEROS
Definition: xlview.hxx:56
bool mbShowGrid
true = Show formulas instead of results.
Definition: xlview.hxx:138
Color maTabBgColor
true = Show outlines.
Definition: xlview.hxx:142
const sal_uInt16 EXC_ID_WINDOW2
Definition: xlview.hxx:50
bool mbDisplayed
true = Sheet is selected.
Definition: xlview.hxx:132
Contains all view settings for a single sheet.
Definition: xlview.hxx:117
bool HasPane(sal_uInt8 nPaneId) const
Returns true, if the specified pane (EXC_PANE_*) is available.
Definition: xlview.cxx:76
sal_uInt16 mnWinHeight
Width of the document window (twips).
Definition: xlview.hxx:94
sal_uInt16 mnPageZoom
Zoom factor for normal view.
Definition: xlview.hxx:128
::std::map< sal_uInt8, XclSelectionDataRef > XclSelectionMap
Definition: xlview.hxx:119
sal_uInt16 mnFlags
Height of the document window (twips).
Definition: xlview.hxx:95
const sal_uInt16 EXC_WIN1_HOR_SCROLLBAR
Definition: xlview.hxx:43
bool mbShowHeadings
true = Show cell grid.
Definition: xlview.hxx:139
sal_uInt16 mnWinWidth
Y position of the document window (twips).
Definition: xlview.hxx:93
sal_uInt16 mnTabBarWidth
Number of selected sheets.
Definition: xlview.hxx:99
const sal_uInt8 EXC_PANE_BOTTOMLEFT
Right, or top-right pane.
Definition: xlview.hxx:74
unsigned char sal_uInt8
bool IsDefaultTabBgColor() const
Tab Color default = (COL_AUTO )
Definition: xlview.hxx:143
const sal_uInt8 EXC_PANE_TOPLEFT
Bottom, or bottom-left pane.
Definition: xlview.hxx:75
sal_uInt8 mnActivePane
Zoom factor for current view.
Definition: xlview.hxx:130
sal_uInt16 mnXclSelectCnt
First visible sheet.
Definition: xlview.hxx:98
const sal_uInt16 EXC_WIN2_FROZEN
Definition: xlview.hxx:55
sal_uInt16 mnSplitX
First visible cell in additional panes.
Definition: xlview.hxx:125
bool mbShowZeros
true = Show column/row headings.
Definition: xlview.hxx:140
const sal_uInt16 EXC_WIN2_SHOWGRID
Definition: xlview.hxx:53
const sal_uInt16 EXC_COLOR_NOTABBG
mask for tab color
Definition: xlview.hxx:85
const sal_uInt16 EXC_WIN2_SHOWOUTLINE
Definition: xlview.hxx:59
sal_uInt16 mnFirstVisXclTab
Displayed (active) sheet.
Definition: xlview.hxx:97
const sal_uInt16 EXC_ID_SHEETEXT
Definition: xlview.hxx:83
const XclSelectionData * GetSelectionData(sal_uInt8 nPane) const
Returns the selection data, if available, otherwise 0.
Definition: xlview.cxx:89
sal_uInt16 mnCurrentZoom
Zoom factor for pagebreak preview.
Definition: xlview.hxx:129
sal_uInt16 mnWinY
X position of the document window (twips).
Definition: xlview.hxx:92
sal_uInt16 mnNormalZoom
Split Y position, or number of frozen rows.
Definition: xlview.hxx:127
XclAddress maSecondXclPos
First visible cell.
Definition: xlview.hxx:124
XclSelectionMap maSelMap
Definition: xlview.hxx:121
bool mbMirrored
true = Sheet is displayed (active).
Definition: xlview.hxx:133