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