LibreOffice Module sw (master) 1
regionsw.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#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_REGIONSW_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_REGIONSW_HXX
21
22#include <sfx2/basedlgs.hxx>
23#include <sfx2/tabdlg.hxx>
24
25#include "condedit.hxx"
26#include <section.hxx>
27#include <fmtftntx.hxx>
29#include <svx/paraprev.hxx>
30
31#include <memory>
32#include <map>
33
34class SwWrtShell;
35
36namespace sfx2
37{
38 class DocumentInserter;
39 class FileDialogHelper;
40}
41
42// dialog "edit regions"
43class SectRepr;
44typedef std::map<size_t, std::unique_ptr<SectRepr>> SectReprs_t;
45
47{
49
53 std::unique_ptr<sfx2::DocumentInserter> m_pDocInserter;
54
56
57 std::unique_ptr<weld::Entry> m_xCurName;
58 std::unique_ptr<weld::TreeView> m_xTree;
59 std::unique_ptr<weld::CheckButton> m_xFileCB;
60 std::unique_ptr<weld::CheckButton> m_xDDECB;
61 std::unique_ptr<weld::Widget> m_xDDEFrame;
62 std::unique_ptr<weld::Label> m_xFileNameFT;
63 std::unique_ptr<weld::Label> m_xDDECommandFT;
64 std::unique_ptr<weld::Entry> m_xFileNameED;
65 std::unique_ptr<weld::Button> m_xFilePB;
66 std::unique_ptr<weld::Label> m_xSubRegionFT;
67 std::unique_ptr<weld::ComboBox> m_xSubRegionED;
68 std::unique_ptr<weld::CheckButton> m_xProtectCB;
69 std::unique_ptr<weld::CheckButton> m_xPasswdCB;
70 std::unique_ptr<weld::Button> m_xPasswdPB;
71 std::unique_ptr<weld::CheckButton> m_xHideCB;
72 std::unique_ptr<weld::Label> m_xConditionFT;
73 std::unique_ptr<ConditionEdit> m_xConditionED;
74 // #114856# edit in readonly sections
75 std::unique_ptr<weld::CheckButton> m_xEditInReadonlyCB;
76 std::unique_ptr<weld::Button> m_xOK;
77 std::unique_ptr<weld::Button> m_xOptionsPB;
78 std::unique_ptr<weld::Button> m_xDismiss;
79 std::unique_ptr<weld::Widget> m_xHideFrame;
80
81 void RecurseList(const SwSectionFormat* pFormat, const weld::TreeIter* pIter);
82 size_t FindArrPos(const SwSectionFormat* pFormat);
83
84 DECL_LINK( GetFirstEntryHdl, weld::TreeView&, void );
85
86 DECL_LINK( OkHdl, weld::Button&, void );
87 DECL_LINK( NameEditHdl, weld::Entry&, void );
88 DECL_LINK( ConditionEditHdl, weld::Entry&, void );
89
90 void ChangePasswd(bool bChange);
91 DECL_LINK( TogglePasswdHdl, weld::Toggleable&, void );
92 DECL_LINK( ChangePasswdHdl, weld::Button&, void );
93 DECL_LINK( ChangeProtectHdl, weld::Toggleable&, void );
94 DECL_LINK( ChangeHideHdl, weld::Toggleable&, void );
95 // #114856# edit in readonly sections
96 DECL_LINK( ChangeEditInReadonlyHdl, weld::Toggleable&, void );
97 DECL_LINK( ChangeDismissHdl, weld::Button&, void);
98 DECL_LINK( UseFileHdl, weld::Toggleable&, void );
99 DECL_LINK( FileSearchHdl, weld::Button&, void );
100 DECL_LINK( OptionsHdl, weld::Button&, void );
101 DECL_LINK( FileNameComboBoxHdl, weld::ComboBox&, void );
102 DECL_LINK( FileNameEntryHdl, weld::Entry&, void );
103 DECL_LINK( DDEHdl, weld::Toggleable&, void );
104 DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper*, void );
105 DECL_LINK( SubRegionEventHdl, weld::ComboBox&, void );
106
107 bool CheckPasswd(weld::Toggleable* pBox = nullptr);
108
109public:
110 SwEditRegionDlg(weld::Window* pParent, SwWrtShell& rWrtSh);
111 virtual ~SwEditRegionDlg() override;
112
113 void SelectSection(std::u16string_view rSectionName);
114
115};
116
117// dialog "insert region"
119{
120 OUString m_sFileName;
123
124 css::uno::Sequence <sal_Int8 > m_aNewPasswd;
126 std::unique_ptr<sfx2::DocumentInserter> m_pDocInserter;
127
128 std::unique_ptr<weld::EntryTreeView> m_xCurName;
129 std::unique_ptr<weld::CheckButton> m_xFileCB;
130 std::unique_ptr<weld::CheckButton> m_xDDECB;
131 std::unique_ptr<weld::Label> m_xDDECommandFT;
132 std::unique_ptr<weld::Label> m_xFileNameFT;
133 std::unique_ptr<weld::Entry> m_xFileNameED;
134 std::unique_ptr<weld::Button> m_xFilePB;
135 std::unique_ptr<weld::Label> m_xSubRegionFT;
136 std::unique_ptr<weld::ComboBox> m_xSubRegionED;
137 std::unique_ptr<weld::CheckButton> m_xProtectCB;
138 std::unique_ptr<weld::CheckButton> m_xPasswdCB;
139 std::unique_ptr<weld::Button> m_xPasswdPB;
140 std::unique_ptr<weld::CheckButton> m_xHideCB;
141 std::unique_ptr<weld::Label> m_xConditionFT;
142 std::unique_ptr<ConditionEdit> m_xConditionED;
143 // #114856# edit in readonly sections
144 std::unique_ptr<weld::CheckButton> m_xEditInReadonlyCB;
145
146 void ChangePasswd(bool bChange);
147
148 DECL_LINK( ChangeHideHdl, weld::Toggleable&, void );
149 DECL_LINK( ChangeProtectHdl, weld::Toggleable&, void );
150 DECL_LINK( ChangePasswdHdl, weld::Button&, void );
151 DECL_LINK( TogglePasswdHdl, weld::Toggleable&, void );
152 DECL_LINK( NameEditHdl, weld::ComboBox&, void );
153 DECL_LINK( UseFileHdl, weld::Toggleable&, void );
154 DECL_LINK( FileSearchHdl, weld::Button&, void );
155 DECL_LINK( DDEHdl, weld::Toggleable&, void );
156 DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper*, void );
157
158public:
159 SwInsertSectionTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rAttrSet);
160 virtual ~SwInsertSectionTabPage() override;
161
162 void SetWrtShell(SwWrtShell& rSh);
163
164 virtual bool FillItemSet( SfxItemSet* ) override;
165 virtual void Reset( const SfxItemSet* ) override;
166
167 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
168 const SfxItemSet* rAttrSet);
169};
170
172{
173 std::unique_ptr<weld::CheckButton> m_xFootnoteNtAtTextEndCB;
174 std::unique_ptr<weld::CheckButton> m_xFootnoteNtNumCB;
175 std::unique_ptr<weld::Label> m_xFootnoteOffsetLbl;
176 std::unique_ptr<weld::SpinButton> m_xFootnoteOffsetField;
177 std::unique_ptr<weld::CheckButton> m_xFootnoteNtNumFormatCB;
178 std::unique_ptr<weld::Label> m_xFootnotePrefixFT;
179 std::unique_ptr<weld::Entry> m_xFootnotePrefixED;
180 std::unique_ptr<SwNumberingTypeListBox> m_xFootnoteNumViewBox;
181 std::unique_ptr<weld::Label> m_xFootnoteSuffixFT;
182 std::unique_ptr<weld::Entry> m_xFootnoteSuffixED;
183 std::unique_ptr<weld::CheckButton> m_xEndNtAtTextEndCB;
184 std::unique_ptr<weld::CheckButton> m_xEndNtNumCB;
185 std::unique_ptr<weld::Label> m_xEndOffsetLbl;
186 std::unique_ptr<weld::SpinButton> m_xEndOffsetField;
187 std::unique_ptr<weld::CheckButton> m_xEndNtNumFormatCB;
188 std::unique_ptr<weld::Label> m_xEndPrefixFT;
189 std::unique_ptr<weld::Entry> m_xEndPrefixED;
190 std::unique_ptr<SwNumberingTypeListBox> m_xEndNumViewBox;
191 std::unique_ptr<weld::Label> m_xEndSuffixFT;
192 std::unique_ptr<weld::Entry> m_xEndSuffixED;
193
194 DECL_LINK(FootEndHdl, weld::Toggleable&, void);
196
197public:
199 virtual ~SwSectionFootnoteEndTabPage() override;
200
201 virtual bool FillItemSet( SfxItemSet* ) override;
202 virtual void Reset( const SfxItemSet* ) override;
203
204 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
205 const SfxItemSet* rAttrSet);
206};
207
209{
211 std::unique_ptr<weld::MetricSpinButton> m_xBeforeMF;
212 std::unique_ptr<weld::MetricSpinButton> m_xAfterMF;
213 std::unique_ptr<weld::CustomWeld> m_xPreviewWin;
214
215 DECL_LINK(IndentModifyHdl, weld::MetricSpinButton&, void);
216public:
217 SwSectionIndentTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rAttrSet);
218 virtual ~SwSectionIndentTabPage() override;
219
220 virtual bool FillItemSet( SfxItemSet* ) override;
221 virtual void Reset( const SfxItemSet* ) override;
222
223 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
224
225 void SetWrtShell(SwWrtShell const & rSh);
226};
227
229{
231 std::unique_ptr<SwSectionData> m_pSectionData;
232
233 virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override;
234 virtual short Ok() override;
235public:
236 SwInsertSectionTabDialog(weld::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh);
237 virtual ~SwInsertSectionTabDialog() override;
238
239 void SetSectionData(SwSectionData const& rSect);
241};
242
244{
246
247 virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override;
248public:
250 virtual ~SwSectionPropertyTabDialog() override;
251};
252
253#endif
254
255/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::ComboBox > m_xSubRegionED
Definition: regionsw.hxx:67
std::unique_ptr< weld::Label > m_xSubRegionFT
Definition: regionsw.hxx:66
std::unique_ptr< weld::Widget > m_xDDEFrame
Definition: regionsw.hxx:61
bool m_bDontCheckPasswd
Definition: regionsw.hxx:55
virtual ~SwEditRegionDlg() override
Definition: uiregionsw.cxx:556
std::unique_ptr< weld::CheckButton > m_xFileCB
Definition: regionsw.hxx:59
DECL_LINK(DlgClosedHdl, sfx2::FileDialogHelper *, void)
SwEditRegionDlg(weld::Window *pParent, SwWrtShell &rWrtSh)
Definition: uiregionsw.cxx:332
DECL_LINK(ChangeDismissHdl, weld::Button &, void)
std::unique_ptr< weld::Label > m_xFileNameFT
Definition: regionsw.hxx:62
std::unique_ptr< weld::Button > m_xPasswdPB
Definition: regionsw.hxx:70
std::unique_ptr< weld::Entry > m_xFileNameED
Definition: regionsw.hxx:64
DECL_LINK(OkHdl, weld::Button &, void)
void RecurseList(const SwSectionFormat *pFormat, const weld::TreeIter *pIter)
Definition: uiregionsw.cxx:475
DECL_LINK(FileSearchHdl, weld::Button &, void)
bool m_bSubRegionsFilled
Definition: regionsw.hxx:48
SwWrtShell & m_rSh
Definition: regionsw.hxx:50
DECL_LINK(ChangeProtectHdl, weld::Toggleable &, void)
DECL_LINK(ChangeEditInReadonlyHdl, weld::Toggleable &, void)
size_t FindArrPos(const SwSectionFormat *pFormat)
Definition: uiregionsw.cxx:545
const SwSection * m_pCurrSect
Definition: regionsw.hxx:52
std::unique_ptr< weld::CheckButton > m_xDDECB
Definition: regionsw.hxx:60
DECL_LINK(OptionsHdl, weld::Button &, void)
std::unique_ptr< sfx2::DocumentInserter > m_pDocInserter
Definition: regionsw.hxx:53
std::unique_ptr< weld::Button > m_xDismiss
Definition: regionsw.hxx:78
std::unique_ptr< weld::Entry > m_xCurName
Definition: regionsw.hxx:57
std::unique_ptr< ConditionEdit > m_xConditionED
Definition: regionsw.hxx:73
std::unique_ptr< weld::Label > m_xDDECommandFT
Definition: regionsw.hxx:63
DECL_LINK(GetFirstEntryHdl, weld::TreeView &, void)
std::unique_ptr< weld::CheckButton > m_xProtectCB
Definition: regionsw.hxx:68
std::unique_ptr< weld::Button > m_xOK
Definition: regionsw.hxx:76
SectReprs_t m_SectReprs
Definition: regionsw.hxx:51
DECL_LINK(UseFileHdl, weld::Toggleable &, void)
std::unique_ptr< weld::CheckButton > m_xPasswdCB
Definition: regionsw.hxx:69
DECL_LINK(NameEditHdl, weld::Entry &, void)
DECL_LINK(DDEHdl, weld::Toggleable &, void)
std::unique_ptr< weld::Button > m_xFilePB
Definition: regionsw.hxx:65
bool CheckPasswd(weld::Toggleable *pBox=nullptr)
Definition: uiregionsw.cxx:429
DECL_LINK(ChangeHideHdl, weld::Toggleable &, void)
DECL_LINK(ConditionEditHdl, weld::Entry &, void)
std::unique_ptr< weld::Button > m_xOptionsPB
Definition: regionsw.hxx:77
DECL_LINK(TogglePasswdHdl, weld::Toggleable &, void)
void ChangePasswd(bool bChange)
std::unique_ptr< weld::TreeView > m_xTree
Definition: regionsw.hxx:58
DECL_LINK(SubRegionEventHdl, weld::ComboBox &, void)
DECL_LINK(FileNameComboBoxHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Label > m_xConditionFT
Definition: regionsw.hxx:72
std::unique_ptr< weld::Widget > m_xHideFrame
Definition: regionsw.hxx:79
DECL_LINK(FileNameEntryHdl, weld::Entry &, void)
void SelectSection(std::u16string_view rSectionName)
Definition: uiregionsw.cxx:568
std::unique_ptr< weld::CheckButton > m_xHideCB
Definition: regionsw.hxx:71
std::unique_ptr< weld::CheckButton > m_xEditInReadonlyCB
Definition: regionsw.hxx:75
DECL_LINK(ChangePasswdHdl, weld::Button &, void)
SfxPoolItem subclass that is a wrapper around an SwFootnoteEndPosEnum, i.e.
Definition: fmtftntx.hxx:43
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
virtual short Ok() override
void SetSectionData(SwSectionData const &rSect)
SwInsertSectionTabDialog(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell &rSh)
virtual ~SwInsertSectionTabDialog() override
SwSectionData * GetSectionData()
Definition: regionsw.hxx:240
std::unique_ptr< SwSectionData > m_pSectionData
Definition: regionsw.hxx:231
DECL_LINK(UseFileHdl, weld::Toggleable &, void)
std::unique_ptr< weld::Label > m_xSubRegionFT
Definition: regionsw.hxx:135
SwWrtShell * m_pWrtSh
Definition: regionsw.hxx:125
DECL_LINK(FileSearchHdl, weld::Button &, void)
DECL_LINK(TogglePasswdHdl, weld::Toggleable &, void)
std::unique_ptr< weld::Button > m_xPasswdPB
Definition: regionsw.hxx:139
DECL_LINK(ChangeProtectHdl, weld::Toggleable &, void)
std::unique_ptr< weld::Label > m_xFileNameFT
Definition: regionsw.hxx:132
std::unique_ptr< weld::CheckButton > m_xPasswdCB
Definition: regionsw.hxx:138
std::unique_ptr< weld::CheckButton > m_xDDECB
Definition: regionsw.hxx:130
void SetWrtShell(SwWrtShell &rSh)
std::unique_ptr< weld::Entry > m_xFileNameED
Definition: regionsw.hxx:133
std::unique_ptr< weld::CheckButton > m_xFileCB
Definition: regionsw.hxx:129
std::unique_ptr< sfx2::DocumentInserter > m_pDocInserter
Definition: regionsw.hxx:126
DECL_LINK(DlgClosedHdl, sfx2::FileDialogHelper *, void)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
DECL_LINK(ChangePasswdHdl, weld::Button &, void)
virtual ~SwInsertSectionTabPage() override
void ChangePasswd(bool bChange)
std::unique_ptr< weld::CheckButton > m_xProtectCB
Definition: regionsw.hxx:137
std::unique_ptr< weld::CheckButton > m_xEditInReadonlyCB
Definition: regionsw.hxx:144
std::unique_ptr< weld::Label > m_xDDECommandFT
Definition: regionsw.hxx:131
css::uno::Sequence< sal_Int8 > m_aNewPasswd
Definition: regionsw.hxx:124
DECL_LINK(NameEditHdl, weld::ComboBox &, void)
DECL_LINK(DDEHdl, weld::Toggleable &, void)
std::unique_ptr< weld::EntryTreeView > m_xCurName
Definition: regionsw.hxx:128
std::unique_ptr< ConditionEdit > m_xConditionED
Definition: regionsw.hxx:142
SwInsertSectionTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::Label > m_xConditionFT
Definition: regionsw.hxx:141
DECL_LINK(ChangeHideHdl, weld::Toggleable &, void)
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::CheckButton > m_xHideCB
Definition: regionsw.hxx:140
std::unique_ptr< weld::ComboBox > m_xSubRegionED
Definition: regionsw.hxx:136
std::unique_ptr< weld::Button > m_xFilePB
Definition: regionsw.hxx:134
std::unique_ptr< weld::Label > m_xFootnotePrefixFT
Definition: regionsw.hxx:178
std::unique_ptr< weld::Label > m_xEndSuffixFT
Definition: regionsw.hxx:191
SwSectionFootnoteEndTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
std::unique_ptr< weld::CheckButton > m_xEndNtNumFormatCB
Definition: regionsw.hxx:187
std::unique_ptr< weld::Entry > m_xFootnotePrefixED
Definition: regionsw.hxx:179
std::unique_ptr< weld::CheckButton > m_xFootnoteNtNumCB
Definition: regionsw.hxx:174
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
virtual void Reset(const SfxItemSet *) override
virtual ~SwSectionFootnoteEndTabPage() override
std::unique_ptr< weld::Label > m_xFootnoteOffsetLbl
Definition: regionsw.hxx:175
std::unique_ptr< weld::CheckButton > m_xFootnoteNtNumFormatCB
Definition: regionsw.hxx:177
std::unique_ptr< weld::CheckButton > m_xEndNtAtTextEndCB
Definition: regionsw.hxx:183
std::unique_ptr< weld::SpinButton > m_xFootnoteOffsetField
Definition: regionsw.hxx:176
std::unique_ptr< weld::Entry > m_xFootnoteSuffixED
Definition: regionsw.hxx:182
std::unique_ptr< weld::CheckButton > m_xFootnoteNtAtTextEndCB
Definition: regionsw.hxx:173
DECL_LINK(FootEndHdl, weld::Toggleable &, void)
void ResetState(bool bFootnote, const SwFormatFootnoteEndAtTextEnd &)
std::unique_ptr< SwNumberingTypeListBox > m_xFootnoteNumViewBox
Definition: regionsw.hxx:180
std::unique_ptr< weld::SpinButton > m_xEndOffsetField
Definition: regionsw.hxx:186
std::unique_ptr< weld::Entry > m_xEndPrefixED
Definition: regionsw.hxx:189
std::unique_ptr< weld::Label > m_xFootnoteSuffixFT
Definition: regionsw.hxx:181
std::unique_ptr< weld::CheckButton > m_xEndNtNumCB
Definition: regionsw.hxx:184
std::unique_ptr< SwNumberingTypeListBox > m_xEndNumViewBox
Definition: regionsw.hxx:190
std::unique_ptr< weld::Entry > m_xEndSuffixED
Definition: regionsw.hxx:192
std::unique_ptr< weld::Label > m_xEndOffsetLbl
Definition: regionsw.hxx:185
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::Label > m_xEndPrefixFT
Definition: regionsw.hxx:188
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::MetricSpinButton > m_xAfterMF
Definition: regionsw.hxx:212
std::unique_ptr< weld::MetricSpinButton > m_xBeforeMF
Definition: regionsw.hxx:211
virtual ~SwSectionIndentTabPage() override
virtual void Reset(const SfxItemSet *) override
void SetWrtShell(SwWrtShell const &rSh)
SvxParaPrevWindow m_aPreviewWin
Definition: regionsw.hxx:210
SwSectionIndentTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
std::unique_ptr< weld::CustomWeld > m_xPreviewWin
Definition: regionsw.hxx:213
DECL_LINK(IndentModifyHdl, weld::MetricSpinButton &, void)
virtual ~SwSectionPropertyTabDialog() override
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
SwSectionPropertyTabDialog(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell &rSh)
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
static bool bFootnote
Definition: insfnote.cxx:33
std::map< size_t, std::unique_ptr< SectRepr > > SectReprs_t
Definition: regionsw.hxx:43