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