Update ooo320-m1
[ooovba.git] / svx / source / cui / paragrph.hxx
blob438a741100993735518713c5293dfeffdfa55f02
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: paragrph.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_PARAGRPH_HXX
31 #define _SVX_PARAGRPH_HXX
33 // include ---------------------------------------------------------------
35 #ifndef _BUTTON_HXX //autogen
36 #include <vcl/button.hxx>
37 #endif
38 #ifndef _FIXED_HXX //autogen
39 #include <vcl/fixed.hxx>
40 #endif
41 #include <sfx2/tabdlg.hxx>
42 #include "relfld.hxx" // SvxRelativeField
43 #include <svx/paraprev.hxx> // Preview
44 #include <svx/frmdirlbox.hxx>
46 #ifndef _LSTBOX_HXX //autogen
47 #include <vcl/lstbox.hxx>
48 #endif
49 #include "flagsdef.hxx"
50 // define ----------------------------------------------------------------
52 // 1/2 cm in TWIPS
53 // wird auch fuer Minimalgrosse der LayFrms aller Arten benutzt
54 //CHINA001 #define MM50 283
56 // forward ---------------------------------------------------------------
58 class SvxLineSpacingItem;
59 class SvxParagraphControllerItem;
61 // class SvxStdParagraphTabPage ------------------------------------------
63 /* {k:\svx\prototyp\dialog\parastd.bmp}
65 [Beschreibung]
66 Mit dieser TabPage koennen Standard-Attribute eines Absatzes eingestellt
67 werden (Einzug, Abstand, Ausrichtung, Zeilenabstand).
69 [Items]
70 <SvxAdjustItem><SID_ATTR_PARA_ADJUST>
71 <SvxLineSpacingItem><SID_ATTR_PARA_LINESPACE>
72 <SvxULSpaceItem><SID_ATTR_ULSPACE>
73 <SvxLRSpaceItem><SID_ATTR_LRSPACE>
76 class SvxStdParagraphTabPage: public SfxTabPage
78 using TabPage::DeactivatePage;
80 private:
81 SvxStdParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
83 // Einzug
84 FixedText aLeftLabel;
85 SvxRelativeField aLeftIndent;
87 FixedText aRightLabel;
88 SvxRelativeField aRightIndent;
90 FixedText aFLineLabel;
91 SvxRelativeField aFLineIndent;
92 CheckBox aAutoCB;
94 FixedLine aIndentFrm;
96 // Abstaende
97 FixedText aTopLabel;
98 SvxRelativeField aTopDist;
99 FixedText aBottomLabel;
100 SvxRelativeField aBottomDist;
101 FixedLine aDistFrm;
103 // Zeilenabstand
104 ListBox aLineDist;
105 FixedText aLineDistAtLabel;
106 MetricField aLineDistAtPercentBox;
107 MetricField aLineDistAtMetricBox;
108 FixedLine aLineDistFrm;
109 String sAbsDist;
110 SvxParaPrevWindow aExampleWin;
112 //Registerhaltigkeit - nur Writer
113 CheckBox aRegisterCB;
114 FixedLine aRegisterFL;
116 Edit* pActLineDistFld;
117 long nAbst;
118 long nWidth;
119 long nMinFixDist;
120 BOOL bRelativeMode;
121 BOOL bNegativeIndents;
123 #ifdef _SVX_PARAGRPH_CXX
124 void SetLineSpacing_Impl( const SvxLineSpacingItem& rAttr );
125 void Init_Impl();
126 void UpdateExample_Impl( BOOL bAll = FALSE );
128 DECL_LINK( LineDistHdl_Impl, ListBox* );
129 DECL_LINK( ModifyHdl_Impl, SvxRelativeField* );
130 DECL_LINK( AutoHdl_Impl, CheckBox* );
131 #endif
133 protected:
134 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
136 public:
137 DECL_LINK( ELRLoseFocusHdl, Edit* );
139 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
140 static USHORT* GetRanges();
142 virtual BOOL FillItemSet( SfxItemSet& rSet );
143 virtual void Reset( const SfxItemSet& rSet );
146 void SetPageWidth( USHORT nPageWidth );
147 void SetMaxDistance( USHORT nMaxDist );
148 void EnableRelativeMode();
149 void EnableRegisterMode();
150 void EnableAutoFirstLine();
151 void EnableAbsLineDist(long nMinTwip);
152 void EnableNegativeMode();
153 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
156 // class SvxParaAlignTabPage ------------------------------------------------
158 class SvxParaAlignTabPage : public SfxTabPage
160 using TabPage::DeactivatePage;
162 // Ausrichtung
163 FixedLine aAlignFrm;
164 RadioButton aLeft;
165 RadioButton aRight;
166 RadioButton aCenter;
167 RadioButton aJustify;
168 FixedText aLastLineFT;
169 ListBox aLastLineLB;
170 CheckBox aExpandCB;
172 CheckBox aSnapToGridCB;
174 //preview
175 SvxParaPrevWindow aExampleWin;
176 //vertical alignment
177 FixedLine aVertAlignFL;
179 FixedText aVertAlignFT;
180 ListBox aVertAlignLB;
182 FixedLine aPropertiesFL;
183 FixedText aTextDirectionFT;
184 svx::FrameDirectionListBox aTextDirectionLB;
186 #ifdef _SVX_PARAGRPH_CXX
187 DECL_LINK( AlignHdl_Impl, RadioButton* );
188 DECL_LINK( LastLineHdl_Impl, ListBox* );
189 DECL_LINK( TextDirectionHdl_Impl, ListBox* );
191 void UpdateExample_Impl( BOOL bAll = FALSE );
192 #endif
194 SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet );
195 virtual ~SvxParaAlignTabPage();
197 protected:
198 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
200 public:
201 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
202 static USHORT* GetRanges();
204 virtual BOOL FillItemSet( SfxItemSet& rSet );
205 virtual void Reset( const SfxItemSet& rSet );
207 void EnableJustifyExt();
208 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
211 // class SvxExtParagraphTabPage ------------------------------------------
213 /* {k:\svx\prototyp\dialog\paraext.bmp}
215 [Beschreibung]
216 Mit dieser TabPage koennen Spezial-Attribute eines Absatzes eingestellt
217 werden (Silbentrennung, Seitenumbruch, Schusterjungen, Hurenkinder, ...).
219 [Items]
220 <SvxHyphenZoneItem><SID_ATTR_PARA_HYPHENZONE>
221 <SvxFmtBreakItem><SID_ATTR_PARA_PAGEBREAK>
222 <SvxFmtSplitItem><SID_ATTR_PARA_SPLIT>
223 <SvxWidowsItem><SID_ATTR_PARA_WIDOWS>
224 <SvxOrphansItem><SID_ATTR_PARA_ORPHANS>
227 class SvxExtParagraphTabPage: public SfxTabPage
229 using TabPage::DeactivatePage;
231 public:
232 virtual ~SvxExtParagraphTabPage();
234 static SfxTabPage* Create( Window* pParent,
235 const SfxItemSet& rSet );
236 static USHORT* GetRanges();
238 virtual BOOL FillItemSet( SfxItemSet& rSet );
239 virtual void Reset( const SfxItemSet& rSet );
241 void DisablePageBreak();
243 protected:
244 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
246 private:
247 SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
249 // Silbentrennung
250 TriStateBox aHyphenBox;
251 FixedText aBeforeText;
252 NumericField aExtHyphenBeforeBox;
253 // FixedText aHyphenBeforeLabel;
254 FixedText aAfterText;
255 NumericField aExtHyphenAfterBox;
256 // FixedText aHyphenAfterLabel;
257 FixedText aMaxHyphenLabel;
258 NumericField aMaxHyphenEdit;
259 FixedLine aExtFL;
261 // Seitenumbruch
262 FixedLine aBreaksFL;
263 TriStateBox aPageBreakBox;
264 FixedText aBreakTypeFT;
265 ListBox aBreakTypeLB;
266 FixedText aBreakPositionFT;
267 ListBox aBreakPositionLB;
268 TriStateBox aApplyCollBtn;
269 ListBox aApplyCollBox;
270 FixedText aPagenumText;
271 NumericField aPagenumEdit;
273 FixedLine aExtendFL;
275 // Absatzteilung
276 TriStateBox aKeepTogetherBox;
277 TriStateBox aKeepParaBox;
279 // Witwen/Waisen
280 TriStateBox aOrphanBox;
281 NumericField aOrphanRowNo;
282 FixedText aOrphanRowLabel;
284 TriStateBox aWidowBox;
285 NumericField aWidowRowNo;
286 FixedText aWidowRowLabel;
288 BOOL bPageBreak;
289 BOOL bHtmlMode;
290 USHORT nStdPos;
292 #ifdef _SVX_PARAGRPH_CXX
293 DECL_LINK( PageBreakHdl_Impl, TriStateBox* );
294 DECL_LINK( KeepTogetherHdl_Impl, TriStateBox* );
295 DECL_LINK( WidowHdl_Impl, TriStateBox* );
296 DECL_LINK( OrphanHdl_Impl, TriStateBox* );
297 DECL_LINK( HyphenClickHdl_Impl, TriStateBox* );
298 DECL_LINK( ApplyCollClickHdl_Impl, TriStateBox* );
299 DECL_LINK( PageBreakPosHdl_Impl, ListBox* );
300 DECL_LINK( PageBreakTypeHdl_Impl, ListBox* );
301 #endif
302 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001
304 /* -----------------------------29.11.00 11:33--------------------------------
306 ---------------------------------------------------------------------------*/
307 class SvxAsianTabPage : public SfxTabPage
309 FixedLine aOptionsFL;
311 TriStateBox aForbiddenRulesCB;
312 TriStateBox aHangingPunctCB;
314 TriStateBox aScriptSpaceCB;
316 SvxAsianTabPage( Window* pParent, const SfxItemSet& rSet );
318 #ifdef _SVX_PARAGRPH_CXX
319 DECL_LINK( ClickHdl_Impl, TriStateBox* );
320 #endif
321 public:
322 ~SvxAsianTabPage();
325 static SfxTabPage* Create( Window* pParent,
326 const SfxItemSet& rSet );
327 static USHORT* GetRanges();
329 virtual BOOL FillItemSet( SfxItemSet& rSet );
330 virtual void Reset( const SfxItemSet& rSet );
334 #endif // #ifndef _SVX_PARAGRPH_HXX