xref: /trunk/main/sc/source/filter/inc/xlpage.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_XLPAGE_HXX
25cdf0e10cSrcweir #define SC_XLPAGE_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/gen.hxx>
28cdf0e10cSrcweir #include "xltools.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir // Constants and Enumerations =================================================
31cdf0e10cSrcweir 
32cdf0e10cSrcweir // (0x0014, 0x0015) HEADER, FOOTER --------------------------------------------
33cdf0e10cSrcweir 
34cdf0e10cSrcweir const sal_uInt16 EXC_ID_HEADER              = 0x0014;
35cdf0e10cSrcweir const sal_uInt16 EXC_ID_FOOTER              = 0x0015;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir // (0x001A, 0x001B) VERTICAL-, HORIZONTALPAGEBREAKS ---------------------------
38cdf0e10cSrcweir 
39cdf0e10cSrcweir const sal_uInt16 EXC_ID_VERPAGEBREAKS       = 0x001A;
40cdf0e10cSrcweir const sal_uInt16 EXC_ID_HORPAGEBREAKS       = 0x001B;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir // (0x0026, 0x0027, 0x0028, 0x0029) LEFT-, RIGHT-, TOP-, BOTTOMMARGIN ---------
43cdf0e10cSrcweir 
44cdf0e10cSrcweir const sal_uInt16 EXC_ID_LEFTMARGIN          = 0x0026;
45cdf0e10cSrcweir const sal_uInt16 EXC_ID_RIGHTMARGIN         = 0x0027;
46cdf0e10cSrcweir const sal_uInt16 EXC_ID_TOPMARGIN           = 0x0028;
47cdf0e10cSrcweir const sal_uInt16 EXC_ID_BOTTOMMARGIN        = 0x0029;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir const sal_Int32 EXC_MARGIN_DEFAULT_LR       = 1900;     /// Left/right default margin in 1/100mm.
50cdf0e10cSrcweir const sal_Int32 EXC_MARGIN_DEFAULT_TB       = 2500;     /// Top/bottom default margin in 1/100mm.
51cdf0e10cSrcweir const sal_Int32 EXC_MARGIN_DEFAULT_HF       = 1300;     /// Header/footer default margin in 1/100mm.
52cdf0e10cSrcweir const sal_Int32 EXC_MARGIN_DEFAULT_HLR      = 1900;     /// Left/right header default margin in 1/100mm.
53cdf0e10cSrcweir const sal_Int32 EXC_MARGIN_DEFAULT_FLR      = 1900;     /// Left/right footer default margin in 1/100mm.
54cdf0e10cSrcweir 
55cdf0e10cSrcweir // (0x002A, 0x002B) PRINTHEADERS, PRINTGRIDLINES ------------------------------
56cdf0e10cSrcweir 
57cdf0e10cSrcweir const sal_uInt16 EXC_ID_PRINTHEADERS        = 0x002A;
58cdf0e10cSrcweir const sal_uInt16 EXC_ID_PRINTGRIDLINES      = 0x002B;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir // (0x0033) PRINTSIZE ---------------------------------------------------------
61cdf0e10cSrcweir 
62cdf0e10cSrcweir const sal_uInt16 EXC_ID_PRINTSIZE           = 0x0033;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir const sal_uInt16 EXC_PRINTSIZE_SCREEN       = 1;
65cdf0e10cSrcweir const sal_uInt16 EXC_PRINTSIZE_PAGE         = 2;
66cdf0e10cSrcweir const sal_uInt16 EXC_PRINTSIZE_FULL         = 3;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir // (0x0082, 0x0083, 0x0084) GRIDSET, HCENTER, VCENTER -------------------------
69cdf0e10cSrcweir 
70cdf0e10cSrcweir const sal_uInt16 EXC_ID_GRIDSET             = 0x0082;
71cdf0e10cSrcweir const sal_uInt16 EXC_ID_HCENTER             = 0x0083;
72cdf0e10cSrcweir const sal_uInt16 EXC_ID_VCENTER             = 0x0084;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir // (0x00A1) SETUP -------------------------------------------------------------
75cdf0e10cSrcweir 
76cdf0e10cSrcweir const sal_uInt16 EXC_ID_SETUP               = 0x00A1;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir const sal_uInt16 EXC_SETUP_INROWS           = 0x0001;
79cdf0e10cSrcweir const sal_uInt16 EXC_SETUP_PORTRAIT         = 0x0002;
80cdf0e10cSrcweir const sal_uInt16 EXC_SETUP_INVALID          = 0x0004;
81cdf0e10cSrcweir const sal_uInt16 EXC_SETUP_BLACKWHITE       = 0x0008;
82cdf0e10cSrcweir const sal_uInt16 EXC_SETUP_DRAFT            = 0x0010;
83cdf0e10cSrcweir const sal_uInt16 EXC_SETUP_PRINTNOTES       = 0x0020;
84cdf0e10cSrcweir const sal_uInt16 EXC_SETUP_STARTPAGE        = 0x0080;
85cdf0e10cSrcweir const sal_uInt16 EXC_SETUP_NOTES_END        = 0x0200;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir const sal_uInt16 EXC_PAPERSIZE_DEFAULT      = 0;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir // ============================================================================
90cdf0e10cSrcweir 
91cdf0e10cSrcweir // Page settings ==============================================================
92cdf0e10cSrcweir 
93cdf0e10cSrcweir class SvxBrushItem;
94cdf0e10cSrcweir class SfxPrinter;
95cdf0e10cSrcweir 
96cdf0e10cSrcweir /** Contains all page (print) settings for a single sheet. */
97cdf0e10cSrcweir struct XclPageData : ScfNoCopy
98cdf0e10cSrcweir {
99cdf0e10cSrcweir     typedef ::std::auto_ptr< SvxBrushItem > SvxBrushItemPtr;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     ScfUInt16Vec        maHorPageBreaks;    /// Horizontal page breaks.
102cdf0e10cSrcweir     ScfUInt16Vec        maVerPageBreaks;    /// Vertical page breaks.
103cdf0e10cSrcweir     SvxBrushItemPtr     mxBrushItem;        /// Background bitmap.
104cdf0e10cSrcweir     String              maHeader;           /// Excel header string (empty = off).
105cdf0e10cSrcweir     String              maFooter;           /// Excel footer string (empty = off).
106cdf0e10cSrcweir     double              mfLeftMargin;       /// Left margin in inches.
107cdf0e10cSrcweir     double              mfRightMargin;      /// Right margin in inches.
108cdf0e10cSrcweir     double              mfTopMargin;        /// Top margin in inches.
109cdf0e10cSrcweir     double              mfBottomMargin;     /// Bottom margin in inches.
110cdf0e10cSrcweir     double              mfHeaderMargin;     /// Margin main page to header.
111cdf0e10cSrcweir     double              mfFooterMargin;     /// Margin main page to footer.
112cdf0e10cSrcweir     double              mfHdrLeftMargin;    /// Left margin to header.
113cdf0e10cSrcweir     double              mfHdrRightMargin;   /// Right margin to header.
114cdf0e10cSrcweir     double              mfFtrLeftMargin;    /// Left margin to footer.
115cdf0e10cSrcweir     double              mfFtrRightMargin;   /// Right margin to footer.
116cdf0e10cSrcweir     sal_uInt16          mnPaperSize;        /// Index into paper size table.
117cdf0e10cSrcweir     sal_uInt16          mnCopies;           /// Number of copies.
118cdf0e10cSrcweir     sal_uInt16          mnStartPage;        /// Start page number.
119cdf0e10cSrcweir     sal_uInt16          mnScaling;          /// Scaling in percent.
120cdf0e10cSrcweir     sal_uInt16          mnFitToWidth;       /// Fit to number of pages in width.
121cdf0e10cSrcweir     sal_uInt16          mnFitToHeight;      /// Fit to number of pages in height.
122cdf0e10cSrcweir     sal_uInt16          mnHorPrintRes;      /// Horizontal printing resolution.
123cdf0e10cSrcweir     sal_uInt16          mnVerPrintRes;      /// Vertical printing resolution.
124cdf0e10cSrcweir     bool                mbValid;            /// false = some of the values are not valid.
125cdf0e10cSrcweir     bool                mbPortrait;         /// true = portrait; false = landscape.
126cdf0e10cSrcweir     bool                mbPrintInRows;      /// true = in rows; false = in columns.
127cdf0e10cSrcweir     bool                mbBlackWhite;       /// true = black/white; false = colors.
128cdf0e10cSrcweir     bool                mbDraftQuality;     /// true = draft; false = default quality.
129cdf0e10cSrcweir     bool                mbPrintNotes;       /// true = print notes.
130cdf0e10cSrcweir     bool                mbManualStart;      /// true = mnStartPage valid; false = automatic.
131cdf0e10cSrcweir     bool                mbFitToPages;       /// true = fit to pages; false = scale in percent.
132cdf0e10cSrcweir     bool                mbHorCenter;        /// true = centered horizontally; false = left aligned.
133cdf0e10cSrcweir     bool                mbVerCenter;        /// true = centered vertically; false = top aligned.
134cdf0e10cSrcweir     bool                mbPrintHeadings;    /// true = print column and row headings.
135cdf0e10cSrcweir     bool                mbPrintGrid;        /// true = print grid lines.
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     explicit            XclPageData();
138cdf0e10cSrcweir                         ~XclPageData();
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     /** Sets Excel default page settings. */
141cdf0e10cSrcweir     void                SetDefaults();
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     /** Returns the real paper size (twips) from the paper size index and paper orientation. */
144cdf0e10cSrcweir     Size                GetScPaperSize() const;
145cdf0e10cSrcweir     /** Sets the Excel paper size index and paper orientation from Calc paper size (twips). */
146cdf0e10cSrcweir     void                SetScPaperSize( const Size& rSize, bool bPortrait );
147cdf0e10cSrcweir };
148cdf0e10cSrcweir 
149cdf0e10cSrcweir // ============================================================================
150cdf0e10cSrcweir 
151cdf0e10cSrcweir #endif
152cdf0e10cSrcweir 
153