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