bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / inc / paragrph.hxx
blobdb939787629c97f3e3bcfb2ba505432d8e105b58
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_PARAGRPH_HXX
20 #define INCLUDED_CUI_SOURCE_INC_PARAGRPH_HXX
22 #include <vcl/button.hxx>
23 #include <vcl/fixed.hxx>
24 #include <sfx2/tabdlg.hxx>
25 #include <svx/relfld.hxx>
26 #include <svx/paraprev.hxx>
27 #include <svx/frmdirlbox.hxx>
28 #include <vcl/lstbox.hxx>
29 #include <svx/flagsdef.hxx>
31 class SvxLineSpacingItem;
33 // class SvxStdParagraphTabPage ------------------------------------------
35 [Description]
36 With this TabPage standard attributes of a paragraph can be set
37 (indention, distance, alignment, line spacing).
39 [Items]
40 <SvxAdjustItem><SID_ATTR_PARA_ADJUST>
41 <SvxLineSpacingItem><SID_ATTR_PARA_LINESPACE>
42 <SvxULSpaceItem><SID_ATTR_ULSPACE>
43 <SvxLRSpaceItem><SID_ATTR_LRSPACE>
46 class SvxStdParagraphTabPage: public SfxTabPage
48 friend class VclPtr<SvxStdParagraphTabPage>;
49 using TabPage::DeactivatePage;
50 static const sal_uInt16 pStdRanges[];
52 private:
53 SvxStdParagraphTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
55 // indention
56 VclPtr<SvxRelativeField> m_pLeftIndent;
58 VclPtr<FixedText> m_pRightLabel;
59 VclPtr<SvxRelativeField> m_pRightIndent;
61 VclPtr<FixedText> m_pFLineLabel;
62 VclPtr<SvxRelativeField> m_pFLineIndent;
63 VclPtr<CheckBox> m_pAutoCB;
65 // distance
66 VclPtr<SvxRelativeField> m_pTopDist;
67 VclPtr<SvxRelativeField> m_pBottomDist;
68 VclPtr<CheckBox> m_pContextualCB;
70 // line spacing
71 VclPtr<ListBox> m_pLineDist;
72 VclPtr<FixedText> m_pLineDistAtLabel;
73 VclPtr<MetricField> m_pLineDistAtPercentBox;
74 VclPtr<MetricField> m_pLineDistAtMetricBox;
75 VclPtr<FixedText> m_pAbsDist;
76 OUString sAbsDist;
77 VclPtr<SvxParaPrevWindow> m_pExampleWin;
79 // only writer
80 VclPtr<VclFrame> m_pRegisterFL;
81 VclPtr<CheckBox> m_pRegisterCB;
83 long nAbst;
84 long nWidth;
85 long nMinFixDist;
86 bool bRelativeMode;
87 bool bNegativeIndents;
89 void SetLineSpacing_Impl( const SvxLineSpacingItem& rAttr );
90 void Init_Impl();
91 void UpdateExample_Impl();
93 DECL_LINK( LineDistHdl_Impl, ListBox* );
94 DECL_LINK(ModifyHdl_Impl, void *);
95 DECL_LINK( AutoHdl_Impl, CheckBox* );
97 protected:
98 virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
101 public:
102 virtual ~SvxStdParagraphTabPage();
103 virtual void dispose() SAL_OVERRIDE;
105 DECL_LINK(ELRLoseFocusHdl, void *);
107 static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
108 static const sal_uInt16* GetRanges() { return pStdRanges; }
110 virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
111 virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
114 void SetPageWidth( sal_uInt16 nPageWidth );
115 void EnableRelativeMode();
116 void EnableRegisterMode();
117 void EnableContextualMode();
118 void EnableAutoFirstLine();
119 void EnableAbsLineDist(long nMinTwip);
120 void EnableNegativeMode();
121 virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
124 // class SvxParaAlignTabPage ------------------------------------------------
126 class SvxParaAlignTabPage : public SfxTabPage
128 friend class VclPtr<SvxParaAlignTabPage>;
129 using TabPage::DeactivatePage;
130 static const sal_uInt16 pAlignRanges[];
132 // alignment
133 VclPtr<RadioButton> m_pLeft;
134 VclPtr<RadioButton> m_pRight;
135 VclPtr<RadioButton> m_pCenter;
136 VclPtr<RadioButton> m_pJustify;
137 VclPtr<FixedText> m_pLeftBottom;
138 VclPtr<FixedText> m_pRightTop;
140 VclPtr<FixedText> m_pLastLineFT;
141 VclPtr<ListBox> m_pLastLineLB;
142 VclPtr<CheckBox> m_pExpandCB;
144 VclPtr<CheckBox> m_pSnapToGridCB;
146 //preview
147 VclPtr<SvxParaPrevWindow> m_pExampleWin;
148 //vertical alignment
149 VclPtr<VclFrame> m_pVertAlignFL;
150 VclPtr<ListBox> m_pVertAlignLB;
152 VclPtr<VclFrame> m_pPropertiesFL;
153 VclPtr<svx::FrameDirectionListBox> m_pTextDirectionLB;
155 DECL_LINK(AlignHdl_Impl, void *);
156 DECL_LINK(LastLineHdl_Impl, void *);
157 DECL_LINK(TextDirectionHdl_Impl, void *);
159 void UpdateExample_Impl();
161 SvxParaAlignTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
163 protected:
164 virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
166 public:
167 virtual ~SvxParaAlignTabPage();
168 virtual void dispose() SAL_OVERRIDE;
170 static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
171 static const sal_uInt16* GetRanges() { return pAlignRanges; }
173 virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
174 virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
176 void EnableJustifyExt();
177 virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
180 // class SvxExtParagraphTabPage ------------------------------------------
182 [Description]
183 With this TabPage special attributes of a paragraph can be set
184 (hyphenation, pagebreak, orphan, widow, ...).
186 [Items]
187 <SvxHyphenZoneItem><SID_ATTR_PARA_HYPHENZONE>
188 <SvxFormatBreakItem><SID_ATTR_PARA_PAGEBREAK>
189 <SvxFormatSplitItem><SID_ATTR_PARA_SPLIT>
190 <SvxWidowsItem><SID_ATTR_PARA_WIDOWS>
191 <SvxOrphansItem><SID_ATTR_PARA_ORPHANS>
194 class SvxExtParagraphTabPage: public SfxTabPage
196 friend class VclPtr<SvxExtParagraphTabPage>;
197 using TabPage::DeactivatePage;
198 static const sal_uInt16 pExtRanges[];
200 public:
201 virtual ~SvxExtParagraphTabPage();
202 virtual void dispose() SAL_OVERRIDE;
204 static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
205 const SfxItemSet* rSet );
206 static const sal_uInt16* GetRanges() { return pExtRanges; }
208 virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
209 virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
211 void DisablePageBreak();
213 protected:
214 virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
216 private:
217 SvxExtParagraphTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
219 // hyphenation
220 VclPtr<TriStateBox> m_pHyphenBox;
221 VclPtr<FixedText> m_pBeforeText;
222 VclPtr<NumericField> m_pExtHyphenBeforeBox;
223 VclPtr<FixedText> m_pAfterText;
224 VclPtr<NumericField> m_pExtHyphenAfterBox;
225 VclPtr<FixedText> m_pMaxHyphenLabel;
226 VclPtr<NumericField> m_pMaxHyphenEdit;
228 // pagebreak
229 VclPtr<TriStateBox> m_pPageBreakBox;
230 VclPtr<FixedText> m_pBreakTypeFT;
231 VclPtr<ListBox> m_pBreakTypeLB;
232 VclPtr<FixedText> m_pBreakPositionFT;
233 VclPtr<ListBox> m_pBreakPositionLB;
234 VclPtr<TriStateBox> m_pApplyCollBtn;
235 VclPtr<ListBox> m_pApplyCollBox;
236 VclPtr<FixedText> m_pPagenumText;
237 VclPtr<NumericField> m_pPagenumEdit;
239 // paragraph division
240 VclPtr<TriStateBox> m_pKeepTogetherBox;
241 VclPtr<TriStateBox> m_pKeepParaBox;
243 // orphan/widow
244 VclPtr<TriStateBox> m_pOrphanBox;
245 VclPtr<NumericField> m_pOrphanRowNo;
246 VclPtr<FixedText> m_pOrphanRowLabel;
248 VclPtr<TriStateBox> m_pWidowBox;
249 VclPtr<NumericField> m_pWidowRowNo;
250 VclPtr<FixedText> m_pWidowRowLabel;
252 bool bPageBreak;
253 bool bHtmlMode;
254 sal_uInt16 nStdPos;
256 DECL_LINK(PageBreakHdl_Impl, void *);
257 DECL_LINK(KeepTogetherHdl_Impl, void *);
258 DECL_LINK(WidowHdl_Impl, void *);
259 DECL_LINK(OrphanHdl_Impl, void *);
260 DECL_LINK(HyphenClickHdl_Impl, void *);
261 DECL_LINK(ApplyCollClickHdl_Impl, void *);
262 DECL_LINK( PageBreakPosHdl_Impl, ListBox* );
263 DECL_LINK( PageBreakTypeHdl_Impl, ListBox* );
265 virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
269 class SvxAsianTabPage : public SfxTabPage
271 friend class VclPtr<SvxAsianTabPage>;
273 VclPtr<CheckBox> m_pForbiddenRulesCB;
274 VclPtr<CheckBox> m_pHangingPunctCB;
275 VclPtr<CheckBox> m_pScriptSpaceCB;
277 SvxAsianTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
279 DECL_STATIC_LINK( SvxAsianTabPage, ClickHdl_Impl, CheckBox* );
281 public:
282 virtual ~SvxAsianTabPage();
283 virtual void dispose() SAL_OVERRIDE;
285 static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
286 const SfxItemSet* rSet );
287 static const sal_uInt16* GetRanges();
289 virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
290 virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
294 #endif // INCLUDED_CUI_SOURCE_INC_PARAGRPH_HXX
297 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */