bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / inc / page.hxx
blobc7b6436e551dfa2f15539387d92bd88ad04b6047
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 INCLUDED_CUI_SOURCE_INC_PAGE_HXX
20 #define INCLUDED_CUI_SOURCE_INC_PAGE_HXX
22 #include <sfx2/tabdlg.hxx>
23 #include <vcl/field.hxx>
24 #include <vcl/fixed.hxx>
25 #include <vcl/group.hxx>
26 #include <vcl/lstbox.hxx>
27 #include <svtools/stdctrl.hxx>
28 #include <svx/pagectrl.hxx>
29 #include <svx/frmdirlbox.hxx>
30 #include <editeng/svxenum.hxx>
31 #include <i18nutil/paper.hxx>
32 #include <svx/flagsdef.hxx>
34 // class SvxPageDescPage -------------------------------------------------
36 [Description]
37 TabPage for page settings (size, margins, ...)
39 [Items]
40 <SvxPageItem>: <SID_ATTR_PAGE>
41 <SvxSizeItem>: <SID_ATTR_SIZE>
42 <SvxSizeItem>: <SID_ATTR_MAXSIZE>
43 <SvxULSpaceItem>: <SID_ATTR_LRSPACE>
44 <SvxLRSpaceItem>: <SID_ATTR_ULSPACE>
45 <SfxAllEnumItem>: <SID_ATTR_PAPERTRAY>
46 <SvxPaperBinItem>: <SID_ATTR_PAPERBIN>
47 <SvxBoolItem>: <SID_ATTR_EXT1>
48 <SvxBoolItem>: <SID_ATTR_EXT2>
50 <SfxSetItem>: <SID_ATTR_HEADERSET>
51 <SfxBoolItem>: <SID_ATTR_ON>
52 <SfxBoolItem>: <SID_ATTR_DYNAMIC>
53 <SfxBoolItem>: <SID_ATTR_SHARED>
54 <SvxSizeItem>: <SID_ATTR_SIZE>
55 <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
56 <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
58 <SfxSetItem>: <SID_ATTR_FOOTERSET>
59 <SfxBoolItem>: <SID_ATTR_ON>
60 <SfxBoolItem>: <SID_ATTR_DYNAMIC>
61 <SfxBoolItem>: <SID_ATTR_SHARED>
62 <SvxSizeItem>: <SID_ATTR_SIZE>
63 <SvxULSpaceItem>: <SID_ATTR_ULSPACE>
64 <SvxLRSpaceItem>: <SID_ATTR_LRSPACE>
67 //UUUU struct SvxPage_Impl;
68 typedef sal_uInt16 MarginPosition;
70 class SvxPageDescPage : public SfxTabPage
72 friend class VclPtr<SvxPageDescPage>;
73 using TabPage::ActivatePage;
74 using TabPage::DeactivatePage;
76 static const sal_uInt16 pRanges[];
77 private:
78 // paper format
79 VclPtr<ListBox> m_pPaperSizeBox;
81 VclPtr<MetricField> m_pPaperWidthEdit;
82 VclPtr<MetricField> m_pPaperHeightEdit;
84 VclPtr<FixedText> m_pOrientationFT;
85 VclPtr<RadioButton> m_pPortraitBtn;
86 VclPtr<RadioButton> m_pLandscapeBtn;
88 VclPtr<SvxPageWindow> m_pBspWin;
90 VclPtr<FixedText> m_pTextFlowLbl;
91 VclPtr<svx::FrameDirectionListBox> m_pTextFlowBox;
93 VclPtr<ListBox> m_pPaperTrayBox;
95 // Margins
96 VclPtr<FixedText> m_pLeftMarginLbl;
97 VclPtr<MetricField> m_pLeftMarginEdit;
98 VclPtr<FixedText> m_pRightMarginLbl;
99 VclPtr<MetricField> m_pRightMarginEdit;
100 VclPtr<MetricField> m_pTopMarginEdit;
101 VclPtr<MetricField> m_pBottomMarginEdit;
103 // layout settings
104 VclPtr<FixedText> m_pPageText;
105 VclPtr<ListBox> m_pLayoutBox;
106 VclPtr<ListBox> m_pNumberFormatBox;
108 //Extras Calc
109 VclPtr<FixedText> m_pTblAlignFT;
110 VclPtr<CheckBox> m_pHorzBox;
111 VclPtr<CheckBox> m_pVertBox;
113 // Impress and Draw
114 VclPtr<CheckBox> m_pAdaptBox;
116 //Register Writer
117 VclPtr<CheckBox> m_pRegisterCB;
118 VclPtr<FixedText> m_pRegisterFT;
119 VclPtr<ListBox> m_pRegisterLB;
121 OUString sStandardRegister;
123 VclPtr<FixedText> m_pInsideLbl;
124 VclPtr<FixedText> m_pOutsideLbl;
125 VclPtr<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 bool bLandscape;
137 bool bBorderModified;
138 SvxModeType eMode;
139 Paper ePaperStart;
140 Paper ePaperEnd;
142 //UUUU SvxPage_Impl* pImpl;
143 MarginPosition m_nPos;
144 VclPtr<Printer> mpDefPrinter;
146 bool mbDelPrinter : 1;
148 //UUUU
149 bool mbEnableDrawingLayerFillStyles : 1;
151 void Init_Impl();
152 DECL_LINK(LayoutHdl_Impl, void *);
153 DECL_LINK(PaperBinHdl_Impl, void *);
154 DECL_LINK( SwapOrientation_Impl, RadioButton* );
155 void SwapFirstValues_Impl( bool bSet );
156 DECL_LINK(BorderModify_Impl, void *);
157 void InitHeadFoot_Impl( const SfxItemSet& rSet );
158 DECL_LINK(CenterHdl_Impl, void *);
159 void UpdateExample_Impl( bool bResetbackground = false );
161 DECL_LINK( PaperSizeSelect_Impl, ListBox* );
162 DECL_LINK(PaperSizeModify_Impl, void *);
164 DECL_LINK( FrameDirectionModify_Impl, ListBox* );
166 void ResetBackground_Impl( const SfxItemSet& rSet );
168 DECL_LINK(RangeHdl_Impl, void *);
169 void CalcMargin_Impl();
171 DECL_LINK( RegisterModify, CheckBox * );
173 // page direction
174 /** Disables vertical page direction entries in the text flow listbox. */
175 void DisableVerticalPageDir();
177 bool IsPrinterRangeOverflow( MetricField& rField, long nFirstMargin,
178 long nLastMargin, MarginPosition nPos );
179 void CheckMarginEdits( bool _bClear );
180 bool IsMarginOutOfRange();
182 SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rSet );
184 //UUUU
185 void EnableDrawingLayerFillStyles(bool bNew) { mbEnableDrawingLayerFillStyles = bNew; }
187 protected:
188 virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
189 virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
191 public:
192 static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
193 // returns the range of the Which values
194 static const sal_uInt16* GetRanges() { return pRanges; }
196 virtual bool FillItemSet( SfxItemSet* rOutSet ) SAL_OVERRIDE;
197 virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
198 virtual void FillUserData() SAL_OVERRIDE;
200 virtual ~SvxPageDescPage();
201 virtual void dispose() SAL_OVERRIDE;
203 void SetMode( SvxModeType eMType ) { eMode = eMType; }
204 void SetPaperFormatRanges( Paper eStart, Paper eEnd )
205 { ePaperStart = eStart, ePaperEnd = eEnd; }
207 void SetCollectionList(const std::vector<OUString> &aList);
208 virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
211 #endif // INCLUDED_CUI_SOURCE_INC_PAGE_HXX
213 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */