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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_OPTLOAD_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_OPTLOAD_HXX
22 #include <tools/globname.hxx>
23 #include <sfx2/tabdlg.hxx>
25 #include <vcl/customweld.hxx>
26 #include <vcl/textfilter.hxx>
27 #include <vcl/weld.hxx>
28 #include <sfx2/basedlgs.hxx>
30 #include <SwCapObjType.hxx>
35 class SwFieldUnitTable
38 static OUString
GetString(sal_uInt32 i
);
39 static sal_uInt32
Count();
40 static FieldUnit
GetValue(sal_uInt32 i
);
43 class TextFilterAutoConvert
: public TextFilter
46 OUString m_sLastGoodText
;
49 TextFilterAutoConvert(const OUString
&rNone
)
53 virtual OUString
filter(const OUString
&rText
) override
;
56 class SwLoadOptPage
: public SfxTabPage
59 SwWrtShell
* m_pWrtShell
;
60 sal_uInt16 m_nLastTab
;
61 sal_Int32 m_nOldLinkMode
;
63 std::unique_ptr
<weld::RadioButton
> m_xAlwaysRB
;
64 std::unique_ptr
<weld::RadioButton
> m_xRequestRB
;
65 std::unique_ptr
<weld::RadioButton
> m_xNeverRB
;
67 std::unique_ptr
<weld::CheckButton
> m_xAutoUpdateFields
;
68 std::unique_ptr
<weld::CheckButton
> m_xAutoUpdateCharts
;
70 std::unique_ptr
<weld::ComboBox
> m_xMetricLB
;
71 std::unique_ptr
<weld::Label
> m_xTabFT
;
72 std::unique_ptr
<weld::MetricSpinButton
> m_xTabMF
;
73 std::unique_ptr
<weld::CheckButton
> m_xUseSquaredPageMode
;
74 std::unique_ptr
<weld::CheckButton
> m_xUseCharUnit
;
75 std::unique_ptr
<weld::Entry
> m_xWordCountED
;
76 std::unique_ptr
<weld::CheckButton
> m_xShowStandardizedPageCount
;
77 std::unique_ptr
<weld::SpinButton
> m_xStandardizedPageSizeNF
;
79 DECL_LINK(MetricHdl
, weld::ComboBox
&, void);
80 DECL_LINK(StandardizedPageCountCheckHdl
, weld::Button
&, void);
83 SwLoadOptPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
84 virtual ~SwLoadOptPage() override
;
86 static std::unique_ptr
<SfxTabPage
> Create( weld::Container
* pPage
, weld::DialogController
* pController
,
87 const SfxItemSet
* rAttrSet
);
89 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
90 virtual void Reset( const SfxItemSet
* rSet
) override
;
93 class SwCaptionOptDlg
: public SfxSingleTabDialogController
96 SwCaptionOptDlg(weld::Window
* pParent
, const SfxItemSet
& rSet
);
99 class SwCaptionPreview
: public weld::CustomWidgetController
103 bool mbFontInitialized
;
106 void ApplySettings(vcl::RenderContext
& rRenderContext
);
110 virtual void SetDrawingArea(weld::DrawingArea
* pDrawingArea
) override
;
111 void SetPreviewText(const OUString
& rText
);
112 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
115 class SwCaptionOptPage
: public SfxTabPage
120 OUString m_sSWGraphic
;
123 OUString m_sIllustration
;
135 int m_nPrevSelectedEntry
;
137 std::unique_ptr
<SwFieldMgr
> pMgr
;
140 TextFilterAutoConvert m_aTextFilter
;
142 SwCaptionPreview m_aPreview
;
143 std::unique_ptr
<weld::TreeView
> m_xCheckLB
;
144 std::unique_ptr
<weld::ComboBox
> m_xLbCaptionOrder
;
146 std::unique_ptr
<weld::Widget
> m_xSettingsGroup
;
147 std::unique_ptr
<weld::ComboBox
> m_xCategoryBox
;
148 std::unique_ptr
<weld::Label
> m_xFormatText
;
149 std::unique_ptr
<weld::ComboBox
> m_xFormatBox
;
150 //#i61007# order of captions
151 std::unique_ptr
<weld::Label
> m_xNumberingSeparatorFT
;
152 std::unique_ptr
<weld::Entry
> m_xNumberingSeparatorED
;
153 std::unique_ptr
<weld::Label
> m_xTextText
;
154 std::unique_ptr
<weld::Entry
> m_xTextEdit
;
155 std::unique_ptr
<weld::ComboBox
> m_xPosBox
;
157 std::unique_ptr
<weld::Widget
> m_xNumCapt
;
158 std::unique_ptr
<weld::ComboBox
> m_xLbLevel
;
159 std::unique_ptr
<weld::Entry
> m_xEdDelim
;
161 std::unique_ptr
<weld::Widget
> m_xCategory
;
162 std::unique_ptr
<weld::ComboBox
> m_xCharStyleLB
;
163 std::unique_ptr
<weld::CheckButton
> m_xApplyBorderCB
;
164 std::unique_ptr
<weld::CustomWeld
> m_xPreview
;
166 DECL_LINK(SelectHdl
, weld::ComboBox
&, void);
167 DECL_LINK(SelectListBoxHdl
, weld::ComboBox
&, void);
168 DECL_LINK(ModifyEntryHdl
, weld::Entry
&, void);
169 DECL_LINK(ModifyComboHdl
, weld::ComboBox
&, void);
170 DECL_LINK(OrderHdl
, weld::ComboBox
&, void );
171 DECL_LINK(ShowEntryHdl
, weld::TreeView
&, void);
172 DECL_LINK(ToggleEntryHdl
, const weld::TreeView::iter_col
&, void);
173 DECL_LINK(TextFilterHdl
, OUString
&, bool);
176 void UpdateEntry(int nRow
);
178 void SetOptions(const sal_uLong nPos
, const SwCapObjType eType
, const SvGlobalName
*pOleId
= nullptr);
179 void SaveEntry(int nEntry
);
180 void InvalidatePreview();
183 SwCaptionOptPage(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rSet
);
184 virtual ~SwCaptionOptPage() override
;
186 static std::unique_ptr
<SfxTabPage
> Create(weld::Container
* pPage
, weld::DialogController
* pController
,
187 const SfxItemSet
* rAttrSet
);
189 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
190 virtual void Reset( const SfxItemSet
* rSet
) override
;
195 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */