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 .
22 #include <sfx2/tabdlg.hxx>
24 #include <vcl/weld.hxx>
25 #include <svtools/ctrlbox.hxx>
26 #include <svx/colorbox.hxx>
27 #include <svx/fntctrl.hxx>
28 #include "fontcfg.hxx"
30 class SwStdFontConfig
;
34 // Tools->Options->Writer->View
35 // Tools->Options->Writer/Web->View
36 class SwContentOptPage final
: public SfxTabPage
38 std::unique_ptr
<weld::CheckButton
> m_xCrossCB
;
40 std::unique_ptr
<weld::ComboBox
> m_xHMetric
;
41 std::unique_ptr
<weld::CheckButton
> m_xVRulerCBox
;
42 std::unique_ptr
<weld::CheckButton
> m_xVRulerRightCBox
;
43 std::unique_ptr
<weld::ComboBox
> m_xVMetric
;
44 std::unique_ptr
<weld::CheckButton
> m_xSmoothCBox
;
46 std::unique_ptr
<weld::CheckButton
> m_xGrfCB
;
47 std::unique_ptr
<weld::CheckButton
> m_xTableCB
;
48 std::unique_ptr
<weld::CheckButton
> m_xDrwCB
;
49 std::unique_ptr
<weld::CheckButton
> m_xPostItCB
;
51 std::unique_ptr
<weld::Frame
> m_xSettingsFrame
;
52 std::unique_ptr
<weld::Label
> m_xSettingsLabel
;
53 std::unique_ptr
<weld::Label
> m_xMetricLabel
;
54 std::unique_ptr
<weld::ComboBox
> m_xMetricLB
;
56 std::unique_ptr
<weld::CheckButton
> m_xShowInlineTooltips
;
57 std::unique_ptr
<weld::CheckButton
> m_xShowOutlineContentVisibilityButton
;
58 std::unique_ptr
<weld::CheckButton
> m_xTreatSubOutlineLevelsAsContent
;
59 std::unique_ptr
<weld::CheckButton
> m_xShowChangesInMargin
;
60 std::unique_ptr
<weld::CheckButton
> m_xFieldHiddenCB
;
61 std::unique_ptr
<weld::CheckButton
> m_xFieldHiddenParaCB
;
63 DECL_LINK(VertRulerHdl
, weld::Toggleable
&, void);
64 DECL_LINK(ShowOutlineContentVisibilityButtonHdl
, weld::Toggleable
&, void);
66 SwContentOptPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
67 virtual ~SwContentOptPage() override
;
69 static std::unique_ptr
<SfxTabPage
> Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rAttrSet
);
71 virtual bool FillItemSet(SfxItemSet
* rSet
) override
;
72 virtual void Reset(const SfxItemSet
* rSet
) override
;
75 // TabPage printer settings additions
76 class SwAddPrinterTabPage final
: public SfxTabPage
82 std::unique_ptr
<weld::CheckButton
> m_xGrfCB
;
83 std::unique_ptr
<weld::CheckButton
> m_xCtrlFieldCB
;
84 std::unique_ptr
<weld::CheckButton
> m_xBackgroundCB
;
85 std::unique_ptr
<weld::CheckButton
> m_xBlackFontCB
;
86 std::unique_ptr
<weld::CheckButton
> m_xPrintHiddenTextCB
;
87 std::unique_ptr
<weld::CheckButton
> m_xPrintTextPlaceholderCB
;
89 std::unique_ptr
<weld::Widget
> m_xPagesFrame
;
90 std::unique_ptr
<weld::CheckButton
> m_xLeftPageCB
;
91 std::unique_ptr
<weld::CheckButton
> m_xRightPageCB
;
92 std::unique_ptr
<weld::CheckButton
> m_xProspectCB
;
93 std::unique_ptr
<weld::CheckButton
> m_xProspectCB_RTL
;
95 std::unique_ptr
<weld::Widget
> m_xCommentsFrame
;
96 std::unique_ptr
<weld::RadioButton
> m_xNoRB
;
97 std::unique_ptr
<weld::RadioButton
> m_xOnlyRB
;
98 std::unique_ptr
<weld::RadioButton
> m_xEndRB
;
99 std::unique_ptr
<weld::RadioButton
> m_xEndPageRB
;
100 std::unique_ptr
<weld::RadioButton
> m_xInMarginsRB
;
102 std::unique_ptr
<weld::CheckButton
> m_xPrintEmptyPagesCB
;
103 std::unique_ptr
<weld::CheckButton
> m_xPaperFromSetupCB
;
104 std::unique_ptr
<weld::ComboBox
> m_xFaxLB
;
106 DECL_LINK(AutoClickHdl
, weld::Toggleable
&, void);
107 DECL_LINK(SelectHdl
, weld::ComboBox
&, void);
110 SwAddPrinterTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
111 virtual ~SwAddPrinterTabPage() override
;
113 static std::unique_ptr
<SfxTabPage
> Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rAttrSet
);
115 virtual bool FillItemSet(SfxItemSet
* rSet
) override
;
116 virtual void Reset(const SfxItemSet
* rSet
) override
;
117 void SetFax(const std::vector
<OUString
>& );
118 void SetPreview(bool bPrev
);
119 virtual void PageCreated(const SfxAllItemSet
& aSet
) override
;
122 class SwStdFontTabPage final
: public SfxTabPage
124 OUString m_sShellStd
;
125 OUString m_sShellTitle
;
126 OUString m_sShellList
;
127 OUString m_sShellLabel
;
128 OUString m_sShellIndex
;
130 VclPtr
<SfxPrinter
> m_pPrt
;
131 std::unique_ptr
<FontList
> m_pFontList
;
132 SwStdFontConfig
* m_pFontConfig
;
133 SwWrtShell
* m_pWrtShell
;
134 LanguageType m_eLanguage
;
136 // only defaults were there? they were signed with the boxes
137 bool m_bListDefault
:1;
138 bool m_bSetListDefault
:1;
139 bool m_bLabelDefault
:1;
140 bool m_bSetLabelDefault
:1;
141 bool m_bIdxDefault
:1;
142 bool m_bSetIdxDefault
:1;
143 bool m_bDisposePrinter
:1;
145 sal_uInt8 m_nFontGroup
; //fontcfg.hxx: FONT_GROUP_[STANDARD|CJK|CTL]
147 OUString m_sScriptWestern
;
148 OUString m_sScriptAsian
;
149 OUString m_sScriptComplex
;
151 std::unique_ptr
<weld::Label
> m_xLabelFT
;
152 std::unique_ptr
<weld::ComboBox
> m_xStandardBox
;
153 std::unique_ptr
<FontSizeBox
> m_xStandardHeightLB
;
154 std::unique_ptr
<weld::ComboBox
> m_xTitleBox
;
155 std::unique_ptr
<FontSizeBox
> m_xTitleHeightLB
;
156 std::unique_ptr
<weld::ComboBox
> m_xListBox
;
157 std::unique_ptr
<FontSizeBox
> m_xListHeightLB
;
158 std::unique_ptr
<weld::ComboBox
> m_xLabelBox
;
159 std::unique_ptr
<FontSizeBox
> m_xLabelHeightLB
;
160 std::unique_ptr
<weld::ComboBox
> m_xIdxBox
;
161 std::unique_ptr
<FontSizeBox
> m_xIndexHeightLB
;
162 std::unique_ptr
<weld::Button
> m_xStandardPB
;
164 DECL_LINK(StandardHdl
, weld::Button
&, void );
165 DECL_LINK(ModifyHdl
, weld::ComboBox
&, void );
166 DECL_LINK(LoseFocusHdl
, weld::Widget
&, void );
169 SwStdFontTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
170 static std::unique_ptr
<SfxTabPage
> Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rAttrSet
);
171 virtual ~SwStdFontTabPage() override
;
173 virtual bool FillItemSet(SfxItemSet
* rSet
) override
;
174 virtual void Reset(const SfxItemSet
* rSet
) override
;
176 virtual void PageCreated(const SfxAllItemSet
& aSet
) override
;
179 class SwTableOptionsTabPage final
: public SfxTabPage
181 SwWrtShell
* m_pWrtShell
;
184 std::unique_ptr
<weld::CheckButton
> m_xHeaderCB
;
185 std::unique_ptr
<weld::CheckButton
> m_xRepeatHeaderCB
;
186 std::unique_ptr
<weld::CheckButton
> m_xDontSplitCB
;
187 std::unique_ptr
<weld::CheckButton
> m_xBorderCB
;
189 std::unique_ptr
<weld::CheckButton
> m_xNumFormattingCB
;
190 std::unique_ptr
<weld::CheckButton
> m_xNumFormatFormattingCB
;
191 std::unique_ptr
<weld::CheckButton
> m_xNumAlignmentCB
;
193 std::unique_ptr
<weld::MetricSpinButton
> m_xRowMoveMF
;
194 std::unique_ptr
<weld::MetricSpinButton
> m_xColMoveMF
;
196 std::unique_ptr
<weld::MetricSpinButton
> m_xRowInsertMF
;
197 std::unique_ptr
<weld::MetricSpinButton
> m_xColInsertMF
;
199 std::unique_ptr
<weld::RadioButton
> m_xFixRB
;
200 std::unique_ptr
<weld::RadioButton
> m_xFixPropRB
;
201 std::unique_ptr
<weld::RadioButton
> m_xVarRB
;
203 DECL_LINK(CheckBoxHdl
, weld::Toggleable
&, void);
206 SwTableOptionsTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
207 virtual ~SwTableOptionsTabPage() override
;
209 static std::unique_ptr
<SfxTabPage
> Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rAttrSet
);
211 virtual bool FillItemSet(SfxItemSet
* rSet
) override
;
212 virtual void Reset(const SfxItemSet
* rSet
) override
;
214 virtual void PageCreated( const SfxAllItemSet
& aSet
) override
;
218 // TabPage for ShadowCursor
219 class SwShdwCursorOptionsTabPage final
: public SfxTabPage
221 SwWrtShell
* m_pWrtShell
;
223 //nonprinting characters
224 std::unique_ptr
<weld::CheckButton
> m_xParaCB
;
225 std::unique_ptr
<weld::CheckButton
> m_xSHyphCB
;
226 std::unique_ptr
<weld::CheckButton
> m_xSpacesCB
;
227 std::unique_ptr
<weld::CheckButton
> m_xHSpacesCB
;
228 std::unique_ptr
<weld::CheckButton
> m_xTabCB
;
229 std::unique_ptr
<weld::Label
> m_xTabLabel
;
230 std::unique_ptr
<weld::CheckButton
> m_xBreakCB
;
231 std::unique_ptr
<weld::CheckButton
> m_xCharHiddenCB
;
232 std::unique_ptr
<weld::CheckButton
> m_xBookmarkCB
;
233 std::unique_ptr
<weld::Label
> m_xBookmarkLabel
;
235 std::unique_ptr
<weld::Frame
> m_xDirectCursorFrame
;
236 std::unique_ptr
<weld::CheckButton
> m_xOnOffCB
;
238 std::unique_ptr
<weld::ComboBox
> m_xDirectCursorFillMode
;
239 std::unique_ptr
<weld::Frame
> m_xCursorProtFrame
;
240 std::unique_ptr
<weld::Frame
> m_xImageFrame
;
241 std::unique_ptr
<weld::CheckButton
> m_xCursorInProtCB
;
243 std::unique_ptr
<weld::ComboBox
> m_xDefaultAnchorType
;
245 std::unique_ptr
<weld::CheckButton
> m_xMathBaselineAlignmentCB
;
248 SwShdwCursorOptionsTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
249 virtual ~SwShdwCursorOptionsTabPage() override
;
251 static std::unique_ptr
<SfxTabPage
> Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rAttrSet
);
253 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
254 virtual void Reset( const SfxItemSet
* rSet
) override
;
256 virtual void PageCreated( const SfxAllItemSet
& aSet
) override
;
260 class SwMarkPreview final
: public weld::CustomWidgetController
262 Color m_aBgCol
; // background
263 Color m_aTransCol
; // transparency
264 Color m_aMarkCol
; // marks
265 Color m_aLineCol
; // general lines
266 Color m_aShadowCol
; // shadow
267 Color m_aTextCol
; // text
268 Color m_aPrintAreaCol
; // frame for print area
270 tools::Rectangle m_aPage
;
271 tools::Rectangle m_aLeftPagePrtArea
;
272 tools::Rectangle m_aRightPagePrtArea
;
274 sal_uInt16 m_nMarkPos
;
276 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
&) override
;
277 void PaintPage(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
&rRect
);
282 virtual void SetDrawingArea(weld::DrawingArea
* pDrawingArea
) override
;
283 virtual ~SwMarkPreview() override
;
285 void SetColor(const Color
& rCol
) { m_aMarkCol
= rCol
; }
286 void SetMarkPos(sal_uInt16 nPos
) { m_nMarkPos
= nPos
; }
290 class SwRedlineOptionsTabPage final
: public SfxTabPage
292 std::unique_ptr
<weld::ComboBox
> m_xInsertLB
;
293 std::unique_ptr
<ColorListBox
> m_xInsertColorLB
;
294 std::unique_ptr
<SvxFontPrevWindow
> m_xInsertedPreviewWN
;
295 std::unique_ptr
<weld::CustomWeld
> m_xInsertedPreview
;
297 std::unique_ptr
<weld::ComboBox
> m_xDeletedLB
;
298 std::unique_ptr
<ColorListBox
> m_xDeletedColorLB
;
299 std::unique_ptr
<SvxFontPrevWindow
> m_xDeletedPreviewWN
;
300 std::unique_ptr
<weld::CustomWeld
> m_xDeletedPreview
;
302 std::unique_ptr
<weld::ComboBox
> m_xChangedLB
;
303 std::unique_ptr
<ColorListBox
> m_xChangedColorLB
;
304 std::unique_ptr
<SvxFontPrevWindow
> m_xChangedPreviewWN
;
305 std::unique_ptr
<weld::CustomWeld
> m_xChangedPreview
;
307 std::unique_ptr
<weld::ComboBox
> m_xMarkPosLB
;
308 std::unique_ptr
<ColorListBox
> m_xMarkColorLB
;
309 std::unique_ptr
<SwMarkPreview
> m_xMarkPreviewWN
;
310 std::unique_ptr
<weld::CustomWeld
> m_xMarkPreview
;
312 DECL_LINK(AttribHdl
, weld::ComboBox
&, void);
313 void ChangedMaskPrev();
314 DECL_LINK(ChangedMaskPrevHdl
, weld::ComboBox
&, void);
315 DECL_LINK(ChangedMaskColorPrevHdl
, ColorListBox
&, void);
316 DECL_LINK(ColorHdl
, ColorListBox
&, void);
318 static void InitFontStyle(SvxFontPrevWindow
& rExampleWin
, const OUString
& rText
);
321 SwRedlineOptionsTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
322 virtual ~SwRedlineOptionsTabPage() override
;
324 static std::unique_ptr
<SfxTabPage
> Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rAttrSet
);
326 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
327 virtual void Reset( const SfxItemSet
* rSet
) override
;
330 // TabPage test settings for SW
334 class SwTestTabPage final
: public SfxTabPage
337 SwTestTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
338 virtual ~SwTestTabPage() override
;
340 static std::unique_ptr
<SfxTabPage
> Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rAttrSet
);
342 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
343 virtual void Reset( const SfxItemSet
* rSet
) override
;
346 bool m_bAttrModified
;
348 std::unique_ptr
<weld::CheckButton
> m_xTest1CBox
;
349 std::unique_ptr
<weld::CheckButton
> m_xTest2CBox
;
350 std::unique_ptr
<weld::CheckButton
> m_xTest3CBox
;
351 std::unique_ptr
<weld::CheckButton
> m_xTest4CBox
;
352 std::unique_ptr
<weld::CheckButton
> m_xTest5CBox
;
353 std::unique_ptr
<weld::CheckButton
> m_xTest6CBox
;
354 std::unique_ptr
<weld::CheckButton
> m_xTest7CBox
;
355 std::unique_ptr
<weld::CheckButton
> m_xTest8CBox
;
356 std::unique_ptr
<weld::CheckButton
> m_xTest9CBox
;
357 std::unique_ptr
<weld::CheckButton
> m_xTest10CBox
;
360 DECL_LINK(AutoClickHdl
, weld::Toggleable
&, void);
364 class SwCompareOptionsTabPage final
: public SfxTabPage
366 std::unique_ptr
<weld::RadioButton
> m_xAutoRB
;
367 std::unique_ptr
<weld::RadioButton
> m_xWordRB
;
368 std::unique_ptr
<weld::RadioButton
> m_xCharRB
;
369 std::unique_ptr
<weld::CheckButton
> m_xRsidCB
;
370 std::unique_ptr
<weld::CheckButton
> m_xIgnoreCB
;
371 std::unique_ptr
<weld::SpinButton
> m_xLenNF
;
372 std::unique_ptr
<weld::CheckButton
> m_xStoreRsidCB
;
374 DECL_LINK(ComparisonHdl
, weld::Toggleable
&, void);
375 DECL_LINK(IgnoreHdl
, weld::Toggleable
&, void);
378 SwCompareOptionsTabPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
379 virtual ~SwCompareOptionsTabPage() override
;
381 static std::unique_ptr
<SfxTabPage
> Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rAttrSet
);
383 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
384 virtual void Reset( const SfxItemSet
* rSet
) override
;
387 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */