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
91 void Apply();
92 void InitControls();
93 void InsertMark();
94 void UpdateMark();
95
96 DECL_LINK(InsertHdl, weld::Button&, void);
97 DECL_LINK(CloseHdl, weld::Button&, void);
98 DECL_LINK(SyncSelectionHdl, weld::Button&, void);
99 DECL_LINK(DelHdl, weld::Button&, void);
100 DECL_LINK( NextHdl, weld::Button&, void );
101 DECL_LINK( NextSameHdl, weld::Button&, void );
102 DECL_LINK( PrevHdl, weld::Button&, void );
103 DECL_LINK( PrevSameHdl, weld::Button&, void );
104 DECL_LINK( ModifyListBoxHdl, weld::ComboBox&, void );
105 DECL_LINK( ModifyEditHdl, weld::Entry&, void );
106 void ModifyHdl(const weld::Widget& rWidget);
107 DECL_LINK( KeyDCBModifyHdl, weld::ComboBox&, void );
108 DECL_LINK( NewUserIdxHdl, weld::Button&, void );
109 DECL_LINK( SearchTypeHdl, weld::Toggleable&, void );
110 DECL_LINK( PhoneticEDModifyHdl, weld::Entry&, void );
111
112 //this method updates the values from 'nLangForPhoneticReading' and 'bIsPhoneticReadingEnabled'
113 //it needs to be called ones if this dialog is opened to create a new entry (in InitControls),
114 //or otherwise it has to be called for each changed TOXMark (in UpdateDialog)
116 OUString GetDefaultPhoneticReading( const OUString& rText );
117
118 void UpdateKeyBoxes();
119
120 void UpdateDialog();
121 void InsertUpdate();
122
123 void Activate();
124
125public:
126
127 SwIndexMarkPane(std::shared_ptr<weld::Dialog> xDialog, weld::Builder& rBuilder,
128 bool bNewDlg, SwWrtShell* pWrtShell);
129
131
132 void ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark const * pCurTOXMark = nullptr);
133 bool IsTOXType(const OUString& rName) { return m_xTypeDCB->find_text(rName) != -1; }
134};
135
137{
139
140 virtual void Activate() override;
141public:
143 SfxChildWindow* pChild,
144 weld::Window *pParent,
145 SfxChildWinInfo const * pInfo,
146 bool bNew);
147 void ReInitDlg(SwWrtShell& rWrtShell);
148};
149
151{
153public:
154 SwIndexMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh, SwTOXMark const * pCurTOXMark);
155 virtual ~SwIndexMarkModalDlg() override;
156 virtual short int run() override;
157};
158
160
162{
164
165 static bool bIsFromComponent;
166
167 friend class SwAuthMarkModalDlg;
168 friend class SwAuthMarkFloatDlg;
169
172
174
177
179
180 css::uno::Reference< css::container::XNameAccess > m_xBibAccess;
181
182 std::unique_ptr<weld::RadioButton> m_xFromComponentRB;
183 std::unique_ptr<weld::RadioButton> m_xFromDocContentRB;
184 std::unique_ptr<weld::Label> m_xAuthorFI;
185 std::unique_ptr<weld::Label> m_xTitleFI;
186 std::unique_ptr<weld::Entry> m_xEntryED;
187 std::unique_ptr<weld::ComboBox> m_xEntryLB;
188 std::unique_ptr<weld::Button> m_xActionBT;
189 std::unique_ptr<weld::Button> m_xCloseBT;
190 std::unique_ptr<weld::Button> m_xCreateEntryPB;
191 std::unique_ptr<weld::Button> m_xEditEntryPB;
192
193 DECL_LINK(InsertHdl, weld::Button&, void);
194 DECL_LINK(CloseHdl, weld::Button&, void);
195 DECL_LINK(CreateEntryHdl, weld::Button&, void);
196 DECL_LINK(CompEntryHdl, weld::ComboBox&, void);
197 DECL_LINK(ChangeSourceHdl, weld::Toggleable&, void);
198 DECL_LINK(IsEditAllowedHdl, weld::Entry&, bool);
199 DECL_LINK(IsEntryAllowedHdl, weld::Entry&, bool);
200 DECL_LINK(EditModifyHdl, weld::Entry&, void);
201
202 void InitControls();
203 void Activate();
204
205public:
206 SwAuthorMarkPane(weld::DialogController& rDialog, weld::Builder& rBuilder, bool bNew);
207 void ReInitDlg(SwWrtShell& rWrtShell);
208};
209
211{
213 virtual void Activate() override;
214public:
216 SfxChildWindow* pChild,
217 weld::Window *pParent,
218 SfxChildWinInfo const * pInfo,
219 bool bNew);
220 void ReInitDlg(SwWrtShell& rWrtShell);
221};
222
224{
226
227 void Apply();
228public:
230 virtual short int run() override;
231};
232
233#endif // INCLUDED_SW_SOURCE_UIBASE_INC_SWUIIDXMRK_HXX
234
235/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwAuthorMarkPane m_aContent
Definition: swuiidxmrk.hxx:212
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:225
SwAuthMarkModalDlg(weld::Window *pParent, SwWrtShell &rSh)
DECL_LINK(IsEditAllowedHdl, weld::Entry &, bool)
std::unique_ptr< weld::RadioButton > m_xFromDocContentRB
Definition: swuiidxmrk.hxx:183
static bool bIsFromComponent
Definition: swuiidxmrk.hxx:165
bool m_bBibAccessInitialized
Definition: swuiidxmrk.hxx:171
std::unique_ptr< weld::Button > m_xCreateEntryPB
Definition: swuiidxmrk.hxx:190
css::uno::Reference< css::container::XNameAccess > m_xBibAccess
Definition: swuiidxmrk.hxx:180
std::unique_ptr< weld::Label > m_xAuthorFI
Definition: swuiidxmrk.hxx:184
DECL_LINK(EditModifyHdl, weld::Entry &, void)
std::unique_ptr< weld::Button > m_xActionBT
Definition: swuiidxmrk.hxx:188
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:187
weld::DialogController & m_rDialog
Definition: swuiidxmrk.hxx:163
OUString m_sFields[AUTH_FIELD_END]
Definition: swuiidxmrk.hxx:176
std::unique_ptr< weld::RadioButton > m_xFromComponentRB
Definition: swuiidxmrk.hxx:182
SwWrtShell * m_pSh
Definition: swuiidxmrk.hxx:173
SwAuthorMarkPane(weld::DialogController &rDialog, weld::Builder &rBuilder, bool bNew)
std::unique_ptr< weld::Button > m_xEditEntryPB
Definition: swuiidxmrk.hxx:191
OUString m_sCreatedEntry[AUTH_FIELD_END]
Definition: swuiidxmrk.hxx:178
std::unique_ptr< weld::Label > m_xTitleFI
Definition: swuiidxmrk.hxx:185
std::unique_ptr< weld::Entry > m_xEntryED
Definition: swuiidxmrk.hxx:186
void ReInitDlg(SwWrtShell &rWrtShell)
std::unique_ptr< weld::Button > m_xCloseBT
Definition: swuiidxmrk.hxx:189
OUString m_sColumnTitles[AUTH_FIELD_END]
Definition: swuiidxmrk.hxx:175
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:138
SwIndexMarkPane m_aContent
Definition: swuiidxmrk.hxx:152
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:365
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:709
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:609
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:412
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:133
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
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:118