1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_PARAGRPH_HXX
20 #define _SVX_PARAGRPH_HXX
22 #include <vcl/button.hxx>
23 #include <vcl/fixed.hxx>
24 #include <sfx2/tabdlg.hxx>
25 #include <svx/relfld.hxx> // SvxRelativeField
26 #include <svx/paraprev.hxx> // Preview
27 #include <svx/frmdirlbox.hxx>
28 #include <vcl/lstbox.hxx>
29 #include <svx/flagsdef.hxx>
31 // forward ---------------------------------------------------------------
33 class SvxLineSpacingItem
;
35 // class SvxStdParagraphTabPage ------------------------------------------
37 /* {k:\svx\prototyp\dialog\parastd.bmp}
40 With this TabPage standard attributes of a paragraph can be set
41 (indention, distance, alignment, line spacing).
44 <SvxAdjustItem><SID_ATTR_PARA_ADJUST>
45 <SvxLineSpacingItem><SID_ATTR_PARA_LINESPACE>
46 <SvxULSpaceItem><SID_ATTR_ULSPACE>
47 <SvxLRSpaceItem><SID_ATTR_LRSPACE>
50 class SvxStdParagraphTabPage
: public SfxTabPage
52 using TabPage::DeactivatePage
;
55 SvxStdParagraphTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
60 SvxRelativeField aLeftIndent
;
62 FixedText aRightLabel
;
63 SvxRelativeField aRightIndent
;
65 FixedText aFLineLabel
;
66 SvxRelativeField aFLineIndent
;
73 SvxRelativeField aTopDist
;
74 FixedText aBottomLabel
;
75 SvxRelativeField aBottomDist
;
76 CheckBox aContextualCB
;
79 FixedLine aLineDistFrm
;
81 FixedText aLineDistAtLabel
;
82 MetricField aLineDistAtPercentBox
;
83 MetricField aLineDistAtMetricBox
;
85 SvxParaPrevWindow aExampleWin
;
88 FixedLine aRegisterFL
;
91 Edit
* pActLineDistFld
;
95 sal_Bool bRelativeMode
;
96 sal_Bool bNegativeIndents
;
98 #ifdef _SVX_PARAGRPH_CXX
99 void SetLineSpacing_Impl( const SvxLineSpacingItem
& rAttr
);
101 void UpdateExample_Impl( sal_Bool bAll
= sal_False
);
103 DECL_LINK( LineDistHdl_Impl
, ListBox
* );
104 DECL_LINK(ModifyHdl_Impl
, void *);
105 DECL_LINK( AutoHdl_Impl
, CheckBox
* );
109 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );
112 DECL_LINK(ELRLoseFocusHdl
, void *);
114 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rSet
);
115 static sal_uInt16
* GetRanges();
117 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
118 virtual void Reset( const SfxItemSet
& rSet
);
121 void SetPageWidth( sal_uInt16 nPageWidth
);
122 void EnableRelativeMode();
123 void EnableRegisterMode();
124 void EnableContextualMode();
125 void EnableAutoFirstLine();
126 void EnableAbsLineDist(long nMinTwip
);
127 void EnableNegativeMode();
128 virtual void PageCreated(SfxAllItemSet aSet
);
131 // class SvxParaAlignTabPage ------------------------------------------------
133 class SvxParaAlignTabPage
: public SfxTabPage
135 using TabPage::DeactivatePage
;
142 RadioButton aJustify
;
143 FixedText aLastLineFT
;
147 CheckBox aSnapToGridCB
;
150 SvxParaPrevWindow aExampleWin
;
152 FixedLine aVertAlignFL
;
154 FixedText aVertAlignFT
;
155 ListBox aVertAlignLB
;
157 FixedLine aPropertiesFL
;
158 FixedText aTextDirectionFT
;
159 svx::FrameDirectionListBox aTextDirectionLB
;
161 #ifdef _SVX_PARAGRPH_CXX
162 DECL_LINK(AlignHdl_Impl
, void *);
163 DECL_LINK(LastLineHdl_Impl
, void *);
164 DECL_LINK(TextDirectionHdl_Impl
, void *);
166 void UpdateExample_Impl( sal_Bool bAll
= sal_False
);
169 SvxParaAlignTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
170 virtual ~SvxParaAlignTabPage();
173 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );
176 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rSet
);
177 static sal_uInt16
* GetRanges();
179 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
180 virtual void Reset( const SfxItemSet
& rSet
);
182 void EnableJustifyExt();
183 virtual void PageCreated(SfxAllItemSet aSet
);
186 // class SvxExtParagraphTabPage ------------------------------------------
188 /* {k:\svx\prototyp\dialog\paraext.bmp}
191 With this TabPage special attributes of a paragraph can be set
192 (hyphenation, pagebreak, orphan, widow, ...).
195 <SvxHyphenZoneItem><SID_ATTR_PARA_HYPHENZONE>
196 <SvxFmtBreakItem><SID_ATTR_PARA_PAGEBREAK>
197 <SvxFmtSplitItem><SID_ATTR_PARA_SPLIT>
198 <SvxWidowsItem><SID_ATTR_PARA_WIDOWS>
199 <SvxOrphansItem><SID_ATTR_PARA_ORPHANS>
202 class SvxExtParagraphTabPage
: public SfxTabPage
204 using TabPage::DeactivatePage
;
207 virtual ~SvxExtParagraphTabPage();
209 static SfxTabPage
* Create( Window
* pParent
,
210 const SfxItemSet
& rSet
);
211 static sal_uInt16
* GetRanges();
213 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
214 virtual void Reset( const SfxItemSet
& rSet
);
216 void DisablePageBreak();
219 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );
222 SvxExtParagraphTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
226 TriStateBox aHyphenBox
;
227 FixedText aBeforeText
;
228 NumericField aExtHyphenBeforeBox
;
229 FixedText aAfterText
;
230 NumericField aExtHyphenAfterBox
;
231 FixedText aMaxHyphenLabel
;
232 NumericField aMaxHyphenEdit
;
236 TriStateBox aPageBreakBox
;
237 FixedText aBreakTypeFT
;
238 ListBox aBreakTypeLB
;
239 FixedText aBreakPositionFT
;
240 ListBox aBreakPositionLB
;
241 TriStateBox aApplyCollBtn
;
242 ListBox aApplyCollBox
;
243 FixedText aPagenumText
;
244 NumericField aPagenumEdit
;
248 // paragraph division
249 TriStateBox aKeepTogetherBox
;
250 TriStateBox aKeepParaBox
;
253 TriStateBox aOrphanBox
;
254 NumericField aOrphanRowNo
;
255 FixedText aOrphanRowLabel
;
257 TriStateBox aWidowBox
;
258 NumericField aWidowRowNo
;
259 FixedText aWidowRowLabel
;
265 #ifdef _SVX_PARAGRPH_CXX
266 DECL_LINK(PageBreakHdl_Impl
, void *);
267 DECL_LINK(KeepTogetherHdl_Impl
, void *);
268 DECL_LINK(WidowHdl_Impl
, void *);
269 DECL_LINK(OrphanHdl_Impl
, void *);
270 DECL_LINK(HyphenClickHdl_Impl
, void *);
271 DECL_LINK(ApplyCollClickHdl_Impl
, void *);
272 DECL_LINK( PageBreakPosHdl_Impl
, ListBox
* );
273 DECL_LINK( PageBreakTypeHdl_Impl
, ListBox
* );
275 virtual void PageCreated(SfxAllItemSet aSet
);
278 //--------------------------------------------------------------------------
279 class SvxAsianTabPage
: public SfxTabPage
281 FixedLine aOptionsFL
;
283 TriStateBox aForbiddenRulesCB
;
284 TriStateBox aHangingPunctCB
;
286 TriStateBox aScriptSpaceCB
;
288 SvxAsianTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
290 #ifdef _SVX_PARAGRPH_CXX
291 DECL_LINK( ClickHdl_Impl
, TriStateBox
* );
297 static SfxTabPage
* Create( Window
* pParent
,
298 const SfxItemSet
& rSet
);
299 static sal_uInt16
* GetRanges();
301 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
302 virtual void Reset( const SfxItemSet
& rSet
);
306 #endif // #ifndef _SVX_PARAGRPH_HXX
309 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */