nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / uibase / inc / optpage.hxx
blob31be1cc611e9aa157b9bf517eb84223a8b1b4e35
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_OPTPAGE_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_OPTPAGE_HXX
21 #include <sfx2/tabdlg.hxx>
23 #include <vcl/weld.hxx>
24 #include <svtools/ctrlbox.hxx>
25 #include <svx/colorbox.hxx>
26 #include <svx/fntctrl.hxx>
27 #include "fontcfg.hxx"
28 class SfxPrinter;
29 class SwStdFontConfig;
30 class SwWrtShell;
31 class FontList;
33 // Tools->Options->Writer->View
34 // Tools->Options->Writer/Web->View
35 class SwContentOptPage : public SfxTabPage
37 std::unique_ptr<weld::CheckButton> m_xCrossCB;
39 std::unique_ptr<weld::ComboBox> m_xHMetric;
40 std::unique_ptr<weld::CheckButton> m_xVRulerCBox;
41 std::unique_ptr<weld::CheckButton> m_xVRulerRightCBox;
42 std::unique_ptr<weld::ComboBox> m_xVMetric;
43 std::unique_ptr<weld::CheckButton> m_xSmoothCBox;
45 std::unique_ptr<weld::CheckButton> m_xGrfCB;
46 std::unique_ptr<weld::CheckButton> m_xTableCB;
47 std::unique_ptr<weld::CheckButton> m_xDrwCB;
48 std::unique_ptr<weld::CheckButton> m_xPostItCB;
50 std::unique_ptr<weld::Frame> m_xSettingsFrame;
51 std::unique_ptr<weld::Label> m_xSettingsLabel;
52 std::unique_ptr<weld::Label> m_xMetricLabel;
53 std::unique_ptr<weld::ComboBox> m_xMetricLB;
55 std::unique_ptr<weld::CheckButton> m_xShowInlineTooltips;
56 std::unique_ptr<weld::CheckButton> m_xShowOutlineContentVisibilityButton;
57 std::unique_ptr<weld::CheckButton> m_xShowChangesInMargin;
58 std::unique_ptr<weld::CheckButton> m_xFieldHiddenCB;
59 std::unique_ptr<weld::CheckButton> m_xFieldHiddenParaCB;
61 DECL_LINK(VertRulerHdl, weld::ToggleButton&, void);
62 public:
63 SwContentOptPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
64 virtual ~SwContentOptPage() override;
66 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
68 virtual bool FillItemSet(SfxItemSet* rSet) override;
69 virtual void Reset(const SfxItemSet* rSet) override;
72 // TabPage printer settings additions
73 class SwAddPrinterTabPage : public SfxTabPage
75 OUString sNone;
76 bool bAttrModified;
77 bool bPreview;
79 std::unique_ptr<weld::CheckButton> m_xGrfCB;
80 std::unique_ptr<weld::CheckButton> m_xCtrlFieldCB;
81 std::unique_ptr<weld::CheckButton> m_xBackgroundCB;
82 std::unique_ptr<weld::CheckButton> m_xBlackFontCB;
83 std::unique_ptr<weld::CheckButton> m_xPrintHiddenTextCB;
84 std::unique_ptr<weld::CheckButton> m_xPrintTextPlaceholderCB;
86 std::unique_ptr<weld::Widget> m_xPagesFrame;
87 std::unique_ptr<weld::CheckButton> m_xLeftPageCB;
88 std::unique_ptr<weld::CheckButton> m_xRightPageCB;
89 std::unique_ptr<weld::CheckButton> m_xProspectCB;
90 std::unique_ptr<weld::CheckButton> m_xProspectCB_RTL;
92 std::unique_ptr<weld::Widget> m_xCommentsFrame;
93 std::unique_ptr<weld::RadioButton> m_xNoRB;
94 std::unique_ptr<weld::RadioButton> m_xOnlyRB;
95 std::unique_ptr<weld::RadioButton> m_xEndRB;
96 std::unique_ptr<weld::RadioButton> m_xEndPageRB;
97 std::unique_ptr<weld::RadioButton> m_xInMarginsRB;
99 std::unique_ptr<weld::CheckButton> m_xPrintEmptyPagesCB;
100 std::unique_ptr<weld::CheckButton> m_xPaperFromSetupCB;
101 std::unique_ptr<weld::ComboBox> m_xFaxLB;
103 DECL_LINK(AutoClickHdl, weld::ToggleButton&, void);
104 DECL_LINK(SelectHdl, weld::ComboBox&, void);
106 public:
107 SwAddPrinterTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
108 virtual ~SwAddPrinterTabPage() override;
110 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
112 virtual bool FillItemSet(SfxItemSet* rSet) override;
113 virtual void Reset(const SfxItemSet* rSet) override;
114 void SetFax(const std::vector<OUString>& );
115 void SetPreview(bool bPrev);
116 virtual void PageCreated(const SfxAllItemSet& aSet) override;
119 class SwStdFontTabPage : public SfxTabPage
121 OUString m_sShellStd;
122 OUString m_sShellTitle;
123 OUString m_sShellList;
124 OUString m_sShellLabel;
125 OUString m_sShellIndex;
127 VclPtr<SfxPrinter> m_pPrt;
128 std::unique_ptr<FontList> m_pFontList;
129 SwStdFontConfig* m_pFontConfig;
130 SwWrtShell* m_pWrtShell;
131 LanguageType m_eLanguage;
133 // only defaults were there? they were signed with the boxes
134 bool m_bListDefault :1;
135 bool m_bSetListDefault :1;
136 bool m_bLabelDefault :1;
137 bool m_bSetLabelDefault :1;
138 bool m_bIdxDefault :1;
139 bool m_bSetIdxDefault :1;
140 bool m_bDisposePrinter :1;
142 bool m_bListHeightDefault :1;
143 bool m_bLabelHeightDefault :1;
144 bool m_bIndexHeightDefault :1;
146 sal_uInt8 m_nFontGroup; //fontcfg.hxx: FONT_GROUP_[STANDARD|CJK|CTL]
148 OUString m_sScriptWestern;
149 OUString m_sScriptAsian;
150 OUString m_sScriptComplex;
152 std::unique_ptr<weld::Label> m_xLabelFT;
153 std::unique_ptr<weld::ComboBox> m_xStandardBox;
154 std::unique_ptr<FontSizeBox> m_xStandardHeightLB;
155 std::unique_ptr<weld::ComboBox> m_xTitleBox;
156 std::unique_ptr<FontSizeBox> m_xTitleHeightLB;
157 std::unique_ptr<weld::ComboBox> m_xListBox;
158 std::unique_ptr<FontSizeBox> m_xListHeightLB;
159 std::unique_ptr<weld::ComboBox> m_xLabelBox;
160 std::unique_ptr<FontSizeBox> m_xLabelHeightLB;
161 std::unique_ptr<weld::ComboBox> m_xIdxBox;
162 std::unique_ptr<FontSizeBox> m_xIndexHeightLB;
163 std::unique_ptr<weld::Button> m_xStandardPB;
165 DECL_LINK(StandardHdl, weld::Button&, void );
166 DECL_LINK(ModifyHdl, weld::ComboBox&, void );
167 DECL_LINK(LoseFocusHdl, weld::Widget&, void );
169 public:
170 SwStdFontTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
171 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
172 virtual ~SwStdFontTabPage() override;
174 virtual bool FillItemSet(SfxItemSet* rSet) override;
175 virtual void Reset(const SfxItemSet* rSet) override;
177 virtual void PageCreated(const SfxAllItemSet& aSet) override;
180 class SwTableOptionsTabPage : public SfxTabPage
182 SwWrtShell* m_pWrtShell;
183 bool m_bHTMLMode;
185 std::unique_ptr<weld::CheckButton> m_xHeaderCB;
186 std::unique_ptr<weld::CheckButton> m_xRepeatHeaderCB;
187 std::unique_ptr<weld::CheckButton> m_xDontSplitCB;
188 std::unique_ptr<weld::CheckButton> m_xBorderCB;
190 std::unique_ptr<weld::CheckButton> m_xNumFormattingCB;
191 std::unique_ptr<weld::CheckButton> m_xNumFormatFormattingCB;
192 std::unique_ptr<weld::CheckButton> m_xNumAlignmentCB;
194 std::unique_ptr<weld::MetricSpinButton> m_xRowMoveMF;
195 std::unique_ptr<weld::MetricSpinButton> m_xColMoveMF;
197 std::unique_ptr<weld::MetricSpinButton> m_xRowInsertMF;
198 std::unique_ptr<weld::MetricSpinButton> m_xColInsertMF;
200 std::unique_ptr<weld::RadioButton> m_xFixRB;
201 std::unique_ptr<weld::RadioButton> m_xFixPropRB;
202 std::unique_ptr<weld::RadioButton> m_xVarRB;
204 DECL_LINK(CheckBoxHdl, weld::Button&, void);
206 public:
207 SwTableOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
208 virtual ~SwTableOptionsTabPage() override;
210 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
212 virtual bool FillItemSet(SfxItemSet* rSet) override;
213 virtual void Reset(const SfxItemSet* rSet) override;
215 virtual void PageCreated( const SfxAllItemSet& aSet) override;
219 // TabPage for ShadowCursor
220 class SwShdwCursorOptionsTabPage : public SfxTabPage
222 SwWrtShell * m_pWrtShell;
224 //nonprinting characters
225 std::unique_ptr<weld::CheckButton> m_xParaCB;
226 std::unique_ptr<weld::CheckButton> m_xSHyphCB;
227 std::unique_ptr<weld::CheckButton> m_xSpacesCB;
228 std::unique_ptr<weld::CheckButton> m_xHSpacesCB;
229 std::unique_ptr<weld::CheckButton> m_xTabCB;
230 std::unique_ptr<weld::Label> m_xTabLabel;
231 std::unique_ptr<weld::CheckButton> m_xBreakCB;
232 std::unique_ptr<weld::CheckButton> m_xCharHiddenCB;
233 std::unique_ptr<weld::CheckButton> m_xBookmarkCB;
234 std::unique_ptr<weld::Label> m_xBookmarkLabel;
236 std::unique_ptr<weld::Frame> m_xDirectCursorFrame;
237 std::unique_ptr<weld::CheckButton> m_xOnOffCB;
239 std::unique_ptr<weld::ComboBox> m_xDirectCursorFillMode;
240 std::unique_ptr<weld::Frame> m_xCursorProtFrame;
241 std::unique_ptr<weld::Frame> m_xImageFrame;
242 std::unique_ptr<weld::CheckButton> m_xCursorInProtCB;
244 std::unique_ptr<weld::ComboBox> m_xDefaultAnchorType;
246 std::unique_ptr<weld::CheckButton> m_xMathBaselineAlignmentCB;
248 public:
249 SwShdwCursorOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
250 virtual ~SwShdwCursorOptionsTabPage() override;
252 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
254 virtual bool FillItemSet( SfxItemSet* rSet ) override;
255 virtual void Reset( const SfxItemSet* rSet ) override;
257 virtual void PageCreated( const SfxAllItemSet& aSet ) override;
260 // mark preview
261 class SwMarkPreview : public weld::CustomWidgetController
263 Color m_aBgCol; // background
264 Color m_aTransCol; // transparency
265 Color m_aMarkCol; // marks
266 Color m_aLineCol; // general lines
267 Color m_aShadowCol; // shadow
268 Color m_aTextCol; // text
269 Color m_aPrintAreaCol; // frame for print area
271 tools::Rectangle aPage;
272 tools::Rectangle aLeftPagePrtArea;
273 tools::Rectangle aRightPagePrtArea;
275 sal_uInt16 nMarkPos;
277 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
278 void PaintPage(vcl::RenderContext& rRenderContext, const tools::Rectangle &rRect);
279 void InitColors();
281 public:
282 SwMarkPreview();
283 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
284 virtual ~SwMarkPreview() override;
286 void SetColor(const Color& rCol) { m_aMarkCol = rCol; }
287 void SetMarkPos(sal_uInt16 nPos) { nMarkPos = nPos; }
290 // redlining options
291 class SwRedlineOptionsTabPage : public SfxTabPage
293 std::unique_ptr<weld::ComboBox> m_xInsertLB;
294 std::unique_ptr<ColorListBox> m_xInsertColorLB;
295 std::unique_ptr<SvxFontPrevWindow> m_xInsertedPreviewWN;
296 std::unique_ptr<weld::CustomWeld> m_xInsertedPreview;
298 std::unique_ptr<weld::ComboBox> m_xDeletedLB;
299 std::unique_ptr<ColorListBox> m_xDeletedColorLB;
300 std::unique_ptr<SvxFontPrevWindow> m_xDeletedPreviewWN;
301 std::unique_ptr<weld::CustomWeld> m_xDeletedPreview;
303 std::unique_ptr<weld::ComboBox> m_xChangedLB;
304 std::unique_ptr<ColorListBox> m_xChangedColorLB;
305 std::unique_ptr<SvxFontPrevWindow> m_xChangedPreviewWN;
306 std::unique_ptr<weld::CustomWeld> m_xChangedPreview;
308 std::unique_ptr<weld::ComboBox> m_xMarkPosLB;
309 std::unique_ptr<ColorListBox> m_xMarkColorLB;
310 std::unique_ptr<SwMarkPreview> m_xMarkPreviewWN;
311 std::unique_ptr<weld::CustomWeld> m_xMarkPreview;
313 DECL_LINK(AttribHdl, weld::ComboBox&, void);
314 void ChangedMaskPrev();
315 DECL_LINK(ChangedMaskPrevHdl, weld::ComboBox&, void);
316 DECL_LINK(ChangedMaskColorPrevHdl, ColorListBox&, void);
317 DECL_LINK(ColorHdl, ColorListBox&, void);
319 static void InitFontStyle(SvxFontPrevWindow& rExampleWin, const OUString& rText);
321 public:
322 SwRedlineOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
323 virtual ~SwRedlineOptionsTabPage() override;
325 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
327 virtual bool FillItemSet( SfxItemSet* rSet ) override;
328 virtual void Reset( const SfxItemSet* rSet ) override;
331 // TabPage test settings for SW
333 #ifdef DBG_UTIL
335 class SwTestTabPage : public SfxTabPage
337 public:
338 SwTestTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
339 virtual ~SwTestTabPage() override;
341 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
343 virtual bool FillItemSet( SfxItemSet* rSet ) override;
344 virtual void Reset( const SfxItemSet* rSet ) override;
346 private:
347 bool bAttrModified;
349 std::unique_ptr<weld::CheckButton> m_xTest1CBox;
350 std::unique_ptr<weld::CheckButton> m_xTest2CBox;
351 std::unique_ptr<weld::CheckButton> m_xTest3CBox;
352 std::unique_ptr<weld::CheckButton> m_xTest4CBox;
353 std::unique_ptr<weld::CheckButton> m_xTest5CBox;
354 std::unique_ptr<weld::CheckButton> m_xTest6CBox;
355 std::unique_ptr<weld::CheckButton> m_xTest7CBox;
356 std::unique_ptr<weld::CheckButton> m_xTest8CBox;
357 std::unique_ptr<weld::CheckButton> m_xTest9CBox;
358 std::unique_ptr<weld::CheckButton> m_xTest10CBox;
360 void Init();
361 DECL_LINK(AutoClickHdl, weld::Button&, void);
363 #endif // DBG_UTIL
365 class SwCompareOptionsTabPage : public SfxTabPage
367 std::unique_ptr<weld::RadioButton> m_xAutoRB;
368 std::unique_ptr<weld::RadioButton> m_xWordRB;
369 std::unique_ptr<weld::RadioButton> m_xCharRB;
370 std::unique_ptr<weld::CheckButton> m_xRsidCB;
371 std::unique_ptr<weld::CheckButton> m_xIgnoreCB;
372 std::unique_ptr<weld::SpinButton> m_xLenNF;
373 std::unique_ptr<weld::CheckButton> m_xStoreRsidCB;
375 DECL_LINK(ComparisonHdl, weld::Button&, void);
376 DECL_LINK(IgnoreHdl, weld::Button&, void);
378 public:
379 SwCompareOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
380 virtual ~SwCompareOptionsTabPage() override;
382 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet );
384 virtual bool FillItemSet( SfxItemSet* rSet ) override;
385 virtual void Reset( const SfxItemSet* rSet ) override;
388 #endif
389 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */