LibreOffice Module sc (master) 1
xeview.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 "xerecord.hxx"
23#include "xlview.hxx"
24#include "xeroot.hxx"
25
26// Workbook view settings records =============================================
27
30{
31public:
32 explicit XclExpWindow1( const XclExpRoot& rRoot );
33
34 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
35
36private:
38 virtual void WriteBody( XclExpStream& rStrm ) override;
39
40private:
41 sal_uInt16 mnFlags;
42 sal_uInt16 mnTabBarSize;
43};
44
45// Sheet view settings records ================================================
46
49{
50public:
51 explicit XclExpWindow2( const XclExpRoot& rRoot,
52 const XclTabViewData& rData, sal_uInt32 nGridColorId );
53
54private:
56 virtual void WriteBody( XclExpStream& rStrm ) override;
57
58private:
60 sal_uInt32 mnGridColorId;
61 sal_uInt16 mnFlags;
63 sal_uInt16 mnNormalZoom;
64 sal_uInt16 mnPageZoom;
65};
66
68class XclExpScl : public XclExpRecord
69{
70public:
71 explicit XclExpScl( sal_uInt16 nZoom );
72
73private:
75 void Shorten( sal_uInt16 nFactor );
77 virtual void WriteBody( XclExpStream& rStrm ) override;
78
79private:
80 sal_uInt16 mnNum;
81 sal_uInt16 mnDenom;
82};
83
86{
87public:
88 explicit XclExpPane( const XclTabViewData& rData );
89
90 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
91
92private:
94 virtual void WriteBody( XclExpStream& rStrm ) override;
95
96private:
97 sal_uInt16 mnSplitX;
98 sal_uInt32 mnSplitY;
102};
103
106{
107public:
108 explicit XclExpSelection( const XclTabViewData& rData, sal_uInt8 nPane );
109
110 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
111private:
113 virtual void WriteBody( XclExpStream& rStrm ) override;
114
115private:
118};
119
121{
122public:
123 explicit XclExpTabBgColor( const XclTabViewData& rTabViewData );
124
125 /* virtual void SaveXml( XclExpXmlStream& rStrm ); TODO Fix XML Saving Stream */
126private:
128 virtual void WriteBody( XclExpStream& rStrm ) override;
129
130private:
132};
133
134// View settings ==============================================================
135
138{
139public:
141 explicit XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nScTab );
142
144 virtual void Save( XclExpStream& rStrm ) override;
145 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
146
147private:
149 void CreateSelectionData( sal_uInt8 nPane,
150 const ScAddress& rCursor, const ScRangeList& rSelection );
151
152 void WriteWindow2( XclExpStream& rStrm ) const;
153 void WriteScl( XclExpStream& rStrm ) const;
154 void WritePane( XclExpStream& rStrm ) const;
155 void WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane ) const;
156 void WriteTabBgColor( XclExpStream& rStrm ) const;
157
158private:
160 sal_uInt32 mnGridColorId;
162};
163
164/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents a PANE record containing settings for split/frozen windows.
Definition: xeview.hxx:86
XclExpPane(const XclTabViewData &rData)
Definition: xeview.cxx:161
sal_uInt32 mnSplitY
Split X position, or frozen column.
Definition: xeview.hxx:98
sal_uInt16 mnSplitX
Definition: xeview.hxx:97
sal_uInt8 mnActivePane
First visible cell in additional panes.
Definition: xeview.hxx:100
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the PANE record.
Definition: xeview.cxx:194
bool mbFrozenPanes
Active pane (with cell cursor).
Definition: xeview.hxx:101
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeview.cxx:184
XclAddress maSecondXclPos
Split Y position, or frozen row.
Definition: xeview.hxx:99
Base class for all Excel records.
Definition: xerecord.hxx:39
Base class for single records with any content.
Definition: xerecord.hxx:143
Access to global data from other classes.
Definition: xeroot.hxx:113
Represents an SCL record for the zoom factor of the current view of a sheet.
Definition: xeview.hxx:69
XclExpScl(sal_uInt16 nZoom)
Definition: xeview.cxx:137
sal_uInt16 mnNum
Definition: xeview.hxx:80
sal_uInt16 mnDenom
Numerator of the zoom factor.
Definition: xeview.hxx:81
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SCL record.
Definition: xeview.cxx:155
void Shorten(sal_uInt16 nFactor)
Tries to shorten numerator and denominator by the passed value.
Definition: xeview.cxx:146
Represents a SELECTION record with selection data for a pane.
Definition: xeview.hxx:106
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeview.cxx:229
XclExpSelection(const XclTabViewData &rData, sal_uInt8 nPane)
Definition: xeview.cxx:204
sal_uInt8 mnPane
Selection data.
Definition: xeview.hxx:117
XclSelectionData maSelData
Definition: xeview.hxx:116
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SELECTION record.
Definition: xeview.cxx:238
This class is used to export Excel record streams.
Definition: xestream.hxx:73
XclExpTabBgColor(const XclTabViewData &rTabViewData)
Definition: xeview.cxx:246
const XclTabViewData & mrTabViewData
Definition: xeview.hxx:131
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SHEETEXT record.
Definition: xeview.cxx:256
Contains all view settings records for a single sheet.
Definition: xeview.hxx:138
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeview.cxx:418
void WriteSelection(XclExpStream &rStrm, sal_uInt8 nPane) const
Definition: xeview.cxx:525
virtual void Save(XclExpStream &rStrm) override
Writes all view settings records to the stream.
Definition: xeview.cxx:393
void WriteScl(XclExpStream &rStrm) const
Definition: xeview.cxx:508
void WriteWindow2(XclExpStream &rStrm) const
Definition: xeview.cxx:500
sal_uInt32 mnGridColorId
All view settings for a sheet.
Definition: xeview.hxx:160
void WritePane(XclExpStream &rStrm) const
Definition: xeview.cxx:514
void CreateSelectionData(sal_uInt8 nPane, const ScAddress &rCursor, const ScRangeList &rSelection)
Creates selection data for the specified pane.
Definition: xeview.cxx:474
void WriteTabBgColor(XclExpStream &rStrm) const
Definition: xeview.cxx:531
XclTabViewData maData
Definition: xeview.hxx:159
XclExpTabViewSettings(const XclExpRoot &rRoot, SCTAB nScTab)
Creates all records containing the view settings of the specified sheet.
Definition: xeview.cxx:286
bool mbHasTabSettings
Color identifier for grid color.
Definition: xeview.hxx:161
Represents the WINDOW1 record containing global workbook view settings.
Definition: xeview.hxx:30
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xeview.cxx:50
sal_uInt16 mnTabBarSize
Option flags.
Definition: xeview.hxx:42
sal_uInt16 mnFlags
Definition: xeview.hxx:41
XclExpWindow1(const XclExpRoot &rRoot)
Definition: xeview.cxx:35
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the WINDOW1 record.
Definition: xeview.cxx:71
Represents a WINDOW2 record with general view settings for a sheet.
Definition: xeview.hxx:49
sal_uInt16 mnPageZoom
Zoom factor for normal view.
Definition: xeview.hxx:64
XclExpWindow2(const XclExpRoot &rRoot, const XclTabViewData &rData, sal_uInt32 nGridColorId)
Definition: xeview.cxx:88
sal_uInt16 mnFlags
Color ID of grid color (>=BIFF8).
Definition: xeview.hxx:61
sal_uInt32 mnGridColorId
Grid color (<=BIFF5).
Definition: xeview.hxx:60
XclAddress maFirstXclPos
Option flags.
Definition: xeview.hxx:62
sal_uInt16 mnNormalZoom
First visible cell.
Definition: xeview.hxx:63
Color maGridColor
Definition: xeview.hxx:59
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the WINDOW2 record.
Definition: xeview.cxx:112
void SvStream & rStrm
A 2D cell address struct with Excel column and row indexes.
Definition: xladdress.hxx:30
Contains all settings for a selection in a single pane of a sheet.
Definition: xlview.hxx:105
Contains all view settings for a single sheet.
Definition: xlview.hxx:117
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22