nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / uibase / inc / swuiidxmrk.hxx
blobee738021fc13904164bfa9c35835d9c25681ce08
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_SWUIIDXMRK_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_SWUIIDXMRK_HXX
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>
30 class SwWrtShell;
31 class SwTOXMgr;
32 class SwTOXMark;
34 // insert mark for index entry
35 class SwIndexMarkFloatDlg;
36 class SwIndexMarkModalDlg;
38 class SwIndexMarkPane
40 std::shared_ptr<weld::Dialog> m_xDialog;
42 friend class SwIndexMarkFloatDlg;
43 friend class SwIndexMarkModalDlg;
45 OUString m_aOrgStr;
46 bool m_bDel;
47 bool const m_bNewMark;
48 bool m_bSelected;
50 bool m_bPhoneticED0_ChangedByUser;
51 bool m_bPhoneticED1_ChangedByUser;
52 bool m_bPhoneticED2_ChangedByUser;
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 >
56 m_xExtendedIndexEntrySupplier;
58 std::unique_ptr<SwTOXMgr>
59 m_pTOXMgr;
60 SwWrtShell* m_pSh;
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;
91 void Apply();
92 void InitControls();
93 void InsertMark();
94 void UpdateMark();
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::ToggleButton&, void );
110 DECL_LINK( PhoneticEDModifyHdl, weld::Entry&, void );
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)
115 void UpdateLanguageDependenciesForPhoneticReading();
116 OUString GetDefaultPhoneticReading( const OUString& rText );
118 void UpdateKeyBoxes();
120 void UpdateDialog();
121 void InsertUpdate();
123 void Activate();
125 public:
127 SwIndexMarkPane(const std::shared_ptr<weld::Dialog>& rDialog, weld::Builder& rBuilder,
128 bool bNewDlg, SwWrtShell* pWrtShell);
130 ~SwIndexMarkPane();
132 void ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark const * pCurTOXMark = nullptr);
133 bool IsTOXType(const OUString& rName) { return m_xTypeDCB->find_text(rName) != -1; }
136 class SwIndexMarkFloatDlg : public SfxModelessDialogController
138 SwIndexMarkPane m_aContent;
140 virtual void Activate() override;
141 public:
142 SwIndexMarkFloatDlg(SfxBindings* pBindings,
143 SfxChildWindow* pChild,
144 weld::Window *pParent,
145 SfxChildWinInfo const * pInfo,
146 bool bNew);
147 void ReInitDlg(SwWrtShell& rWrtShell);
150 class SwIndexMarkModalDlg : public SfxDialogController
152 SwIndexMarkPane m_aContent;
153 public:
154 SwIndexMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh, SwTOXMark const * pCurTOXMark);
155 virtual ~SwIndexMarkModalDlg() override;
156 virtual short int run() override;
159 class SwAuthMarkModalDlg;
161 class SwAuthorMarkPane
163 weld::DialogController& m_rDialog;
165 static bool bIsFromComponent;
167 friend class SwAuthMarkModalDlg;
168 friend class SwAuthMarkFloatDlg;
170 bool bNewEntry;
171 bool bBibAccessInitialized;
173 SwWrtShell* pSh;
175 OUString m_sColumnTitles[AUTH_FIELD_END];
176 OUString m_sFields[AUTH_FIELD_END];
178 OUString m_sCreatedEntry[AUTH_FIELD_END];
180 css::uno::Reference< css::container::XNameAccess > xBibAccess;
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;
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::ToggleButton&, void);
198 DECL_LINK(IsEditAllowedHdl, weld::Entry&, bool);
199 DECL_LINK(IsEntryAllowedHdl, weld::Entry&, bool);
200 DECL_LINK(EditModifyHdl, weld::Entry&, void);
202 void InitControls();
203 void Activate();
205 public:
206 SwAuthorMarkPane(weld::DialogController& rDialog, weld::Builder& rBuilder, bool bNew);
207 void ReInitDlg(SwWrtShell& rWrtShell);
210 class SwAuthMarkFloatDlg : public SfxModelessDialogController
212 SwAuthorMarkPane m_aContent;
213 virtual void Activate() override;
214 public:
215 SwAuthMarkFloatDlg(SfxBindings* pBindings,
216 SfxChildWindow* pChild,
217 weld::Window *pParent,
218 SfxChildWinInfo const * pInfo,
219 bool bNew);
220 void ReInitDlg(SwWrtShell& rWrtShell);
223 class SwAuthMarkModalDlg : public SfxDialogController
225 SwAuthorMarkPane m_aContent;
227 void Apply();
228 public:
229 SwAuthMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh);
230 virtual short int run() override;
233 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_SWUIIDXMRK_HXX
235 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */