xref: /trunk/main/sc/source/filter/inc/xlpage.hxx (revision 38d50f7b)
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_XLPAGE_HXX
25 #define SC_XLPAGE_HXX
26 
27 #include <tools/gen.hxx>
28 #include "xltools.hxx"
29 
30 // Constants and Enumerations =================================================
31 
32 // (0x0014, 0x0015) HEADER, FOOTER --------------------------------------------
33 
34 const sal_uInt16 EXC_ID_HEADER              = 0x0014;
35 const sal_uInt16 EXC_ID_FOOTER              = 0x0015;
36 
37 // (0x001A, 0x001B) VERTICAL-, HORIZONTALPAGEBREAKS ---------------------------
38 
39 const sal_uInt16 EXC_ID_VERPAGEBREAKS       = 0x001A;
40 const sal_uInt16 EXC_ID_HORPAGEBREAKS       = 0x001B;
41 
42 // (0x0026, 0x0027, 0x0028, 0x0029) LEFT-, RIGHT-, TOP-, BOTTOMMARGIN ---------
43 
44 const sal_uInt16 EXC_ID_LEFTMARGIN          = 0x0026;
45 const sal_uInt16 EXC_ID_RIGHTMARGIN         = 0x0027;
46 const sal_uInt16 EXC_ID_TOPMARGIN           = 0x0028;
47 const sal_uInt16 EXC_ID_BOTTOMMARGIN        = 0x0029;
48 
49 const sal_Int32 EXC_MARGIN_DEFAULT_LR       = 1900;     /// Left/right default margin in 1/100mm.
50 const sal_Int32 EXC_MARGIN_DEFAULT_TB       = 2500;     /// Top/bottom default margin in 1/100mm.
51 const sal_Int32 EXC_MARGIN_DEFAULT_HF       = 1300;     /// Header/footer default margin in 1/100mm.
52 const sal_Int32 EXC_MARGIN_DEFAULT_HLR      = 1900;     /// Left/right header default margin in 1/100mm.
53 const sal_Int32 EXC_MARGIN_DEFAULT_FLR      = 1900;     /// Left/right footer default margin in 1/100mm.
54 
55 // (0x002A, 0x002B) PRINTHEADERS, PRINTGRIDLINES ------------------------------
56 
57 const sal_uInt16 EXC_ID_PRINTHEADERS        = 0x002A;
58 const sal_uInt16 EXC_ID_PRINTGRIDLINES      = 0x002B;
59 
60 // (0x0033) PRINTSIZE ---------------------------------------------------------
61 
62 const sal_uInt16 EXC_ID_PRINTSIZE           = 0x0033;
63 
64 const sal_uInt16 EXC_PRINTSIZE_SCREEN       = 1;
65 const sal_uInt16 EXC_PRINTSIZE_PAGE         = 2;
66 const sal_uInt16 EXC_PRINTSIZE_FULL         = 3;
67 
68 // (0x0082, 0x0083, 0x0084) GRIDSET, HCENTER, VCENTER -------------------------
69 
70 const sal_uInt16 EXC_ID_GRIDSET             = 0x0082;
71 const sal_uInt16 EXC_ID_HCENTER             = 0x0083;
72 const sal_uInt16 EXC_ID_VCENTER             = 0x0084;
73 
74 // (0x00A1) SETUP -------------------------------------------------------------
75 
76 const sal_uInt16 EXC_ID_SETUP               = 0x00A1;
77 
78 const sal_uInt16 EXC_SETUP_INROWS           = 0x0001;
79 const sal_uInt16 EXC_SETUP_PORTRAIT         = 0x0002;
80 const sal_uInt16 EXC_SETUP_INVALID          = 0x0004;
81 const sal_uInt16 EXC_SETUP_BLACKWHITE       = 0x0008;
82 const sal_uInt16 EXC_SETUP_DRAFT            = 0x0010;
83 const sal_uInt16 EXC_SETUP_PRINTNOTES       = 0x0020;
84 const sal_uInt16 EXC_SETUP_STARTPAGE        = 0x0080;
85 const sal_uInt16 EXC_SETUP_NOTES_END        = 0x0200;
86 
87 const sal_uInt16 EXC_PAPERSIZE_DEFAULT      = 0;
88 
89 // ============================================================================
90 
91 // Page settings ==============================================================
92 
93 class SvxBrushItem;
94 class SfxPrinter;
95 
96 /** Contains all page (print) settings for a single sheet. */
97 struct XclPageData : ScfNoCopy
98 {
99     typedef ::std::auto_ptr< SvxBrushItem > SvxBrushItemPtr;
100 
101     ScfUInt16Vec        maHorPageBreaks;    /// Horizontal page breaks.
102     ScfUInt16Vec        maVerPageBreaks;    /// Vertical page breaks.
103     SvxBrushItemPtr     mxBrushItem;        /// Background bitmap.
104     String              maHeader;           /// Excel header string (empty = off).
105     String              maFooter;           /// Excel footer string (empty = off).
106     double              mfLeftMargin;       /// Left margin in inches.
107     double              mfRightMargin;      /// Right margin in inches.
108     double              mfTopMargin;        /// Top margin in inches.
109     double              mfBottomMargin;     /// Bottom margin in inches.
110     double              mfHeaderMargin;     /// Margin main page to header.
111     double              mfFooterMargin;     /// Margin main page to footer.
112     double              mfHdrLeftMargin;    /// Left margin to header.
113     double              mfHdrRightMargin;   /// Right margin to header.
114     double              mfFtrLeftMargin;    /// Left margin to footer.
115     double              mfFtrRightMargin;   /// Right margin to footer.
116     sal_uInt16          mnPaperSize;        /// Index into paper size table.
117     sal_uInt16          mnCopies;           /// Number of copies.
118     sal_uInt16          mnStartPage;        /// Start page number.
119     sal_uInt16          mnScaling;          /// Scaling in percent.
120     sal_uInt16          mnFitToWidth;       /// Fit to number of pages in width.
121     sal_uInt16          mnFitToHeight;      /// Fit to number of pages in height.
122     sal_uInt16          mnHorPrintRes;      /// Horizontal printing resolution.
123     sal_uInt16          mnVerPrintRes;      /// Vertical printing resolution.
124     bool                mbValid;            /// false = some of the values are not valid.
125     bool                mbPortrait;         /// true = portrait; false = landscape.
126     bool                mbPrintInRows;      /// true = in rows; false = in columns.
127     bool                mbBlackWhite;       /// true = black/white; false = colors.
128     bool                mbDraftQuality;     /// true = draft; false = default quality.
129     bool                mbPrintNotes;       /// true = print notes.
130     bool                mbManualStart;      /// true = mnStartPage valid; false = automatic.
131     bool                mbFitToPages;       /// true = fit to pages; false = scale in percent.
132     bool                mbHorCenter;        /// true = centered horizontally; false = left aligned.
133     bool                mbVerCenter;        /// true = centered vertically; false = top aligned.
134     bool                mbPrintHeadings;    /// true = print column and row headings.
135     bool                mbPrintGrid;        /// true = print grid lines.
136 
137     explicit            XclPageData();
138                         ~XclPageData();
139 
140     /** Sets Excel default page settings. */
141     void                SetDefaults();
142 
143     /** Returns the real paper size (twips) from the paper size index and paper orientation. */
144     Size                GetScPaperSize() const;
145     /** Sets the Excel paper size index and paper orientation from Calc paper size (twips). */
146     void                SetScPaperSize( const Size& rSize, bool bPortrait );
147 };
148 
149 // ============================================================================
150 
151 #endif
152 
153