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