Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_XEVIEW_HXX
30 : : #define SC_XEVIEW_HXX
31 : :
32 : : #include "xerecord.hxx"
33 : : #include "xlview.hxx"
34 : : #include "xeroot.hxx"
35 : :
36 : : // Workbook view settings records =============================================
37 : :
38 : : /** Represents the WINDOW1 record containing global workbook view settings. */
39 [ # # ]: 0 : class XclExpWindow1 : public XclExpRecord
40 : : {
41 : : public:
42 : : explicit XclExpWindow1( const XclExpRoot& rRoot );
43 : :
44 : : virtual void SaveXml( XclExpXmlStream& rStrm );
45 : :
46 : : private:
47 : : /** Writes the contents of the WINDOW1 record. */
48 : : virtual void WriteBody( XclExpStream& rStrm );
49 : :
50 : : private:
51 : : sal_uInt16 mnFlags; /// Option flags.
52 : : sal_uInt16 mnTabBarSize; /// Size of tabbar relative to window width (per mill).
53 : : };
54 : :
55 : : // Sheet view settings records ================================================
56 : :
57 : : /** Represents a WINDOW2 record with general view settings for a sheet. */
58 [ # # ]: 0 : class XclExpWindow2 : public XclExpRecord
59 : : {
60 : : public:
61 : : explicit XclExpWindow2( const XclExpRoot& rRoot,
62 : : const XclTabViewData& rData, sal_uInt32 nGridColorId );
63 : :
64 : : private:
65 : : /** Writes the contents of the WINDOW2 record. */
66 : : virtual void WriteBody( XclExpStream& rStrm );
67 : :
68 : : private:
69 : : Color maGridColor; /// Grid color (<=BIFF5).
70 : : sal_uInt32 mnGridColorId; /// Color ID of grid color (>=BIFF8).
71 : : sal_uInt16 mnFlags; /// Option flags.
72 : : XclAddress maFirstXclPos; /// First visible cell.
73 : : sal_uInt16 mnNormalZoom; /// Zoom factor for normal view.
74 : : sal_uInt16 mnPageZoom; /// Zoom factor for pagebreak preview.
75 : : };
76 : :
77 : : // ----------------------------------------------------------------------------
78 : :
79 : : /** Represents an SCL record for the zoom factor of the current view of a sheet. */
80 [ # # ]: 0 : class XclExpScl : public XclExpRecord
81 : : {
82 : : public:
83 : : explicit XclExpScl( sal_uInt16 nZoom );
84 : :
85 : : private:
86 : : /** Tries to shorten numerator and denominator by the passed value. */
87 : : void Shorten( sal_uInt16 nFactor );
88 : : /** Writes the contents of the SCL record. */
89 : : virtual void WriteBody( XclExpStream& rStrm );
90 : :
91 : : private:
92 : : sal_uInt16 mnNum; /// Numerator of the zoom factor.
93 : : sal_uInt16 mnDenom; /// Denominator of the zoom factor.
94 : : };
95 : :
96 : : // ----------------------------------------------------------------------------
97 : :
98 : : /** Represents a PANE record containing settings for split/frozen windows. */
99 [ # # ]: 0 : class XclExpPane : public XclExpRecord
100 : : {
101 : : public:
102 : : explicit XclExpPane( const XclTabViewData& rData );
103 : :
104 : : virtual void SaveXml( XclExpXmlStream& rStrm );
105 : :
106 : : private:
107 : : /** Writes the contents of the PANE record. */
108 : : virtual void WriteBody( XclExpStream& rStrm );
109 : :
110 : : private:
111 : : sal_uInt16 mnSplitX; /// Split X position, or frozen column.
112 : : sal_uInt32 mnSplitY; /// Split Y position, or frozen row.
113 : : XclAddress maSecondXclPos; /// First visible cell in additional panes.
114 : : sal_uInt8 mnActivePane; /// Active pane (with cell cursor).
115 : : };
116 : :
117 : : // ----------------------------------------------------------------------------
118 : :
119 : : /** Represents a SELECTION record with selection data for a pane. */
120 [ # # ]: 0 : class XclExpSelection : public XclExpRecord
121 : : {
122 : : public:
123 : : explicit XclExpSelection( const XclTabViewData& rData, sal_uInt8 nPane );
124 : :
125 : : virtual void SaveXml( XclExpXmlStream& rStrm );
126 : : private:
127 : : /** Writes the contents of the SELECTION record. */
128 : : virtual void WriteBody( XclExpStream& rStrm );
129 : :
130 : : private:
131 : : XclSelectionData maSelData; /// Selection data.
132 : : sal_uInt8 mnPane; /// Pane identifier of this selection.
133 : : };
134 : :
135 [ # # ]: 0 : class XclExpTabBgColor : public XclExpRecord
136 : : {
137 : : public:
138 : : explicit XclExpTabBgColor( const XclTabViewData& rTabViewData );
139 : :
140 : : /* virtual void SaveXml( XclExpXmlStream& rStrm ); TODO Fix XML Saving Stream */
141 : : private:
142 : : /** Writes the contents of the SHEETEXT record. */
143 : : virtual void WriteBody( XclExpStream& rStrm );
144 : :
145 : : private:
146 : : const XclTabViewData& mrTabViewData; /// view settings data of current sheet.
147 : : };
148 : :
149 : : // View settings ==============================================================
150 : :
151 : : /** Contains all view settings records for a single sheet. */
152 [ # # ][ # # ]: 0 : class XclExpTabViewSettings : public XclExpRecordBase, protected XclExpRoot
[ # # ]
153 : : {
154 : : public:
155 : : /** Creates all records containing the view settings of the specified sheet. */
156 : : explicit XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nScTab );
157 : :
158 : : /** Writes all view settings records to the stream. */
159 : : virtual void Save( XclExpStream& rStrm );
160 : : virtual void SaveXml( XclExpXmlStream& rStrm );
161 : :
162 : : private:
163 : : /** Creates selection data for the specified pane. */
164 : : void CreateSelectionData( sal_uInt8 nPane,
165 : : const ScAddress& rCursor, const ScRangeList& rSelection );
166 : :
167 : : void WriteWindow2( XclExpStream& rStrm ) const;
168 : : void WriteScl( XclExpStream& rStrm ) const;
169 : : void WritePane( XclExpStream& rStrm ) const;
170 : : void WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane ) const;
171 : : void WriteTabBgColor( XclExpStream& rStrm ) const;
172 : :
173 : : private:
174 : : XclTabViewData maData; /// All view settings for a sheet.
175 : : sal_uInt32 mnGridColorId; /// Color identifier for grid color.
176 : : };
177 : :
178 : : // ============================================================================
179 : :
180 : : #endif
181 : :
182 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|