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