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