1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <sfx2/tabdlg.hxx>
23 #include <vcl/group.hxx>
25 #include <vcl/button.hxx>
27 #include <vcl/lstbox.hxx>
29 #include <vcl/field.hxx>
31 #include <vcl/fixed.hxx>
32 #include <svtools/ctrlbox.hxx>
33 #include <svx/fntctrl.hxx>
34 #include <fontcfg.hxx>
36 class SwStdFontConfig
;
40 /*--------------------------------------------------------
41 Tools->Options->Writer->View
42 Tools->Options->Writer/Web->View
43 --------------------------------------------------------- */
44 class SwContentOptPage
: public SfxTabPage
48 CheckBox
* m_pHScrollBox
;
49 CheckBox
* m_pVScrollBox
;
50 CheckBox
* m_pAnyRulerCB
;
51 CheckBox
* m_pHRulerCBox
;
53 CheckBox
* m_pVRulerCBox
;
54 CheckBox
* m_pVRulerRightCBox
;
56 CheckBox
* m_pSmoothCBox
;
61 CheckBox
* m_pFldNameCB
;
62 CheckBox
* m_pPostItCB
;
64 VclFrame
* m_pSettingsFrame
;
65 FixedText
* m_pSettingsLabel
;
66 FixedText
* m_pMetricLabel
;
69 DECL_LINK(VertRulerHdl
, CheckBox
*);
70 DECL_LINK(AnyRulerHdl
, CheckBox
*);
72 SwContentOptPage( Window
* pParent
,
73 const SfxItemSet
& rSet
);
76 static SfxTabPage
* Create( Window
* pParent
,
77 const SfxItemSet
& rAttrSet
);
79 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
80 virtual void Reset( const SfxItemSet
& rSet
);
84 /*--------------------------------------------------------
85 TabPage printer settings additions
86 --------------------------------------------------------- */
87 class SwAddPrinterTabPage
: public SfxTabPage
90 CheckBox
* m_pCtrlFldCB
;
91 CheckBox
* m_pBackgroundCB
;
92 CheckBox
* m_pBlackFontCB
;
93 CheckBox
* m_pPrintHiddenTextCB
;
94 CheckBox
* m_pPrintTextPlaceholderCB
;
96 VclFrame
* m_pPagesFrame
;
97 CheckBox
* m_pLeftPageCB
;
98 CheckBox
* m_pRightPageCB
;
99 CheckBox
* m_pProspectCB
;
100 CheckBox
* m_pProspectCB_RTL
;
102 VclFrame
* m_pCommentsFrame
;
103 RadioButton
* m_pNoRB
;
104 RadioButton
* m_pOnlyRB
;
105 RadioButton
* m_pEndRB
;
106 RadioButton
* m_pEndPageRB
;
108 CheckBox
* m_pPrintEmptyPagesCB
;
109 CheckBox
* m_pPaperFromSetupCB
;
114 sal_Bool bAttrModified
;
118 DECL_LINK(AutoClickHdl
, void *);
119 DECL_LINK(SelectHdl
, void *);
122 SwAddPrinterTabPage( Window
* pParent
,
123 const SfxItemSet
& rSet
);
126 static SfxTabPage
* Create( Window
* pParent
,
127 const SfxItemSet
& rAttrSet
);
129 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
130 virtual void Reset( const SfxItemSet
& rSet
);
131 void SetFax( const std::vector
<String
>& );
132 void SelectFax( const String
& );
133 void SetPreview(sal_Bool bPrev
);
134 virtual void PageCreated (SfxAllItemSet aSet
);
138 class SwStdFontTabPage
: public SfxTabPage
140 FixedLine aStdChrFL
;
144 FixedText aStandardLbl
;
145 ComboBox aStandardBox
;
148 FontSizeBox aStandardHeightLB
;
150 FixedText aTitleLbl
;
152 FontSizeBox aTitleHeightLB
;
156 FontSizeBox aListHeightLB
;
158 FixedText aLabelLbl
;
160 FontSizeBox aLabelHeightLB
;
164 FontSizeBox aIndexHeightLB
;
166 CheckBox aDocOnlyCB
;
167 PushButton aStandardPB
;
177 SwStdFontConfig
* pFontConfig
;
178 SwWrtShell
* pWrtShell
;
179 LanguageType eLanguage
;
180 // only defaults were there? they were signed with the boxes
181 sal_Bool bListDefault
:1;
182 sal_Bool bSetListDefault
:1;
183 sal_Bool bLabelDefault
:1;
184 sal_Bool bSetLabelDefault
:1;
185 sal_Bool bIdxDefault
:1;
186 sal_Bool bSetIdxDefault
:1;
187 sal_Bool bDeletePrinter
:1;
189 sal_Bool bListHeightDefault
:1;
190 sal_Bool bSetListHeightDefault
:1;
191 sal_Bool bLabelHeightDefault
:1;
192 sal_Bool bSetLabelHeightDefault
:1;
193 sal_Bool bIndexHeightDefault
:1;
194 sal_Bool bSetIndexHeightDefault
:1;
196 sal_uInt8 nFontGroup
; //fontcfg.hxx: FONT_GROUP_[STANDARD|CJK|CTL]
198 String sScriptWestern
;
200 String sScriptComplex
;
202 DECL_LINK(StandardHdl
, void *);
203 DECL_LINK( ModifyHdl
, ComboBox
* );
204 DECL_LINK( ModifyHeightHdl
, FontSizeBox
* );
205 DECL_LINK( LoseFocusHdl
, ComboBox
* );
207 SwStdFontTabPage( Window
* pParent
,
208 const SfxItemSet
& rSet
);
212 static SfxTabPage
* Create( Window
* pParent
,
213 const SfxItemSet
& rAttrSet
);
215 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
216 virtual void Reset( const SfxItemSet
& rSet
);
218 void SetFontMode(sal_uInt8 nGroup
) {nFontGroup
= nGroup
;}
219 virtual void PageCreated (SfxAllItemSet aSet
);
222 class SwTableOptionsTabPage
: public SfxTabPage
226 CheckBox aRepeatHeaderCB
;
227 CheckBox aDontSplitCB
;
230 FixedLine aSeparatorFL
;
232 FixedLine aTableInsertFL
;
233 CheckBox aNumFormattingCB
;
234 CheckBox aNumFmtFormattingCB
;
235 CheckBox aNumAlignmentCB
;
239 FixedText aRowMoveFT
;
240 MetricField aRowMoveMF
;
241 FixedText aColMoveFT
;
242 MetricField aColMoveMF
;
245 FixedText aRowInsertFT
;
246 MetricField aRowInsertMF
;
247 FixedText aColInsertFT
;
248 MetricField aColInsertMF
;
250 FixedText aHandlingFT
;
252 RadioButton aFixPropRB
;
255 FixedText aFixPropFT
;
258 SwWrtShell
* pWrtShell
;
261 DECL_LINK(CheckBoxHdl
, void *);
264 SwTableOptionsTabPage( Window
* pParent
,
265 const SfxItemSet
& rSet
);
266 ~SwTableOptionsTabPage();
270 static SfxTabPage
* Create( Window
* pParent
,
271 const SfxItemSet
& rAttrSet
);
273 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
274 virtual void Reset( const SfxItemSet
& rSet
);
276 void SetWrtShell(SwWrtShell
* pSh
) {pWrtShell
= pSh
;}
277 virtual void PageCreated (SfxAllItemSet aSet
);
281 /*--------------------------------------------------
282 TabPage for ShadowCrsr
283 --------------------------------------------------*/
284 class SwShdwCrsrOptionsTabPage
: public SfxTabPage
286 //nonprinting characters
287 FixedLine aUnprintFL
;
294 CheckBox aCharHiddenCB
;
295 CheckBox aFldHiddenCB
;
296 CheckBox aFldHiddenParaCB
;
298 FixedLine aSeparatorFL
;
303 FixedText aFillModeFT
;
304 RadioButton aFillMarginRB
;
305 RadioButton aFillIndentRB
;
306 RadioButton aFillTabRB
;
307 RadioButton aFillSpaceRB
;
309 FixedLine aCrsrOptFL
;
310 CheckBox aCrsrInProtCB
;
312 FixedLine m_aLayoutOptionsFL
;
313 CheckBox m_aMathBaselineAlignmentCB
;
315 SwWrtShell
* m_pWrtShell
;
318 SwShdwCrsrOptionsTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
319 ~SwShdwCrsrOptionsTabPage();
323 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
325 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
326 virtual void Reset( const SfxItemSet
& rSet
);
328 void SetWrtShell( SwWrtShell
* pSh
) { m_pWrtShell
= pSh
; }
329 virtual void PageCreated( SfxAllItemSet aSet
);
332 /*-----------------------------------------------------------------------
333 Description: mark preview
334 -----------------------------------------------------------------------*/
335 class SwMarkPreview
: public Window
337 Color m_aBgCol
; // background
338 Color m_aTransCol
; // transparency
339 Color m_aMarkCol
; // marks
340 Color m_aLineCol
; // general lines
341 Color m_aShadowCol
; // shadow
342 Color m_aTxtCol
; // text
343 Color m_aPrintAreaCol
; // frame for print area
346 Rectangle aLeftPagePrtArea
;
347 Rectangle aRightPagePrtArea
;
351 using OutputDevice::DrawRect
;
352 void DrawRect(const Rectangle
&rRect
, const Color
&rFillColor
, const Color
&rLineColor
);
354 void Paint(const Rectangle
&);
355 void PaintPage(const Rectangle
&rRect
);
356 void InitColors( void );
359 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
362 SwMarkPreview(Window
* pParent
, const ResId
& rResID
);
363 virtual ~SwMarkPreview();
365 inline void SetColor(const Color
& rCol
) { m_aMarkCol
= rCol
; }
366 inline void SetMarkPos(sal_uInt16 nPos
) { nMarkPos
= nPos
; }
369 /*-----------------------------------------------------------------------
370 Description: redlining options
371 -----------------------------------------------------------------------*/
372 class SwRedlineOptionsTabPage
: public SfxTabPage
377 FixedText aInsertAttrFT
;
379 FixedText aInsertColorFT
;
380 ColorListBox aInsertColorLB
;
381 SvxFontPrevWindow aInsertedPreviewWN
;
383 FixedText aDeletedFT
;
384 FixedText aDeletedAttrFT
;
386 FixedText aDeletedColorFT
;
387 ColorListBox aDeletedColorLB
;
388 SvxFontPrevWindow aDeletedPreviewWN
;
390 FixedText aChangedFT
;
391 FixedText aChangedAttrFT
;
393 FixedText aChangedColorFT
;
394 ColorListBox aChangedColorLB
;
395 SvxFontPrevWindow aChangedPreviewWN
;
397 FixedLine aChangedFL
;
399 FixedText aMarkPosFT
;
401 FixedText aMarkColorFT
;
402 ColorListBox aMarkColorLB
;
403 SwMarkPreview aMarkPreviewWN
;
408 SwRedlineOptionsTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
409 ~SwRedlineOptionsTabPage();
411 DECL_LINK( AttribHdl
, ListBox
*pLB
);
412 DECL_LINK(ChangedMaskPrevHdl
, void * = 0);
413 DECL_LINK( ColorHdl
, ColorListBox
*pColorLB
);
415 void InitFontStyle(SvxFontPrevWindow
& rExampleWin
);
419 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
421 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
422 virtual void Reset( const SfxItemSet
& rSet
);
425 /*-------------------------------------------------------
426 TabPage test settings for SW
427 --------------------------------------------------------- */
431 class SwTestTabPage
: public SfxTabPage
434 SwTestTabPage( Window
* pParent
,
435 const SfxItemSet
& rSet
);
437 static SfxTabPage
* Create( Window
* pParent
,
438 const SfxItemSet
& rAttrSet
);
440 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
441 virtual void Reset( const SfxItemSet
& rSet
);
444 CheckBox
* m_pTest1CBox
;
445 CheckBox
* m_pTest2CBox
;
446 CheckBox
* m_pTest3CBox
;
447 CheckBox
* m_pTest4CBox
;
448 CheckBox
* m_pTest5CBox
;
449 CheckBox
* m_pTest6CBox
;
450 CheckBox
* m_pTest7CBox
;
451 CheckBox
* m_pTest8CBox
;
452 CheckBox
* m_pTest9CBox
;
453 CheckBox
* m_pTest10CBox
;
455 sal_Bool bAttrModified
;
458 DECL_LINK(AutoClickHdl
, void *);
463 class SwCompareOptionsTabPage
: public SfxTabPage
465 RadioButton
* m_pAutoRB
;
466 RadioButton
* m_pWordRB
;
467 RadioButton
* m_pCharRB
;
470 CheckBox
* m_pIgnoreCB
;
471 NumericField
* m_pLenNF
;
473 SwCompareOptionsTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
474 ~SwCompareOptionsTabPage();
476 DECL_LINK(ComparisonHdl
, void *);
477 DECL_LINK(IgnoreHdl
, void *);
481 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
483 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
484 virtual void Reset( const SfxItemSet
& rSet
);
488 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */