xref: /trunk/main/sc/source/filter/inc/xepage.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_XEPAGE_HXX
25 #define SC_XEPAGE_HXX
26 
27 #include "xerecord.hxx"
28 #include "xlpage.hxx"
29 #include "xeroot.hxx"
30 
31 // Page settings records ======================================================
32 
33 // Header/footer --------------------------------------------------------------
34 
35 /** Represents a HEADER or FOOTER record. */
36 class XclExpHeaderFooter : public XclExpRecord
37 {
38 public:
39     explicit            XclExpHeaderFooter( sal_uInt16 nRecId, const String& rHdrString );
40 
41     virtual void        SaveXml( XclExpXmlStream& rStrm );
42 private:
43     /** Writes the header or footer string. Writes an empty record, if no header/footer present. */
44     virtual void        WriteBody( XclExpStream& rStrm );
45 
46 private:
47     String              maHdrString;        /// Header or footer contents.
48 };
49 
50 // General page settings ------------------------------------------------------
51 
52 /** Represents a SETUP record that contains common page settings. */
53 class XclExpSetup : public XclExpRecord
54 {
55 public:
56     explicit            XclExpSetup( const XclPageData& rPageData );
57 
58     virtual void        SaveXml( XclExpXmlStream& rStrm );
59 private:
60     /** Writes the contents of the SETUP record. */
61     virtual void        WriteBody( XclExpStream& rStrm );
62 
63 private:
64     const XclPageData&  mrData;             /// Page settings data of current sheet.
65 };
66 
67 // Manual page breaks ---------------------------------------------------------
68 
69 /** Stores an array of manual page breaks for columns or rows. */
70 class XclExpPageBreaks : public XclExpRecord
71 {
72 public:
73     explicit            XclExpPageBreaks(
74                             sal_uInt16 nRecId,
75                             const ScfUInt16Vec& rPageBreaks,
76                             sal_uInt16 nMaxPos );
77 
78     /** Writes the record, if the list is not empty. */
79     virtual void        Save( XclExpStream& rStrm );
80     virtual void        SaveXml( XclExpXmlStream& rStrm );
81 
82 private:
83     /** Writes the page break list. */
84     virtual void        WriteBody( XclExpStream& rStrm );
85 
86 private:
87     const ScfUInt16Vec& mrPageBreaks;       /// Page settings data of current sheet.
88     sal_uInt16          mnMaxPos;           /// Maximum row/column for BIFF8 page breaks.
89 };
90 
91 // Page settings ==============================================================
92 
93 /** Contains all page (print) settings records for a single sheet. */
94 class XclExpPageSettings : public XclExpRecordBase, protected XclExpRoot
95 {
96 public:
97     /** Creates all records containing the current page settings. */
98     explicit            XclExpPageSettings( const XclExpRoot& rRoot );
99 
100     /** Returns read-only access to the page data. */
GetPageData() const101     inline const XclPageData& GetPageData() const { return maData; }
102 
103     /** Writes all page settings records to the stream. */
104     virtual void        Save( XclExpStream& rStrm );
105     virtual void        SaveXml( XclExpXmlStream& rStrm );
106 
107 private:
108     XclPageData         maData;         /// Page settings data.
109 };
110 
111 // ----------------------------------------------------------------------------
112 
113 /** Contains all page (print) settings records for a chart object. */
114 class XclExpChartPageSettings : public XclExpRecordBase, protected XclExpRoot
115 {
116 public:
117     /** Creates all records containing the current page settings. */
118     explicit            XclExpChartPageSettings( const XclExpRoot& rRoot );
119 
120     /** Returns read-only access to the page data. */
GetPageData() const121     inline const XclPageData& GetPageData() const { return maData; }
122 
123     /** Writes all page settings records to the stream. */
124     virtual void        Save( XclExpStream& rStrm );
125 
126 private:
127     XclPageData         maData;         /// Page settings data.
128 };
129 
130 // ============================================================================
131 
132 #endif
133 
134