xref: /trunk/main/sw/source/ui/inc/optpage.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _OPTPAGE_HXX
28 #define _OPTPAGE_HXX
29 #include <sfx2/tabdlg.hxx>
30 
31 #ifndef _GROUP_HXX //autogen
32 #include <vcl/group.hxx>
33 #endif
34 
35 #ifndef _BUTTON_HXX //autogen
36 #include <vcl/button.hxx>
37 #endif
38 
39 #ifndef _LSTBOX_HXX //autogen
40 #include <vcl/lstbox.hxx>
41 #endif
42 
43 #ifndef _FIELD_HXX //autogen
44 #include <vcl/field.hxx>
45 #endif
46 
47 #ifndef _FIXED_HXX //autogen
48 #include <vcl/fixed.hxx>
49 #endif
50 #include <svtools/ctrlbox.hxx>
51 #include <svx/fntctrl.hxx>
52 #include <fontcfg.hxx>
53 class SvStringsDtor;
54 class SfxPrinter;
55 class SwStdFontConfig;
56 class SwWrtShell;
57 class FontList;
58 
59 /*-----------------31.08.96 10.09-------------------
60 
61 --------------------------------------------------*/
62 
63 class SwContentOptPage : public SfxTabPage
64 {
65     //visual aids
66     FixedLine   aLineFL;
67 	CheckBox	aCrossCB;
68 	CheckBox	aSolidHandleCB;
69 	CheckBox	aBigHandleCB;
70 
71     //view
72     FixedLine   aWindowFL;
73 	CheckBox 	aHScrollBox;
74 	CheckBox 	aVScrollBox;
75     CheckBox    aAnyRulerCB;
76     CheckBox    aHRulerCBox;
77     ListBox     aHMetric;
78 	CheckBox 	aVRulerCBox;
79     CheckBox    aVRulerRightCBox;
80     ListBox     aVMetric;
81 	CheckBox	aSmoothCBox;
82 
83     //display
84     FixedLine   aDispFL;
85 	CheckBox	aGrfCB;
86 	CheckBox 	aTblCB;
87 	CheckBox	aDrwCB;
88 	CheckBox 	aFldNameCB;
89 	CheckBox 	aPostItCB;
90 
91     FixedLine   aSettingsFL;
92     FixedText   aMetricFT;
93     ListBox     aMetricLB;
94 
95     DECL_LINK(VertRulerHdl, CheckBox*);
96     DECL_LINK(AnyRulerHdl, CheckBox*);
97 public:
98 						SwContentOptPage( Window* pParent,
99 										   const SfxItemSet& rSet );
100 						~SwContentOptPage();
101 
102 	static SfxTabPage*	Create( Window* pParent,
103 								const SfxItemSet& rAttrSet);
104 
105 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
106 	virtual	void 		Reset( const SfxItemSet& rSet );
107 
108 };
109 
110 /*-------- OS 27.01.95 -----------------------------------
111  TabPage Druckereinstellungen Zusaetze
112 --------------------------------------------------------- */
113 
114 
115 class SwAddPrinterTabPage : public SfxTabPage
116 {
117     FixedLine       aFL1;
118     CheckBox        aGrfCB;
119 //	CheckBox 		aTabCB;
120 //	CheckBox		aDrawCB;
121 	CheckBox		aCtrlFldCB;
122 	CheckBox		aBackgroundCB;
123 	CheckBox		aBlackFontCB;
124     CheckBox        aPrintHiddenTextCB;
125     CheckBox        aPrintTextPlaceholderCB;
126 
127     FixedLine       aSeparatorLFL;
128 
129     FixedLine       aFL2;
130     CheckBox        aLeftPageCB;
131 	CheckBox		aRightPageCB;
132 //	CheckBox		aReverseCB;
133 	CheckBox        aProspectCB;
134 	CheckBox        aProspectCB_RTL;
135 
136     FixedLine       aSeparatorRFL;
137 
138     FixedLine        aFL3;
139     RadioButton     aNoRB;
140 	RadioButton     aOnlyRB;
141 	RadioButton     aEndRB;
142 	RadioButton     aEndPageRB;
143     FixedLine        aFL4;
144     CheckBox        aPrintEmptyPagesCB;
145 //    CheckBox        aSingleJobsCB;
146 	CheckBox	    aPaperFromSetupCB;
147     FixedText       aFaxFT;
148 	ListBox         aFaxLB;
149     String          sNone;
150 
151 	sal_Bool		bAttrModified;
152 	sal_Bool		bPreview;
153 
154 	void		Init();
155 				DECL_LINK( AutoClickHdl, CheckBox * );
156 				DECL_LINK( SelectHdl, ListBox * );
157 
158 
159 				SwAddPrinterTabPage( Window* pParent,
160 										   const SfxItemSet& rSet );
161 public:
162 
163 	static SfxTabPage*	Create( Window* pParent,
164 								const SfxItemSet& rAttrSet );
165 
166 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
167 	virtual	void 		Reset( const SfxItemSet& rSet );
168 	void 				SetFax( const SvStringsDtor& );
169 	void 				SelectFax( const String& );
170 	void				SetPreview(sal_Bool bPrev);
171     virtual void        PageCreated (SfxAllItemSet aSet);
172 
173 };
174 
175 /*-----------------03.09.96 11.50-------------------
176 
177 --------------------------------------------------*/
178 
179 class SwStdFontTabPage : public SfxTabPage
180 {
181     FixedLine       aStdChrFL  ;
182 
183     FixedText       aTypeFT;
184 
185     FixedText       aStandardLbl;
186 	ComboBox 		aStandardBox;
187 
188     FixedText       aHeightFT;
189     FontSizeBox     aStandardHeightLB;
190 
191     FixedText       aTitleLbl   ;
192 	ComboBox 		aTitleBox   ;
193     FontSizeBox     aTitleHeightLB;
194 
195 	FixedText 		aListLbl    ;
196 	ComboBox 		aListBox    ;
197     FontSizeBox     aListHeightLB;
198 
199 	FixedText 		aLabelLbl   ;
200 	ComboBox 		aLabelBox   ;
201     FontSizeBox     aLabelHeightLB;
202 
203 	FixedText 		aIdxLbl     ;
204 	ComboBox 		aIdxBox     ;
205     FontSizeBox     aIndexHeightLB;
206 
207 	CheckBox		aDocOnlyCB	;
208     PushButton      aStandardPB;
209 
210 	String 			sShellStd;
211 	String 			sShellTitle;
212 	String			sShellList;
213 	String          sShellLabel;
214 	String          sShellIndex;
215 
216 	SfxPrinter* 		pPrt;
217     FontList*           pFontList;
218 	SwStdFontConfig* 	pFontConfig;
219 	SwWrtShell*			pWrtShell;
220     LanguageType        eLanguage;
221 	// waren nur defaults vorhanden? wurden sie mit den Boxen ueberschrieben
222 	sal_Bool 	bListDefault	:1;
223 	sal_Bool 	bSetListDefault :1;
224 	sal_Bool 	bLabelDefault	:1;
225 	sal_Bool 	bSetLabelDefault :1;
226 	sal_Bool 	bIdxDefault		:1;
227 	sal_Bool 	bSetIdxDefault 	:1;
228 	sal_Bool 	bDeletePrinter :1;
229 
230     sal_Bool    bListHeightDefault    :1;
231     sal_Bool    bSetListHeightDefault :1;
232     sal_Bool    bLabelHeightDefault   :1;
233     sal_Bool    bSetLabelHeightDefault :1;
234     sal_Bool    bIndexHeightDefault     :1;
235     sal_Bool    bSetIndexHeightDefault  :1;
236 
237     sal_uInt8 nFontGroup; //fontcfg.hxx: FONT_GROUP_[STANDARD|CJK|CTL]
238 
239     String sScriptWestern;
240     String sScriptAsian;
241     String sScriptComplex;
242 
243     DECL_LINK( StandardHdl, PushButton * );
244 	DECL_LINK( ModifyHdl, ComboBox * );
245     DECL_LINK( ModifyHeightHdl, FontSizeBox * );
246     DECL_LINK( LoseFocusHdl, ComboBox * );
247 
248 			SwStdFontTabPage( Window* pParent,
249 									   const SfxItemSet& rSet );
250 			~SwStdFontTabPage();
251 
252 public:
253 	static SfxTabPage*	Create( Window* pParent,
254 								const SfxItemSet& rAttrSet );
255 
256 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
257 	virtual	void 		Reset( const SfxItemSet& rSet );
258 
259     void    SetFontMode(sal_uInt8 nGroup) {nFontGroup = nGroup;}
260     virtual void        PageCreated (SfxAllItemSet aSet);
261 };
262 
263 /*-----------------18.01.97 12.10-------------------
264 
265 --------------------------------------------------*/
266 
267 class SwTableOptionsTabPage : public SfxTabPage
268 {
269     FixedLine   aTableFL;
270     CheckBox    aHeaderCB;
271 	CheckBox	aRepeatHeaderCB;
272 	CheckBox	aDontSplitCB;
273 	CheckBox	aBorderCB;
274 
275     FixedLine   aSeparatorFL;
276 
277     FixedLine   aTableInsertFL;
278 	CheckBox	aNumFormattingCB;
279 	CheckBox	aNumFmtFormattingCB;
280 	CheckBox	aNumAlignmentCB;
281 
282     FixedLine   aMoveFL;
283     FixedText   aMoveFT;
284     FixedText   aRowMoveFT;
285 	MetricField	aRowMoveMF;
286 	FixedText	aColMoveFT;
287 	MetricField	aColMoveMF;
288 
289     FixedText   aInsertFT;
290 	FixedText	aRowInsertFT;
291 	MetricField	aRowInsertMF;
292 	FixedText	aColInsertFT;
293 	MetricField	aColInsertMF;
294 
295     FixedText   aHandlingFT;
296 	RadioButton	aFixRB;
297 	RadioButton aFixPropRB;
298 	RadioButton aVarRB;
299 	FixedText	aFixFT;
300 	FixedText	aFixPropFT;
301 	FixedText	aVarFT;
302 
303 	SwWrtShell*	pWrtShell;
304     sal_Bool        bHTMLMode;
305 
306     DECL_LINK(CheckBoxHdl, CheckBox *pCB);
307 
308 
309 				SwTableOptionsTabPage( Window* pParent,
310 										   const SfxItemSet& rSet );
311 				~SwTableOptionsTabPage();
312 
313 public:
314 
315 	static SfxTabPage*	Create( Window* pParent,
316 								const SfxItemSet& rAttrSet );
317 
318 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
319 	virtual	void 		Reset( const SfxItemSet& rSet );
320 
321 	void SetWrtShell(SwWrtShell* pSh) {pWrtShell = pSh;}
322     virtual void        PageCreated (SfxAllItemSet aSet);
323 
324 };
325 /*-----------------31.10.97 17:55-------------------
326  TabPage fuer ShadowCrsr
327 --------------------------------------------------*/
328 class SwShdwCrsrOptionsTabPage : public SfxTabPage
329 {
330     //nonprinting characters
331     FixedLine   aUnprintFL;
332 	CheckBox 	aParaCB;
333 	CheckBox	aSHyphCB;
334 	CheckBox 	aSpacesCB;
335 	CheckBox 	aHSpacesCB;
336 	CheckBox 	aTabCB;
337 	CheckBox 	aBreakCB;
338     CheckBox    aCharHiddenCB;
339     CheckBox    aFldHiddenCB;
340     CheckBox    aFldHiddenParaCB;
341 
342     FixedLine   aSeparatorFL;
343 
344     FixedLine       aFlagFL;
345 	CheckBox		aOnOffCB;
346 
347 	FixedText		aFillModeFT;
348 	RadioButton     aFillMarginRB;
349 	RadioButton     aFillIndentRB;
350 	RadioButton     aFillTabRB;
351 	RadioButton     aFillSpaceRB;
352 
353     FixedLine       aCrsrOptFL;
354 	CheckBox		aCrsrInProtCB;
355 
356     FixedLine       m_aLayoutOptionsFL;
357 	CheckBox		m_aMathBaselineAlignmentCB;
358 
359     SwWrtShell *    m_pWrtShell;
360 
361 
362     SwShdwCrsrOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
363 	~SwShdwCrsrOptionsTabPage();
364 
365 public:
366 
367 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet );
368 
369 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
370 	virtual	void 		Reset( const SfxItemSet& rSet );
371 
372     void    SetWrtShell( SwWrtShell * pSh ) { m_pWrtShell = pSh; }
373     virtual void        PageCreated( SfxAllItemSet aSet );
374 };
375 
376 /*-----------------------------------------------------------------------
377 	Beschreibung: Markierungsvorschau
378  -----------------------------------------------------------------------*/
379 
380 class SwMarkPreview : public Window
381 {
382 	Color			m_aBgCol;			// background
383 	Color			m_aTransCol;		// transparency
384 	Color			m_aMarkCol;			// marks
385 	Color			m_aLineCol;			// general lines
386 	Color			m_aShadowCol;		// shadow
387 	Color			m_aTxtCol;			// text
388 	Color			m_aPrintAreaCol;	// frame for print area
389 
390 	Rectangle 		aPage;
391 	Rectangle 		aLeftPagePrtArea;
392 	Rectangle 		aRightPagePrtArea;
393 
394 	sal_uInt16			nMarkPos;
395 
396     using OutputDevice::DrawRect;
397 	void			DrawRect(const Rectangle &rRect, const Color &rFillColor, const Color &rLineColor);
398 
399 	void			Paint(const Rectangle&);
400 	void			PaintPage(const Rectangle &rRect);
401 	void			InitColors( void );
402 
403 protected:
404 	virtual void	DataChanged( const DataChangedEvent& rDCEvt );
405 
406 public:
407 					SwMarkPreview(Window* pParent, const ResId& rResID);
408 	virtual			~SwMarkPreview();
409 
410 	inline void		SetColor(const Color& rCol)	{ m_aMarkCol = rCol; }
411 	inline void		SetMarkPos(sal_uInt16 nPos)	{ nMarkPos = nPos; }
412 };
413 
414 /*-----------------------------------------------------------------------
415 	Beschreibung: Redlining-Optionen
416  -----------------------------------------------------------------------*/
417 
418 class SwRedlineOptionsTabPage : public SfxTabPage
419 {
420     FixedLine           aInsertFL;
421 
422     FixedText           aInsertFT;
423     FixedText           aInsertAttrFT;
424 	ListBox				aInsertLB;
425     FixedText           aInsertColorFT;
426 	ColorListBox		aInsertColorLB;
427     SvxFontPrevWindow   aInsertedPreviewWN;
428 
429     FixedText           aDeletedFT;
430     FixedText           aDeletedAttrFT;
431     ListBox             aDeletedLB;
432     FixedText           aDeletedColorFT;
433     ColorListBox        aDeletedColorLB;
434     SvxFontPrevWindow   aDeletedPreviewWN;
435 
436     FixedText           aChangedFT;
437     FixedText           aChangedAttrFT;
438     ListBox             aChangedLB;
439     FixedText           aChangedColorFT;
440     ColorListBox        aChangedColorLB;
441     SvxFontPrevWindow   aChangedPreviewWN;
442 
443     FixedLine           aChangedFL;
444 
445     FixedText           aMarkPosFT;
446 	ListBox				aMarkPosLB;
447 	FixedText			aMarkColorFT;
448 	ColorListBox		aMarkColorLB;
449 	SwMarkPreview		aMarkPreviewWN;
450 
451     String              sAuthor;
452 	String				sNone;
453 
454 	SwRedlineOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
455 	~SwRedlineOptionsTabPage();
456 
457 	DECL_LINK( AttribHdl, ListBox *pLB );
458 	DECL_LINK( ChangedMaskPrevHdl, ListBox *pLB = 0 );
459 	DECL_LINK( ColorHdl, ColorListBox *pColorLB );
460 
461 	void 				InitFontStyle(SvxFontPrevWindow& rExampleWin);
462 
463 public:
464 
465 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet );
466 
467 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
468 	virtual	void 		Reset( const SfxItemSet& rSet );
469 };
470 
471 /*--------OS 11.01.95 -----------------------------------
472  TabPage Testeinstellungen fuer SW
473 --------------------------------------------------------- */
474 
475 #ifdef DBG_UTIL
476 
477 class SwTestTabPage : public SfxTabPage
478 {
479 public:
480 						SwTestTabPage( Window* pParent,
481 										   const SfxItemSet& rSet );
482 
483 	static SfxTabPage*	Create( Window* pParent,
484 								const SfxItemSet& rAttrSet );
485 
486 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
487 	virtual	void 		Reset( const SfxItemSet& rSet );
488 
489 private:
490     FixedLine aTestFL;
491 	CheckBox aTest1CBox;
492 	CheckBox aTest2CBox;
493 	CheckBox aTest3CBox;
494 	CheckBox aTest4CBox;
495 	CheckBox aTest5CBox;
496 	CheckBox aTest6CBox;
497 	CheckBox aTest7CBox;
498 	CheckBox aTest8CBox;
499 	CheckBox aTest9CBox;
500 	CheckBox aTest10CBox;
501 
502 	sal_Bool		bAttrModified;
503 
504 	void		Init();
505 	DECL_LINK( AutoClickHdl, CheckBox * );
506 
507 };
508 #endif //PRODUCT
509 #endif
510