Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / inc / paragrph.hxx
blobae9904fedcbc44fe7167c83e7fb800e03df9a0db
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_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}
39 [Description]
40 With this TabPage standard attributes of a paragraph can be set
41 (indention, distance, alignment, line spacing).
43 [Items]
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;
54 private:
55 SvxStdParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
57 FixedLine aIndentFrm;
58 // indention
59 FixedText aLeftLabel;
60 SvxRelativeField aLeftIndent;
62 FixedText aRightLabel;
63 SvxRelativeField aRightIndent;
65 FixedText aFLineLabel;
66 SvxRelativeField aFLineIndent;
67 CheckBox aAutoCB;
69 FixedLine aDistFrm;
71 // distance
72 FixedText aTopLabel;
73 SvxRelativeField aTopDist;
74 FixedText aBottomLabel;
75 SvxRelativeField aBottomDist;
76 CheckBox aContextualCB;
78 // line spacing
79 FixedLine aLineDistFrm;
80 ListBox aLineDist;
81 FixedText aLineDistAtLabel;
82 MetricField aLineDistAtPercentBox;
83 MetricField aLineDistAtMetricBox;
84 String sAbsDist;
85 SvxParaPrevWindow aExampleWin;
87 // only writer
88 FixedLine aRegisterFL;
89 CheckBox aRegisterCB;
91 Edit* pActLineDistFld;
92 long nAbst;
93 long nWidth;
94 long nMinFixDist;
95 sal_Bool bRelativeMode;
96 sal_Bool bNegativeIndents;
98 #ifdef _SVX_PARAGRPH_CXX
99 void SetLineSpacing_Impl( const SvxLineSpacingItem& rAttr );
100 void Init_Impl();
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* );
106 #endif
108 protected:
109 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
111 public:
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;
137 // alignment
138 FixedLine aAlignFrm;
139 RadioButton aLeft;
140 RadioButton aRight;
141 RadioButton aCenter;
142 RadioButton aJustify;
143 FixedText aLastLineFT;
144 ListBox aLastLineLB;
145 CheckBox aExpandCB;
147 CheckBox aSnapToGridCB;
149 //preview
150 SvxParaPrevWindow aExampleWin;
151 //vertical alignment
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 );
167 #endif
169 SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet );
170 virtual ~SvxParaAlignTabPage();
172 protected:
173 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
175 public:
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}
190 [Description]
191 With this TabPage special attributes of a paragraph can be set
192 (hyphenation, pagebreak, orphan, widow, ...).
194 [Items]
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;
206 public:
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();
218 protected:
219 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
221 private:
222 SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
224 // hyphenation
225 FixedLine aExtFL;
226 TriStateBox aHyphenBox;
227 FixedText aBeforeText;
228 NumericField aExtHyphenBeforeBox;
229 FixedText aAfterText;
230 NumericField aExtHyphenAfterBox;
231 FixedText aMaxHyphenLabel;
232 NumericField aMaxHyphenEdit;
234 // pagebreak
235 FixedLine aBreaksFL;
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;
246 FixedLine aExtendFL;
248 // paragraph division
249 TriStateBox aKeepTogetherBox;
250 TriStateBox aKeepParaBox;
252 // orphan/widow
253 TriStateBox aOrphanBox;
254 NumericField aOrphanRowNo;
255 FixedText aOrphanRowLabel;
257 TriStateBox aWidowBox;
258 NumericField aWidowRowNo;
259 FixedText aWidowRowLabel;
261 sal_Bool bPageBreak;
262 sal_Bool bHtmlMode;
263 sal_uInt16 nStdPos;
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* );
274 #endif
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* );
292 #endif
293 public:
294 ~SvxAsianTabPage();
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: */