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