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