LibreOffice Module sw (master) 1
swuiidxmrk.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_SWUIIDXMRK_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_SWUIIDXMRK_HXX
21
22#include <com/sun/star/container/XNameAccess.hpp>
23#include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
24#include <sfx2/basedlgs.hxx>
25#include <sfx2/childwin.hxx>
26#include <vcl/weld.hxx>
27#include <toxe.hxx>
28#include <memory>
29
30class SwWrtShell;
31class SwTOXMgr;
32class SwTOXMark;
33
34// insert mark for index entry
37
39{
40 std::shared_ptr<weld::Dialog> m_xDialog;
41
42 friend class SwIndexMarkFloatDlg;
43 friend class SwIndexMarkModalDlg;
44
45 OUString m_aOrgStr;
46 bool m_bDel;
47 bool const m_bNewMark;
49
53 LanguageType m_nLangForPhoneticReading; //Language of current text used for phonetic reading proposal
54 bool m_bIsPhoneticReadingEnabled; //this value states whether phonetic reading is enabled in principle dependent of global cjk settings and language of current entry
55 css::uno::Reference< css::i18n::XExtendedIndexEntrySupplier >
57
58 std::unique_ptr<SwTOXMgr>
61
62 std::unique_ptr<weld::Label> m_xTypeFT;
63 std::unique_ptr<weld::ComboBox> m_xTypeDCB;
64 std::unique_ptr<weld::Button> m_xNewBT;
65 std::unique_ptr<weld::Entry> m_xEntryED;
66 std::unique_ptr<weld::Button> m_xSyncED;
67 std::unique_ptr<weld::Label> m_xPhoneticFT0;
68 std::unique_ptr<weld::Entry> m_xPhoneticED0;
69 std::unique_ptr<weld::Label> m_xKey1FT;
70 std::unique_ptr<weld::ComboBox> m_xKey1DCB;
71 std::unique_ptr<weld::Label> m_xPhoneticFT1;
72 std::unique_ptr<weld::Entry> m_xPhoneticED1;
73 std::unique_ptr<weld::Label> m_xKey2FT;
74 std::unique_ptr<weld::ComboBox> m_xKey2DCB;
75 std::unique_ptr<weld::Label> m_xPhoneticFT2;
76 std::unique_ptr<weld::Entry> m_xPhoneticED2;
77 std::unique_ptr<weld::Label> m_xLevelFT;
78 std::unique_ptr<weld::SpinButton> m_xLevelNF;
79 std::unique_ptr<weld::CheckButton> m_xMainEntryCB;
80 std::unique_ptr<weld::CheckButton> m_xApplyToAllCB;
81 std::unique_ptr<weld::CheckButton> m_xSearchCaseSensitiveCB;
82 std::unique_ptr<weld::CheckButton> m_xSearchCaseWordOnlyCB;
83 std::unique_ptr<weld::Button> m_xOKBT;
84 std::unique_ptr<weld::Button> m_xCloseBT;
85 std::unique_ptr<weld::Button> m_xDelBT;
86 std::unique_ptr<weld::Button> m_xPrevSameBT;
87 std::unique_ptr<weld::Button> m_xNextSameBT;
88 std::unique_ptr<weld::Button> m_xPrevBT;
89 std::unique_ptr<weld::Button> m_xNextBT;
90 std::unique_ptr<weld::Label> m_xForSelectedEntry;
91
92 void Apply();
93 void InitControls();
94 void InsertMark();
95 void UpdateMark();
96
97 DECL_LINK(InsertHdl, weld::Button&, void);
98 DECL_LINK(CloseHdl, weld::Button&, void);
99 DECL_LINK(SyncSelectionHdl, weld::Button&, void);
100 DECL_LINK(DelHdl, weld::Button&, void);
101 DECL_LINK( NextHdl, weld::Button&, void );
102 DECL_LINK( NextSameHdl, weld::Button&, void );
103 DECL_LINK( PrevHdl, weld::Button&, void );
104 DECL_LINK( PrevSameHdl, weld::Button&, void );
105 DECL_LINK( ModifyListBoxHdl, weld::ComboBox&, void );
106 DECL_LINK( ModifyEditHdl, weld::Entry&, void );
107 void ModifyHdl(const weld::Widget& rWidget);
108 DECL_LINK( KeyDCBModifyHdl, weld::ComboBox&, void );
109 DECL_LINK( NewUserIdxHdl, weld::Button&, void );
110 DECL_LINK( SearchTypeHdl, weld::Toggleable&, void );
111 DECL_LINK( PhoneticEDModifyHdl, weld::Entry&, void );
112
113 //this method updates the values from 'nLangForPhoneticReading' and 'bIsPhoneticReadingEnabled'
114 //it needs to be called ones if this dialog is opened to create a new entry (in InitControls),
115 //or otherwise it has to be called for each changed TOXMark (in UpdateDialog)
117 OUString GetDefaultPhoneticReading( const OUString& rText );
118
119 void UpdateKeyBoxes();
120
121 void UpdateDialog();
122 void InsertUpdate();
123
124 void Activate();
125
126public:
127
128 SwIndexMarkPane(std::shared_ptr<weld::Dialog> xDialog, weld::Builder& rBuilder,
129 bool bNewDlg, SwWrtShell* pWrtShell);
130
132
133 void ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark const * pCurTOXMark = nullptr);
134 bool IsTOXType(const OUString& rName) { return m_xTypeDCB->find_text(rName) != -1; }
135};
136
138{
140
141 virtual void Activate() override;
142public:
144 SfxChildWindow* pChild,
145 weld::Window *pParent,
146 SfxChildWinInfo const * pInfo,
147 bool bNew);
148 void ReInitDlg(SwWrtShell& rWrtShell);
149};
150
152{
154public:
155 SwIndexMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh, SwTOXMark const * pCurTOXMark);
156 virtual ~SwIndexMarkModalDlg() override;
157 virtual short int run() override;
158};
159
161
163{
165
167
168 friend class SwAuthMarkModalDlg;
169 friend class SwAuthMarkFloatDlg;
170
173
175
178
180
181 css::uno::Reference< css::container::XNameAccess > m_xBibAccess;
182
183 std::unique_ptr<weld::RadioButton> m_xFromComponentRB;
184 std::unique_ptr<weld::RadioButton> m_xFromDocContentRB;
185 std::unique_ptr<weld::Label> m_xAuthorFI;
186 std::unique_ptr<weld::Label> m_xTitleFI;
187 std::unique_ptr<weld::Entry> m_xEntryED;
188 std::unique_ptr<weld::ComboBox> m_xEntryLB;
189 std::unique_ptr<weld::Button> m_xActionBT;
190 std::unique_ptr<weld::Button> m_xCloseBT;
191 std::unique_ptr<weld::Button> m_xCreateEntryPB;
192 std::unique_ptr<weld::Button> m_xEditEntryPB;
193
194 DECL_LINK(InsertHdl, weld::Button&, void);
195 DECL_LINK(CloseHdl, weld::Button&, void);
196 DECL_LINK(CreateEntryHdl, weld::Button&, void);
197 DECL_LINK(CompEntryHdl, weld::ComboBox&, void);
198 DECL_LINK(ChangeSourceHdl, weld::Toggleable&, void);
199 DECL_LINK(IsEditAllowedHdl, weld::Entry&, bool);
200 DECL_LINK(IsEntryAllowedHdl, weld::Entry&, bool);
201 DECL_LINK(EditModifyHdl, weld::Entry&, void);
202
203 void InitControls();
204 void Activate();
205
206public:
207 SwAuthorMarkPane(weld::DialogController& rDialog, weld::Builder& rBuilder, bool bNew);
208 void ReInitDlg(SwWrtShell& rWrtShell);
209};
210
212{
214 virtual void Activate() override;
215public:
217 SfxChildWindow* pChild,
218 weld::Window *pParent,
219 SfxChildWinInfo const * pInfo,
220 bool bNew);
221 void ReInitDlg(SwWrtShell& rWrtShell);
222};
223
225{
227
228 void Apply();
229public:
231 virtual short int run() override;
232};
233
234#endif // INCLUDED_SW_SOURCE_UIBASE_INC_SWUIIDXMRK_HXX
235
236/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwAuthorMarkPane m_aContent
Definition: swuiidxmrk.hxx:213
virtual void Activate() override
SwAuthMarkFloatDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent, SfxChildWinInfo const *pInfo, bool bNew)
void ReInitDlg(SwWrtShell &rWrtShell)
virtual short int run() override
SwAuthorMarkPane m_aContent
Definition: swuiidxmrk.hxx:226
SwAuthMarkModalDlg(weld::Window *pParent, SwWrtShell &rSh)
DECL_LINK(IsEditAllowedHdl, weld::Entry &, bool)
std::unique_ptr< weld::RadioButton > m_xFromDocContentRB
Definition: swuiidxmrk.hxx:184
bool m_bBibAccessInitialized
Definition: swuiidxmrk.hxx:172
std::unique_ptr< weld::Button > m_xCreateEntryPB
Definition: swuiidxmrk.hxx:191
css::uno::Reference< css::container::XNameAccess > m_xBibAccess
Definition: swuiidxmrk.hxx:181
std::unique_ptr< weld::Label > m_xAuthorFI
Definition: swuiidxmrk.hxx:185
DECL_LINK(EditModifyHdl, weld::Entry &, void)
std::unique_ptr< weld::Button > m_xActionBT
Definition: swuiidxmrk.hxx:189
static bool s_bIsFromComponent
Definition: swuiidxmrk.hxx:166
DECL_LINK(CompEntryHdl, weld::ComboBox &, void)
DECL_LINK(CreateEntryHdl, weld::Button &, void)
DECL_LINK(InsertHdl, weld::Button &, void)
DECL_LINK(ChangeSourceHdl, weld::Toggleable &, void)
std::unique_ptr< weld::ComboBox > m_xEntryLB
Definition: swuiidxmrk.hxx:188
weld::DialogController & m_rDialog
Definition: swuiidxmrk.hxx:164
OUString m_sFields[AUTH_FIELD_END]
Definition: swuiidxmrk.hxx:177
std::unique_ptr< weld::RadioButton > m_xFromComponentRB
Definition: swuiidxmrk.hxx:183
SwWrtShell * m_pSh
Definition: swuiidxmrk.hxx:174
SwAuthorMarkPane(weld::DialogController &rDialog, weld::Builder &rBuilder, bool bNew)
std::unique_ptr< weld::Button > m_xEditEntryPB
Definition: swuiidxmrk.hxx:192
OUString m_sCreatedEntry[AUTH_FIELD_END]
Definition: swuiidxmrk.hxx:179
std::unique_ptr< weld::Label > m_xTitleFI
Definition: swuiidxmrk.hxx:186
std::unique_ptr< weld::Entry > m_xEntryED
Definition: swuiidxmrk.hxx:187
void ReInitDlg(SwWrtShell &rWrtShell)
std::unique_ptr< weld::Button > m_xCloseBT
Definition: swuiidxmrk.hxx:190
OUString m_sColumnTitles[AUTH_FIELD_END]
Definition: swuiidxmrk.hxx:176
DECL_LINK(CloseHdl, weld::Button &, void)
DECL_LINK(IsEntryAllowedHdl, weld::Entry &, bool)
void ReInitDlg(SwWrtShell &rWrtShell)
virtual void Activate() override
SwIndexMarkFloatDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent, SfxChildWinInfo const *pInfo, bool bNew)
SwIndexMarkPane m_aContent
Definition: swuiidxmrk.hxx:139
SwIndexMarkPane m_aContent
Definition: swuiidxmrk.hxx:153
virtual short int run() override
SwIndexMarkModalDlg(weld::Window *pParent, SwWrtShell &rSh, SwTOXMark const *pCurTOXMark)
virtual ~SwIndexMarkModalDlg() override
std::unique_ptr< weld::CheckButton > m_xSearchCaseSensitiveCB
Definition: swuiidxmrk.hxx:81
std::unique_ptr< weld::CheckButton > m_xApplyToAllCB
Definition: swuiidxmrk.hxx:80
bool m_bPhoneticED2_ChangedByUser
Definition: swuiidxmrk.hxx:52
std::unique_ptr< weld::Entry > m_xPhoneticED0
Definition: swuiidxmrk.hxx:68
DECL_LINK(ModifyListBoxHdl, weld::ComboBox &, void)
DECL_LINK(NewUserIdxHdl, weld::Button &, void)
SwWrtShell * m_pSh
Definition: swuiidxmrk.hxx:60
void UpdateLanguageDependenciesForPhoneticReading()
Definition: swuiidxmrk.cxx:367
std::shared_ptr< weld::Dialog > m_xDialog
Definition: swuiidxmrk.hxx:40
DECL_LINK(PrevHdl, weld::Button &, void)
std::unique_ptr< weld::Label > m_xPhoneticFT0
Definition: swuiidxmrk.hxx:67
std::unique_ptr< weld::Label > m_xPhoneticFT2
Definition: swuiidxmrk.hxx:75
std::unique_ptr< weld::ComboBox > m_xKey2DCB
Definition: swuiidxmrk.hxx:74
std::unique_ptr< weld::Button > m_xNewBT
Definition: swuiidxmrk.hxx:64
LanguageType m_nLangForPhoneticReading
Definition: swuiidxmrk.hxx:53
void ReInitDlg(SwWrtShell &rWrtShell, SwTOXMark const *pCurTOXMark=nullptr)
void ModifyHdl(const weld::Widget &rWidget)
Definition: swuiidxmrk.cxx:713
std::unique_ptr< weld::Label > m_xTypeFT
Definition: swuiidxmrk.hxx:62
std::unique_ptr< weld::Button > m_xNextBT
Definition: swuiidxmrk.hxx:89
std::unique_ptr< weld::SpinButton > m_xLevelNF
Definition: swuiidxmrk.hxx:78
std::unique_ptr< weld::Button > m_xNextSameBT
Definition: swuiidxmrk.hxx:87
DECL_LINK(InsertHdl, weld::Button &, void)
DECL_LINK(SyncSelectionHdl, weld::Button &, void)
std::unique_ptr< weld::CheckButton > m_xSearchCaseWordOnlyCB
Definition: swuiidxmrk.hxx:82
bool m_bIsPhoneticReadingEnabled
Definition: swuiidxmrk.hxx:54
void UpdateKeyBoxes()
Definition: swuiidxmrk.cxx:610
std::unique_ptr< weld::Button > m_xSyncED
Definition: swuiidxmrk.hxx:66
std::unique_ptr< weld::Label > m_xKey2FT
Definition: swuiidxmrk.hxx:73
std::unique_ptr< weld::ComboBox > m_xKey1DCB
Definition: swuiidxmrk.hxx:70
std::unique_ptr< weld::Label > m_xLevelFT
Definition: swuiidxmrk.hxx:77
bool m_bPhoneticED0_ChangedByUser
Definition: swuiidxmrk.hxx:50
std::unique_ptr< weld::Entry > m_xPhoneticED2
Definition: swuiidxmrk.hxx:76
std::unique_ptr< weld::Entry > m_xEntryED
Definition: swuiidxmrk.hxx:65
DECL_LINK(NextHdl, weld::Button &, void)
DECL_LINK(PhoneticEDModifyHdl, weld::Entry &, void)
std::unique_ptr< weld::Button > m_xOKBT
Definition: swuiidxmrk.hxx:83
DECL_LINK(NextSameHdl, weld::Button &, void)
std::unique_ptr< weld::Label > m_xPhoneticFT1
Definition: swuiidxmrk.hxx:71
OUString GetDefaultPhoneticReading(const OUString &rText)
Definition: swuiidxmrk.cxx:414
std::unique_ptr< weld::Entry > m_xPhoneticED1
Definition: swuiidxmrk.hxx:72
std::unique_ptr< weld::Button > m_xPrevBT
Definition: swuiidxmrk.hxx:88
css::uno::Reference< css::i18n::XExtendedIndexEntrySupplier > m_xExtendedIndexEntrySupplier
Definition: swuiidxmrk.hxx:56
DECL_LINK(CloseHdl, weld::Button &, void)
bool const m_bNewMark
Definition: swuiidxmrk.hxx:47
std::unique_ptr< weld::ComboBox > m_xTypeDCB
Definition: swuiidxmrk.hxx:63
SwIndexMarkPane(std::shared_ptr< weld::Dialog > xDialog, weld::Builder &rBuilder, bool bNewDlg, SwWrtShell *pWrtShell)
Definition: swuiidxmrk.cxx:131
std::unique_ptr< weld::Button > m_xCloseBT
Definition: swuiidxmrk.hxx:84
OUString m_aOrgStr
Definition: swuiidxmrk.hxx:45
DECL_LINK(KeyDCBModifyHdl, weld::ComboBox &, void)
bool IsTOXType(const OUString &rName)
Definition: swuiidxmrk.hxx:134
std::unique_ptr< weld::Button > m_xPrevSameBT
Definition: swuiidxmrk.hxx:86
std::unique_ptr< weld::Label > m_xKey1FT
Definition: swuiidxmrk.hxx:69
bool m_bPhoneticED1_ChangedByUser
Definition: swuiidxmrk.hxx:51
std::unique_ptr< SwTOXMgr > m_pTOXMgr
Definition: swuiidxmrk.hxx:59
DECL_LINK(ModifyEditHdl, weld::Entry &, void)
std::unique_ptr< weld::CheckButton > m_xMainEntryCB
Definition: swuiidxmrk.hxx:79
std::unique_ptr< weld::Label > m_xForSelectedEntry
Definition: swuiidxmrk.hxx:90
DECL_LINK(PrevSameHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xDelBT
Definition: swuiidxmrk.hxx:85
DECL_LINK(DelHdl, weld::Button &, void)
DECL_LINK(SearchTypeHdl, weld::Toggleable &, void)
Built on top of SwWrtShell, provides functionality to insert, update or perform other actions on vari...
Definition: toxmgr.hxx:231
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
@ AUTH_FIELD_END
Definition: toxe.hxx:121