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