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