update credits
[LibreOffice.git] / cui / source / inc / page.hxx
blobb61c47ae53111e99ee811e2055dcd1f9f0cbfaf9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _SVX_PAGE_HXX
20 #define _SVX_PAGE_HXX
23 #include <sfx2/tabdlg.hxx>
24 #include <vcl/field.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/group.hxx>
27 #include <vcl/lstbox.hxx>
28 #include <svtools/stdctrl.hxx>
29 #include <svx/pagectrl.hxx>
30 #include <svx/frmdirlbox.hxx>
31 #include <editeng/svxenum.hxx>
32 #include <i18nutil/paper.hxx>
33 #include <svx/flagsdef.hxx>
35 // class SvxPageDescPage -------------------------------------------------
37 /* {k:\svx\prototyp\dialog\page.bmp}
39 [Description]
40 TabPage for page settings (size, margins, ...)
42 [Items]
43 <SvxPageItem>: <SID_ATTR_PAGE>
44 <SvxSizeItem>: <SID_ATTR_SIZE>
45 <SvxSizeItem>: <SID_ATTR_MAXSIZE>
46 <SvxULSpaceItem>: <SID_ATTR_LRSPACE>
47 <SvxLRSpaceItem>: <SID_ATTR_ULSPACE>
48 <SfxAllEnumItem>: <SID_ATTR_PAPERTRAY>
49 <SvxPaperBinItem>: <SID_ATTR_PAPERBIN>
50 <SvxBoolItem>: <SID_ATTR_EXT1>
51 <SvxBoolItem>: <SID_ATTR_EXT2>
53 <SfxSetItem>: <SID_ATTR_HEADERSET>
54 <SfxBoolItem>: <SID_ATTR_ON>
55 <SfxBoolItem>: <SID_ATTR_DYNAMIC>
56 <SfxBoolItem>: <SID_ATTR_SHARED>
57 <SvxSizeItem>: <SID_ATTR_SIZE>
58 <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
59 <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
61 <SfxSetItem>: <SID_ATTR_FOOTERSET>
62 <SfxBoolItem>: <SID_ATTR_ON>
63 <SfxBoolItem>: <SID_ATTR_DYNAMIC>
64 <SfxBoolItem>: <SID_ATTR_SHARED>
65 <SvxSizeItem>: <SID_ATTR_SIZE>
66 <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
67 <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
70 struct SvxPage_Impl;
71 typedef sal_uInt16 MarginPosition;
73 class SvxPageDescPage : public SfxTabPage
75 using TabPage::ActivatePage;
76 using TabPage::DeactivatePage;
78 // paper format
79 ListBox* m_pPaperSizeBox;
81 MetricField* m_pPaperWidthEdit;
82 MetricField* m_pPaperHeightEdit;
84 FixedText* m_pOrientationFT;
85 RadioButton* m_pPortraitBtn;
86 RadioButton* m_pLandscapeBtn;
88 SvxPageWindow* m_pBspWin;
90 FixedText* m_pTextFlowLbl;
91 svx::FrameDirectionListBox* m_pTextFlowBox;
93 ListBox* m_pPaperTrayBox;
95 // Margins
96 FixedText* m_pLeftMarginLbl;
97 MetricField* m_pLeftMarginEdit;
98 FixedText* m_pRightMarginLbl;
99 MetricField* m_pRightMarginEdit;
100 MetricField* m_pTopMarginEdit;
101 MetricField* m_pBottomMarginEdit;
103 // layout settings
104 FixedText* m_pPageText;
105 ListBox* m_pLayoutBox;
106 ListBox* m_pNumberFormatBox;
108 //Extras Calc
109 FixedText* m_pTblAlignFT;
110 CheckBox* m_pHorzBox;
111 CheckBox* m_pVertBox;
113 // Impress and Draw
114 CheckBox* m_pAdaptBox;
116 //Register Writer
117 CheckBox* m_pRegisterCB;
118 FixedText* m_pRegisterFT;
119 ListBox* m_pRegisterLB;
121 String sStandardRegister;
123 FixedText* m_pInsideLbl;
124 FixedText* m_pOutsideLbl;
125 FixedText* m_pPrintRangeQueryText;
127 long nFirstLeftMargin;
128 long nFirstRightMargin;
129 long nFirstTopMargin;
130 long nFirstBottomMargin;
131 long nLastLeftMargin;
132 long nLastRightMargin;
133 long nLastTopMargin;
134 long nLastBottomMargin;
136 Size aMaxSize;
137 sal_Bool bLandscape;
138 bool bBorderModified;
139 SvxModeType eMode;
140 Paper ePaperStart;
141 Paper ePaperEnd;
143 SvxPage_Impl* pImpl;
145 void Init_Impl();
146 DECL_LINK(LayoutHdl_Impl, void *);
147 DECL_LINK(PaperBinHdl_Impl, void *);
148 DECL_LINK( SwapOrientation_Impl, RadioButton* );
149 void SwapFirstValues_Impl( bool bSet );
150 DECL_LINK(BorderModify_Impl, void *);
151 void InitHeadFoot_Impl( const SfxItemSet& rSet );
152 DECL_LINK(CenterHdl_Impl, void *);
153 void UpdateExample_Impl( bool bResetbackground = false );
155 DECL_LINK( PaperSizeSelect_Impl, ListBox* );
156 DECL_LINK(PaperSizeModify_Impl, void *);
158 DECL_LINK( FrameDirectionModify_Impl, ListBox* );
160 void ResetBackground_Impl( const SfxItemSet& rSet );
162 DECL_LINK(RangeHdl_Impl, void *);
163 void CalcMargin_Impl();
165 DECL_LINK( RegisterModify, CheckBox * );
167 // page direction
168 /** Disables vertical page direction entries in the text flow listbox. */
169 void DisableVerticalPageDir();
171 bool IsPrinterRangeOverflow( MetricField& rField, long nFirstMargin,
172 long nLastMargin, MarginPosition nPos );
173 void CheckMarginEdits( bool _bClear );
174 bool IsMarginOutOfRange();
176 SvxPageDescPage( Window* pParent, const SfxItemSet& rSet );
178 protected:
179 virtual void ActivatePage( const SfxItemSet& rSet );
180 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
182 public:
183 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
184 static sal_uInt16* GetRanges();
186 virtual sal_Bool FillItemSet( SfxItemSet& rOutSet );
187 virtual void Reset( const SfxItemSet& rSet );
188 virtual void FillUserData();
190 virtual ~SvxPageDescPage();
192 void SetMode( SvxModeType eMType ) { eMode = eMType; }
193 void SetPaperFormatRanges( Paper eStart, Paper eEnd )
194 { ePaperStart = eStart, ePaperEnd = eEnd; }
196 void SetCollectionList(const std::vector<String> &aList);
197 virtual void PageCreated (SfxAllItemSet aSet);
200 #endif // #ifndef _SVX_PAGE_HXX
202 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */