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 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XEVIEW_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_XEVIEW_HXX
22 
23 #include "xerecord.hxx"
24 #include "xlview.hxx"
25 #include "xeroot.hxx"
26 
27 // Workbook view settings records =============================================
28 
31 {
32 public:
33  explicit XclExpWindow1( const XclExpRoot& rRoot );
34 
35  virtual void SaveXml( XclExpXmlStream& rStrm ) override;
36 
37 private:
39  virtual void WriteBody( XclExpStream& rStrm ) override;
40 
41 private:
42  sal_uInt16 mnFlags;
43  sal_uInt16 mnTabBarSize;
44 };
45 
46 // Sheet view settings records ================================================
47 
50 {
51 public:
52  explicit XclExpWindow2( const XclExpRoot& rRoot,
53  const XclTabViewData& rData, sal_uInt32 nGridColorId );
54 
55 private:
57  virtual void WriteBody( XclExpStream& rStrm ) override;
58 
59 private:
61  sal_uInt32 mnGridColorId;
62  sal_uInt16 mnFlags;
64  sal_uInt16 mnNormalZoom;
65  sal_uInt16 mnPageZoom;
66 };
67 
69 class XclExpScl : public XclExpRecord
70 {
71 public:
72  explicit XclExpScl( sal_uInt16 nZoom );
73 
74 private:
76  void Shorten( sal_uInt16 nFactor );
78  virtual void WriteBody( XclExpStream& rStrm ) override;
79 
80 private:
81  sal_uInt16 mnNum;
82  sal_uInt16 mnDenom;
83 };
84 
86 class XclExpPane : public XclExpRecord
87 {
88 public:
89  explicit XclExpPane( const XclTabViewData& rData );
90 
91  virtual void SaveXml( XclExpXmlStream& rStrm ) override;
92 
93 private:
95  virtual void WriteBody( XclExpStream& rStrm ) override;
96 
97 private:
98  sal_uInt16 mnSplitX;
99  sal_uInt32 mnSplitY;
103 };
104 
107 {
108 public:
109  explicit XclExpSelection( const XclTabViewData& rData, sal_uInt8 nPane );
110 
111  virtual void SaveXml( XclExpXmlStream& rStrm ) override;
112 private:
114  virtual void WriteBody( XclExpStream& rStrm ) override;
115 
116 private:
119 };
120 
122 {
123 public:
124  explicit XclExpTabBgColor( const XclTabViewData& rTabViewData );
125 
126  /* virtual void SaveXml( XclExpXmlStream& rStrm ); TODO Fix XML Saving Stream */
127 private:
129  virtual void WriteBody( XclExpStream& rStrm ) override;
130 
131 private:
133 };
134 
135 // View settings ==============================================================
136 
139 {
140 public:
142  explicit XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nScTab );
143 
145  virtual void Save( XclExpStream& rStrm ) override;
146  virtual void SaveXml( XclExpXmlStream& rStrm ) override;
147 
148 private:
150  void CreateSelectionData( sal_uInt8 nPane,
151  const ScAddress& rCursor, const ScRangeList& rSelection );
152 
153  void WriteWindow2( XclExpStream& rStrm ) const;
154  void WriteScl( XclExpStream& rStrm ) const;
155  void WritePane( XclExpStream& rStrm ) const;
156  void WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane ) const;
157  void WriteTabBgColor( XclExpStream& rStrm ) const;
158 
159 private:
161  sal_uInt32 mnGridColorId;
163 };
164 
165 #endif
166 
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents a PANE record containing settings for split/frozen windows.
Definition: xeview.hxx:86
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:71
XclExpPane(const XclTabViewData &rData)
Definition: xeview.cxx:161
sal_uInt32 mnSplitY
Split X position, or frozen column.
Definition: xeview.hxx:99
sal_uInt16 mnFlags
Color ID of grid color (>=BIFF8).
Definition: xeview.hxx:62
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:161
Represents a SELECTION record with selection data for a pane.
Definition: xeview.hxx:106
Access to global data from other classes.
Definition: xeroot.hxx:113
sal_uInt16 mnDenom
Numerator of the zoom factor.
Definition: xeview.hxx:82
XclSelectionData maSelData
Definition: xeview.hxx:117
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:138
Base class for all Excel records.
Definition: xerecord.hxx:39
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:105
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:65
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:30
sal_uInt16 mnNum
Definition: xeview.hxx:81
XclExpTabBgColor(const XclTabViewData &rTabViewData)
Definition: xeview.cxx:246
sal_uInt16 mnNormalZoom
First visible cell.
Definition: xeview.hxx:64
sal_uInt16 mnTabBarSize
Option flags.
Definition: xeview.hxx:43
void WriteTabBgColor(XclExpStream &rStrm) const
Definition: xeview.cxx:531
XclAddress maFirstXclPos
Option flags.
Definition: xeview.hxx:63
Represents an SCL record for the zoom factor of the current view of a sheet.
Definition: xeview.hxx:69
void WriteSelection(XclExpStream &rStrm, sal_uInt8 nPane) const
Definition: xeview.cxx:525
Contains all view settings for a single sheet.
Definition: xlview.hxx:117
sal_uInt32 mnGridColorId
Grid color (<=BIFF5).
Definition: xeview.hxx:61
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:30
XclExpScl(sal_uInt16 nZoom)
Definition: xeview.cxx:137
Color maGridColor
Definition: xeview.hxx:60
XclExpWindow2(const XclExpRoot &rRoot, const XclTabViewData &rData, sal_uInt32 nGridColorId)
Definition: xeview.cxx:88
sal_uInt16 mnFlags
Definition: xeview.hxx:42
XclTabViewData maData
Definition: xeview.hxx:160
XclAddress maSecondXclPos
Split Y position, or frozen row.
Definition: xeview.hxx:100
sal_uInt8 mnActivePane
First visible cell in additional panes.
Definition: xeview.hxx:101
bool mbHasTabSettings
Color identifier for grid color.
Definition: xeview.hxx:162
sal_uInt16 mnSplitX
Definition: xeview.hxx:98
void SvStream & rStrm
sal_uInt8 mnPane
Selection data.
Definition: xeview.hxx:118
const XclTabViewData & mrTabViewData
Definition: xeview.hxx:132
bool mbFrozenPanes
Active pane (with cell cursor).
Definition: xeview.hxx:102
Represents a WINDOW2 record with general view settings for a sheet.
Definition: xeview.hxx:49
Base class for single records with any content.
Definition: xerecord.hxx:143
sal_Int16 SCTAB
Definition: types.hxx:23
void WriteScl(XclExpStream &rStrm) const
Definition: xeview.cxx:508
XclExpWindow1(const XclExpRoot &rRoot)
Definition: xeview.cxx:35