LibreOffice Module sw (master) 1
optload.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <tools/globname.hxx>
23#include <tools/solar.h>
24#include <sfx2/tabdlg.hxx>
25
26#include <utility>
27#include <vcl/customweld.hxx>
28#include <vcl/textfilter.hxx>
29#include <vcl/weld.hxx>
30#include <sfx2/basedlgs.hxx>
31
32#include <SwCapObjType.hxx>
33
34class SwFieldMgr;
35class SwWrtShell;
36
38{
39public:
40 static OUString GetString(sal_uInt32 i);
41 static sal_uInt32 Count();
42 static FieldUnit GetValue(sal_uInt32 i);
43};
44
46{
47private:
49 OUString m_sNone;
50public:
51 TextFilterAutoConvert(OUString aNone)
52 : m_sNone(std::move(aNone))
53 {
54 }
55 virtual OUString filter(const OUString &rText) override;
56};
57
58class SwLoadOptPage final : public SfxTabPage
59{
60private:
62 sal_uInt16 m_nLastTab;
63 sal_Int32 m_nOldLinkMode;
64
65 std::unique_ptr<weld::RadioButton> m_xAlwaysRB;
66 std::unique_ptr<weld::RadioButton> m_xRequestRB;
67 std::unique_ptr<weld::RadioButton> m_xNeverRB;
68
69 std::unique_ptr<weld::CheckButton> m_xAutoUpdateFields;
70 std::unique_ptr<weld::CheckButton> m_xAutoUpdateCharts;
71
72 std::unique_ptr<weld::ComboBox> m_xMetricLB;
73 std::unique_ptr<weld::Label> m_xTabFT;
74 std::unique_ptr<weld::MetricSpinButton> m_xTabMF;
75 std::unique_ptr<weld::CheckButton> m_xUseSquaredPageMode;
76 std::unique_ptr<weld::CheckButton> m_xUseCharUnit;
77 std::unique_ptr<weld::Entry> m_xWordCountED;
78 std::unique_ptr<weld::CheckButton> m_xShowStandardizedPageCount;
79 std::unique_ptr<weld::SpinButton> m_xStandardizedPageSizeNF;
80
81 DECL_LINK(MetricHdl, weld::ComboBox&, void);
82 DECL_LINK(StandardizedPageCountCheckHdl, weld::Toggleable&, void);
83
84public:
85 SwLoadOptPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
86 virtual ~SwLoadOptPage() override;
87
88 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
89 const SfxItemSet* rAttrSet);
90
91 virtual bool FillItemSet( SfxItemSet* rSet ) override;
92 virtual void Reset( const SfxItemSet* rSet ) override;
93};
94
96{
97public:
99};
100
102{
103private:
104 OUString maText;
107
108 void ApplySettings(vcl::RenderContext& rRenderContext);
109
110public:
112 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
113 void SetPreviewText(const OUString& rText);
114 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
115};
116
117class SwCaptionOptPage final : public SfxTabPage
118{
119private:
120 OUString m_sSWTable;
121 OUString m_sSWFrame;
122 OUString m_sSWGraphic;
123 OUString m_sOLE;
124
126 OUString m_sTable;
127 OUString m_sText;
128 OUString m_sDrawing;
129
130 OUString m_sBegin;
131 OUString m_sEnd;
132 OUString m_sAbove;
133 OUString m_sBelow;
134
135 OUString m_sNone;
136
138
139 std::unique_ptr<SwFieldMgr> m_pMgr;
141
143
145 std::unique_ptr<weld::TreeView> m_xCheckLB;
146 std::unique_ptr<weld::ComboBox> m_xLbCaptionOrder;
147
148 std::unique_ptr<weld::Widget> m_xSettingsGroup;
149 std::unique_ptr<weld::ComboBox> m_xCategoryBox;
150 std::unique_ptr<weld::Label> m_xFormatText;
151 std::unique_ptr<weld::ComboBox> m_xFormatBox;
152 //#i61007# order of captions
153 std::unique_ptr<weld::Label> m_xNumberingSeparatorFT;
154 std::unique_ptr<weld::Entry> m_xNumberingSeparatorED;
155 std::unique_ptr<weld::Label> m_xTextText;
156 std::unique_ptr<weld::Entry> m_xTextEdit;
157 std::unique_ptr<weld::ComboBox> m_xPosBox;
158
159 std::unique_ptr<weld::Widget> m_xNumCapt;
160 std::unique_ptr<weld::ComboBox> m_xLbLevel;
161 std::unique_ptr<weld::Entry> m_xEdDelim;
162
163 std::unique_ptr<weld::Widget> m_xCategory;
164 std::unique_ptr<weld::ComboBox> m_xCharStyleLB;
165 std::unique_ptr<weld::CheckButton> m_xApplyBorderCB;
166 std::unique_ptr<weld::CustomWeld> m_xPreview;
167
168 DECL_LINK(SelectHdl, weld::ComboBox&, void);
169 DECL_LINK(SelectListBoxHdl, weld::ComboBox&, void);
170 DECL_LINK(ModifyEntryHdl, weld::Entry&, void);
171 DECL_LINK(ModifyComboHdl, weld::ComboBox&, void);
172 DECL_LINK(OrderHdl, weld::ComboBox&, void );
173 DECL_LINK(ShowEntryHdl, weld::TreeView&, void);
174 DECL_LINK(ToggleEntryHdl, const weld::TreeView::iter_col&, void);
175 DECL_LINK(TextFilterHdl, OUString&, bool);
176
177 void ModifyHdl();
178 void UpdateEntry(int nRow);
179 void DelUserData();
180 void SetOptions(const sal_uLong nPos, const SwCapObjType eType, const SvGlobalName *pOleId = nullptr);
181 void SaveEntry(int nEntry);
182 void InvalidatePreview();
183
184public:
185 SwCaptionOptPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
186 virtual ~SwCaptionOptPage() override;
187
188 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController,
189 const SfxItemSet* rAttrSet);
190
191 virtual bool FillItemSet( SfxItemSet* rSet ) override;
192 virtual void Reset( const SfxItemSet* rSet ) override;
193};
194
195/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwCapObjType
SwCaptionOptDlg(weld::Window *pParent, const SfxItemSet &rSet)
Definition: optload.cxx:363
std::unique_ptr< weld::Entry > m_xNumberingSeparatorED
Definition: optload.hxx:154
std::unique_ptr< weld::ComboBox > m_xLbCaptionOrder
Definition: optload.hxx:146
std::unique_ptr< weld::ComboBox > m_xCharStyleLB
Definition: optload.hxx:164
std::unique_ptr< weld::Label > m_xNumberingSeparatorFT
Definition: optload.hxx:153
std::unique_ptr< weld::Entry > m_xEdDelim
Definition: optload.hxx:161
OUString m_sSWTable
Definition: optload.hxx:120
std::unique_ptr< weld::Widget > m_xCategory
Definition: optload.hxx:163
std::unique_ptr< weld::ComboBox > m_xCategoryBox
Definition: optload.hxx:149
OUString m_sEnd
Definition: optload.hxx:131
std::unique_ptr< weld::Widget > m_xNumCapt
Definition: optload.hxx:159
DECL_LINK(SelectListBoxHdl, weld::ComboBox &, void)
void UpdateEntry(int nRow)
Definition: optload.cxx:652
OUString m_sSWGraphic
Definition: optload.hxx:122
OUString m_sSWFrame
Definition: optload.hxx:121
void DelUserData()
Definition: optload.cxx:643
OUString m_sDrawing
Definition: optload.hxx:128
void SaveEntry(int nEntry)
Definition: optload.cxx:771
DECL_LINK(TextFilterHdl, OUString &, bool)
TextFilterAutoConvert m_aTextFilter
Definition: optload.hxx:142
void InvalidatePreview()
Definition: optload.cxx:851
std::unique_ptr< SwFieldMgr > m_pMgr
Definition: optload.hxx:139
int m_nPrevSelectedEntry
Definition: optload.hxx:137
std::unique_ptr< weld::Entry > m_xTextEdit
Definition: optload.hxx:156
virtual void Reset(const SfxItemSet *rSet) override
Definition: optload.cxx:568
SwCaptionPreview m_aPreview
Definition: optload.hxx:144
std::unique_ptr< weld::CustomWeld > m_xPreview
Definition: optload.hxx:166
std::unique_ptr< weld::ComboBox > m_xLbLevel
Definition: optload.hxx:160
std::unique_ptr< weld::ComboBox > m_xPosBox
Definition: optload.hxx:157
OUString m_sNone
Definition: optload.hxx:135
OUString m_sTable
Definition: optload.hxx:126
std::unique_ptr< weld::Widget > m_xSettingsGroup
Definition: optload.hxx:148
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optload.cxx:538
std::unique_ptr< weld::TreeView > m_xCheckLB
Definition: optload.hxx:145
std::unique_ptr< weld::Label > m_xFormatText
Definition: optload.hxx:150
virtual ~SwCaptionOptPage() override
Definition: optload.cxx:531
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optload.cxx:544
SwCaptionOptPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optload.cxx:424
DECL_LINK(SelectHdl, weld::ComboBox &, void)
OUString m_sBelow
Definition: optload.hxx:133
void ModifyHdl()
Definition: optload.cxx:799
OUString m_sIllustration
Definition: optload.hxx:125
std::unique_ptr< weld::ComboBox > m_xFormatBox
Definition: optload.hxx:151
DECL_LINK(ToggleEntryHdl, const weld::TreeView::iter_col &, void)
std::unique_ptr< weld::CheckButton > m_xApplyBorderCB
Definition: optload.hxx:165
OUString m_sAbove
Definition: optload.hxx:132
OUString m_sBegin
Definition: optload.hxx:130
DECL_LINK(ModifyComboHdl, weld::ComboBox &, void)
OUString m_sText
Definition: optload.hxx:127
DECL_LINK(ShowEntryHdl, weld::TreeView &, void)
DECL_LINK(OrderHdl, weld::ComboBox &, void)
void SetOptions(const sal_uLong nPos, const SwCapObjType eType, const SvGlobalName *pOleId=nullptr)
Definition: optload.cxx:624
OUString m_sOLE
Definition: optload.hxx:123
DECL_LINK(ModifyEntryHdl, weld::Entry &, void)
std::unique_ptr< weld::Label > m_xTextText
Definition: optload.hxx:155
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: optload.cxx:403
vcl::Font maFont
Definition: optload.hxx:106
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: optload.cxx:410
void SetPreviewText(const OUString &rText)
Definition: optload.cxx:394
bool mbFontInitialized
Definition: optload.hxx:105
OUString maText
Definition: optload.hxx:104
void ApplySettings(vcl::RenderContext &rRenderContext)
Definition: optload.cxx:376
static sal_uInt32 Count()
Definition: optload.cxx:59
static FieldUnit GetValue(sal_uInt32 i)
Definition: optload.cxx:71
static OUString GetString(sal_uInt32 i)
Definition: optload.cxx:64
std::unique_ptr< weld::ComboBox > m_xMetricLB
Definition: optload.hxx:72
std::unique_ptr< weld::RadioButton > m_xNeverRB
Definition: optload.hxx:67
virtual void Reset(const SfxItemSet *rSet) override
Definition: optload.cxx:258
sal_uInt16 m_nLastTab
Definition: optload.hxx:62
std::unique_ptr< weld::CheckButton > m_xShowStandardizedPageCount
Definition: optload.hxx:78
sal_Int32 m_nOldLinkMode
Definition: optload.hxx:63
DECL_LINK(StandardizedPageCountCheckHdl, weld::Toggleable &, void)
SwWrtShell * m_pWrtShell
Definition: optload.hxx:61
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optload.cxx:139
std::unique_ptr< weld::CheckButton > m_xAutoUpdateFields
Definition: optload.hxx:69
std::unique_ptr< weld::SpinButton > m_xStandardizedPageSizeNF
Definition: optload.hxx:79
std::unique_ptr< weld::CheckButton > m_xAutoUpdateCharts
Definition: optload.hxx:70
std::unique_ptr< weld::Entry > m_xWordCountED
Definition: optload.hxx:77
std::unique_ptr< weld::Label > m_xTabFT
Definition: optload.hxx:73
std::unique_ptr< weld::CheckButton > m_xUseCharUnit
Definition: optload.hxx:76
std::unique_ptr< weld::MetricSpinButton > m_xTabMF
Definition: optload.hxx:74
std::unique_ptr< weld::CheckButton > m_xUseSquaredPageMode
Definition: optload.hxx:75
virtual ~SwLoadOptPage() override
Definition: optload.cxx:135
std::unique_ptr< weld::RadioButton > m_xRequestRB
Definition: optload.hxx:66
SwLoadOptPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optload.cxx:78
DECL_LINK(MetricHdl, weld::ComboBox &, void)
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optload.cxx:150
std::unique_ptr< weld::RadioButton > m_xAlwaysRB
Definition: optload.hxx:65
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
virtual OUString filter(const OUString &rText) override
Definition: cption.cxx:82
OUString m_sLastGoodText
Definition: optload.hxx:48
TextFilterAutoConvert(OUString aNone)
Definition: optload.hxx:51
std::pair< const TreeIter &, int > iter_col
FieldUnit
int i
static SfxItemSet & rSet
sal_uIntPtr sal_uLong