xref: /aoo42x/main/sc/source/filter/inc/xlpage.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_XLPAGE_HXX
29 #define SC_XLPAGE_HXX
30 
31 #include <tools/gen.hxx>
32 #include "xltools.hxx"
33 
34 // Constants and Enumerations =================================================
35 
36 // (0x0014, 0x0015) HEADER, FOOTER --------------------------------------------
37 
38 const sal_uInt16 EXC_ID_HEADER              = 0x0014;
39 const sal_uInt16 EXC_ID_FOOTER              = 0x0015;
40 
41 // (0x001A, 0x001B) VERTICAL-, HORIZONTALPAGEBREAKS ---------------------------
42 
43 const sal_uInt16 EXC_ID_VERPAGEBREAKS       = 0x001A;
44 const sal_uInt16 EXC_ID_HORPAGEBREAKS       = 0x001B;
45 
46 // (0x0026, 0x0027, 0x0028, 0x0029) LEFT-, RIGHT-, TOP-, BOTTOMMARGIN ---------
47 
48 const sal_uInt16 EXC_ID_LEFTMARGIN          = 0x0026;
49 const sal_uInt16 EXC_ID_RIGHTMARGIN         = 0x0027;
50 const sal_uInt16 EXC_ID_TOPMARGIN           = 0x0028;
51 const sal_uInt16 EXC_ID_BOTTOMMARGIN        = 0x0029;
52 
53 const sal_Int32 EXC_MARGIN_DEFAULT_LR       = 1900;     /// Left/right default margin in 1/100mm.
54 const sal_Int32 EXC_MARGIN_DEFAULT_TB       = 2500;     /// Top/bottom default margin in 1/100mm.
55 const sal_Int32 EXC_MARGIN_DEFAULT_HF       = 1300;     /// Header/footer default margin in 1/100mm.
56 const sal_Int32 EXC_MARGIN_DEFAULT_HLR      = 1900;     /// Left/right header default margin in 1/100mm.
57 const sal_Int32 EXC_MARGIN_DEFAULT_FLR      = 1900;     /// Left/right footer default margin in 1/100mm.
58 
59 // (0x002A, 0x002B) PRINTHEADERS, PRINTGRIDLINES ------------------------------
60 
61 const sal_uInt16 EXC_ID_PRINTHEADERS        = 0x002A;
62 const sal_uInt16 EXC_ID_PRINTGRIDLINES      = 0x002B;
63 
64 // (0x0033) PRINTSIZE ---------------------------------------------------------
65 
66 const sal_uInt16 EXC_ID_PRINTSIZE           = 0x0033;
67 
68 const sal_uInt16 EXC_PRINTSIZE_SCREEN       = 1;
69 const sal_uInt16 EXC_PRINTSIZE_PAGE         = 2;
70 const sal_uInt16 EXC_PRINTSIZE_FULL         = 3;
71 
72 // (0x0082, 0x0083, 0x0084) GRIDSET, HCENTER, VCENTER -------------------------
73 
74 const sal_uInt16 EXC_ID_GRIDSET             = 0x0082;
75 const sal_uInt16 EXC_ID_HCENTER             = 0x0083;
76 const sal_uInt16 EXC_ID_VCENTER             = 0x0084;
77 
78 // (0x00A1) SETUP -------------------------------------------------------------
79 
80 const sal_uInt16 EXC_ID_SETUP               = 0x00A1;
81 
82 const sal_uInt16 EXC_SETUP_INROWS           = 0x0001;
83 const sal_uInt16 EXC_SETUP_PORTRAIT         = 0x0002;
84 const sal_uInt16 EXC_SETUP_INVALID          = 0x0004;
85 const sal_uInt16 EXC_SETUP_BLACKWHITE       = 0x0008;
86 const sal_uInt16 EXC_SETUP_DRAFT            = 0x0010;
87 const sal_uInt16 EXC_SETUP_PRINTNOTES       = 0x0020;
88 const sal_uInt16 EXC_SETUP_STARTPAGE        = 0x0080;
89 const sal_uInt16 EXC_SETUP_NOTES_END        = 0x0200;
90 
91 const sal_uInt16 EXC_PAPERSIZE_DEFAULT      = 0;
92 
93 // ============================================================================
94 
95 // Page settings ==============================================================
96 
97 class SvxBrushItem;
98 class SfxPrinter;
99 
100 /** Contains all page (print) settings for a single sheet. */
101 struct XclPageData : ScfNoCopy
102 {
103     typedef ::std::auto_ptr< SvxBrushItem > SvxBrushItemPtr;
104 
105     ScfUInt16Vec        maHorPageBreaks;    /// Horizontal page breaks.
106     ScfUInt16Vec        maVerPageBreaks;    /// Vertical page breaks.
107     SvxBrushItemPtr     mxBrushItem;        /// Background bitmap.
108     String              maHeader;           /// Excel header string (empty = off).
109     String              maFooter;           /// Excel footer string (empty = off).
110     double              mfLeftMargin;       /// Left margin in inches.
111     double              mfRightMargin;      /// Right margin in inches.
112     double              mfTopMargin;        /// Top margin in inches.
113     double              mfBottomMargin;     /// Bottom margin in inches.
114     double              mfHeaderMargin;     /// Margin main page to header.
115     double              mfFooterMargin;     /// Margin main page to footer.
116     double              mfHdrLeftMargin;    /// Left margin to header.
117     double              mfHdrRightMargin;   /// Right margin to header.
118     double              mfFtrLeftMargin;    /// Left margin to footer.
119     double              mfFtrRightMargin;   /// Right margin to footer.
120     sal_uInt16          mnPaperSize;        /// Index into paper size table.
121     sal_uInt16          mnCopies;           /// Number of copies.
122     sal_uInt16          mnStartPage;        /// Start page number.
123     sal_uInt16          mnScaling;          /// Scaling in percent.
124     sal_uInt16          mnFitToWidth;       /// Fit to number of pages in width.
125     sal_uInt16          mnFitToHeight;      /// Fit to number of pages in height.
126     sal_uInt16          mnHorPrintRes;      /// Horizontal printing resolution.
127     sal_uInt16          mnVerPrintRes;      /// Vertical printing resolution.
128     bool                mbValid;            /// false = some of the values are not valid.
129     bool                mbPortrait;         /// true = portrait; false = landscape.
130     bool                mbPrintInRows;      /// true = in rows; false = in columns.
131     bool                mbBlackWhite;       /// true = black/white; false = colors.
132     bool                mbDraftQuality;     /// true = draft; false = default quality.
133     bool                mbPrintNotes;       /// true = print notes.
134     bool                mbManualStart;      /// true = mnStartPage valid; false = automatic.
135     bool                mbFitToPages;       /// true = fit to pages; false = scale in percent.
136     bool                mbHorCenter;        /// true = centered horizontally; false = left aligned.
137     bool                mbVerCenter;        /// true = centered vertically; false = top aligned.
138     bool                mbPrintHeadings;    /// true = print column and row headings.
139     bool                mbPrintGrid;        /// true = print grid lines.
140 
141     explicit            XclPageData();
142                         ~XclPageData();
143 
144     /** Sets Excel default page settings. */
145     void                SetDefaults();
146 
147     /** Returns the real paper size (twips) from the paper size index and paper orientation. */
148     Size                GetScPaperSize() const;
149     /** Sets the Excel paper size index and paper orientation from Calc paper size (twips). */
150     void                SetScPaperSize( const Size& rSize, bool bPortrait );
151 };
152 
153 // ============================================================================
154 
155 #endif
156 
157