xref: /aoo4110/main/sc/source/filter/inc/xipage.hxx (revision b1cdbd2c)
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_XIPAGE_HXX
25 #define SC_XIPAGE_HXX
26 
27 #include "xlpage.hxx"
28 #include "xiroot.hxx"
29 
30 // Page settings ==============================================================
31 
32 /** Contains all page (print) settings for a single sheet.
33     @descr  Supports reading all related records and creating a page style sheet. */
34 class XclImpPageSettings : protected XclImpRoot
35 {
36 public:
37     explicit            XclImpPageSettings( const XclImpRoot& rRoot );
38 
39     /** Returns read-only access to the page data. */
GetPageData() const40     inline const XclPageData& GetPageData() const { return maData; }
41 
42     /** Initializes the object to be used for a new sheet. */
43     void                Initialize();
44 
45     /** Reads a SETUP record and inserts contained data. */
46     void                ReadSetup( XclImpStream& rStrm );
47     /** Reads a ***MARGIN record (reads all 4 margin records). */
48     void                ReadMargin( XclImpStream& rStrm );
49     /** Reads a HCENTER or VCENTER record. */
50     void                ReadCenter( XclImpStream& rStrm );
51     /** Reads a HEADER or FOOTER record. */
52     void                ReadHeaderFooter( XclImpStream& rStrm );
53     /** Reads a HORIZONTALPAGEBREAKS or VERTICALPAGEBREAKS record. */
54     void                ReadPageBreaks( XclImpStream& rStrm );
55     /** Reads a PRINTHEADERS record. */
56     void                ReadPrintHeaders( XclImpStream& rStrm );
57     /** Reads a PRINTGRIDLINES record. */
58     void                ReadPrintGridLines( XclImpStream& rStrm );
59     /** Reads an IMGDATA record and creates the SvxBrushItem. */
60     void                ReadImgData( XclImpStream& rStrm );
61 
62     /** Overrides paper size and orientation (used in sheet-charts). */
63     void                SetPaperSize( sal_uInt16 nXclPaperSize, bool bPortrait );
64     /** Sets or clears the fit-to-pages setting (contained in WSBOOL record). */
SetFitToPages(bool bFitToPages)65     inline void         SetFitToPages( bool bFitToPages ) { maData.mbFitToPages = bFitToPages; }
66 
67     /** Creates a page stylesheet from current settings and sets it at current sheet. */
68     void                Finalize();
69 
70 private:
71     XclPageData         maData;         /// Page settings data.
72     bool                mbValidPaper;   /// true = Paper size and orientation valid.
73 };
74 
75 // ============================================================================
76 
77 #endif
78 
79