LibreOffice Module cui (master) 1
SvxMenuConfigPage.cxx
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
20#include <sal/config.h>
21#include <sal/log.hxx>
22
23#include <cui/dlgname.hxx>
24#include <vcl/weld.hxx>
25#include <vcl/svapp.hxx>
26#include <vcl/commandevent.hxx>
27
28#include <strings.hrc>
29#include <helpids.h>
30
31#include <cfg.hxx>
32#include <SvxMenuConfigPage.hxx>
34#include <dialmgr.hxx>
35
37
39 const SfxItemSet& rSet, bool bIsMenuBar)
40 : SvxConfigPage(pPage, pController, rSet)
41 , m_bIsMenuBar(bIsMenuBar)
42{
43 m_xGearBtn = m_xBuilder->weld_menu_button("menugearbtn");
44 m_xGearBtn->show();
46 new SvxMenuEntriesListBox(m_xBuilder->weld_tree_view("menucontents"), this));
47 weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
48 m_xDropTargetHelper.reset(new SvxConfigPageFunctionDropTarget(*this, rTreeView));
49 rTreeView.connect_size_allocate(LINK(this, SvxMenuConfigPage, MenuEntriesSizeAllocHdl));
50 Size aSize(m_xFunctions->get_size_request());
51 rTreeView.set_size_request(aSize.Width(), aSize.Height());
52 MenuEntriesSizeAllocHdl(aSize);
53 rTreeView.set_hexpand(true);
54 rTreeView.set_vexpand(true);
55 rTreeView.show();
56
57 rTreeView.connect_changed(LINK(this, SvxMenuConfigPage, SelectMenuEntry));
58 rTreeView.connect_popup_menu(LINK(this, SvxMenuConfigPage, ContentContextMenuHdl));
59
60 m_xFunctions->get_widget().connect_popup_menu(
61 LINK(this, SvxMenuConfigPage, FunctionContextMenuHdl));
62
63 m_xGearBtn->connect_selected(LINK(this, SvxMenuConfigPage, GearHdl));
64
65 m_xCommandCategoryListBox->connect_changed(LINK(this, SvxMenuConfigPage, SelectCategory));
66
67 m_xMoveUpButton->connect_clicked(LINK(this, SvxConfigPage, MoveHdl));
68 m_xMoveDownButton->connect_clicked(LINK(this, SvxConfigPage, MoveHdl));
69
70 m_xAddCommandButton->connect_clicked(LINK(this, SvxMenuConfigPage, AddCommandHdl));
71 m_xRemoveCommandButton->connect_clicked(LINK(this, SvxMenuConfigPage, RemoveCommandHdl));
72
73 m_xInsertBtn->connect_selected(LINK(this, SvxMenuConfigPage, InsertHdl));
74 m_xModifyBtn->connect_selected(LINK(this, SvxMenuConfigPage, ModifyItemHdl));
75 m_xResetBtn->connect_clicked(LINK(this, SvxMenuConfigPage, ResetMenuHdl));
76
77 // These operations are not possible on menus/context menus yet
78 m_xModifyBtn->remove_item("changeIcon");
79 m_xModifyBtn->remove_item("resetIcon");
80 m_xModifyBtn->remove_item("restoreItem");
81
82 if (!bIsMenuBar)
83 {
84 //TODO: Remove this when the gear button is implemented for context menus
85 m_xGearBtn->set_sensitive(false);
86 m_xGearBtn->hide();
87 }
88 else
89 {
90 // TODO: Remove this when it is possible to reset menubar menus individually
91 m_xResetBtn->set_sensitive(false);
92 }
93}
94
96{
97 // regenerate with the current ordering within the list
99 pEntries->clear();
100
101 for (int i = 0; i < m_xContentsListBox->n_children(); ++i)
102 pEntries->push_back(weld::fromId<SvxConfigEntry*>(m_xContentsListBox->get_id(i)));
103
107}
108
109IMPL_LINK(SvxMenuConfigPage, MenuEntriesSizeAllocHdl, const Size&, rSize, void)
110{
111 weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
112 std::vector<int> aWidths;
113
114 int nStandardImageColWidth = rTreeView.get_checkbox_column_width();
115 int nMargin = 16;
116
117 aWidths.push_back(rSize.Width() - (nMargin + nStandardImageColWidth));
118 rTreeView.set_column_fixed_widths(aWidths);
119}
120
122{
123 for (int i = 0, nCount = m_xSaveInListBox->get_count(); i < nCount; ++i)
124 delete weld::fromId<SaveInData*>(m_xSaveInListBox->get_id(i));
125 m_xSaveInListBox->clear();
126}
127
128// Populates the Menu combo box
130{
131 // ensure that the UI is cleared before populating it
132 m_xTopLevelListBox->clear();
133 m_xContentsListBox->clear();
134
136
137 m_xTopLevelListBox->set_active(m_xTopLevelListBox->get_count() ? 0 : -1);
139
142 m_xCommandCategoryListBox->categorySelected(m_xFunctions.get(), OUString(), GetSaveInData());
143 SelectFunctionHdl(m_xFunctions->get_widget());
144}
145
146IMPL_LINK_NOARG(SvxMenuConfigPage, SelectMenuEntry, weld::TreeView&, void) { UpdateButtonStates(); }
147
149{
150 // Disable Up and Down buttons depending on current selection
151 int selection = m_xContentsListBox->get_selected_index();
152
153 bool bIsSeparator
154 = selection != -1
155 && weld::fromId<SvxConfigEntry*>(m_xContentsListBox->get_id(selection))->IsSeparator();
156 bool bIsValidSelection = (m_xContentsListBox->n_children() != 0 && selection != -1);
157
158 m_xMoveUpButton->set_sensitive(bIsValidSelection && selection != 0);
159 m_xMoveDownButton->set_sensitive(bIsValidSelection
160 && selection != m_xContentsListBox->n_children() - 1);
161
162 m_xRemoveCommandButton->set_sensitive(bIsValidSelection);
163
164 m_xModifyBtn->set_sensitive(bIsValidSelection && !bIsSeparator);
165
166 // If there is no top level selection (menu), then everything working on the right box
167 // which contains the functions of the selected menu/toolbar needs to be disabled
169
170 m_xInsertBtn->set_sensitive(pMenuData != nullptr);
171
173
174 m_xAddCommandButton->set_sensitive(
175 pMenuData != nullptr && !IsCommandInMenuList(selectedCmd, pMenuData->GetEntries()));
176
177 delete selectedCmd;
178
179 if (bIsValidSelection)
180 {
181 m_xRemoveCommandButton->set_sensitive(pMenuData != nullptr);
182 }
183
184 //Handle the gear button
185 if (pMenuData && m_bIsMenuBar)
186 {
187 // Add option (gear_add) will always be enabled
188 m_xGearBtn->set_item_sensitive("menu_gear_delete", pMenuData->IsDeletable());
189 m_xGearBtn->set_item_sensitive("menu_gear_rename", pMenuData->IsRenamable());
190 m_xGearBtn->set_item_sensitive("menu_gear_move", pMenuData->IsMovable());
191 }
192}
193
195{
197
198 SvxEntries* pParentEntries = FindParentForChild(GetSaveInData()->GetEntries(), pMenuData);
199
200 SvxConfigPageHelper::RemoveEntry(pParentEntries, pMenuData);
201 delete pMenuData;
202
204
206}
207
209{
210 int nActEntry = m_xContentsListBox->get_selected_index();
211
212 if (nActEntry == -1)
213 return;
214
215 // get currently selected menu entry
216 SvxConfigEntry* pMenuEntry
217 = weld::fromId<SvxConfigEntry*>(m_xContentsListBox->get_id(nActEntry));
218
219 // get currently selected menu
221
222 // remove menu entry from the list for this menu
223 SvxConfigPageHelper::RemoveEntry(pMenu->GetEntries(), pMenuEntry);
224
225 // remove menu entry from UI
226 m_xContentsListBox->remove(nActEntry);
227
228 // if this is a submenu entry, redraw the menus list box
229 if (pMenuEntry->IsPopup())
230 {
232 }
233
234 // delete data for menu entry
235 delete pMenuEntry;
236
238 pMenu->SetModified();
239}
240
242{
243 OUString msg = CuiResId(RID_CUISTR_CONFIRM_MENU_RESET);
244
245 OUString saveInName = m_xSaveInListBox->get_active_text();
246
247 OUString label = SvxConfigPageHelper::replaceSaveInName(msg, saveInName);
248
249 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(
250 GetFrameWeld(), VclMessageType::Question, VclButtonsType::YesNo, label));
251 return xQueryBox->run();
252}
253
255{
256 weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
257
259 if (!pMenuData)
260 rTreeView.clear();
261 else
262 {
263 SvxEntries* pEntries = pMenuData->GetEntries();
264
265 rTreeView.bulk_insert_for_each(
266 pEntries->size(), [this, &rTreeView, pEntries](weld::TreeIter& rIter, int nIdx) {
267 auto const& entry = (*pEntries)[nIdx];
268 OUString sId(weld::toId(entry));
269 rTreeView.set_id(rIter, sId);
270 InsertEntryIntoUI(entry, rTreeView, rIter, true);
271 });
272 }
273
275}
276
277IMPL_LINK(SvxMenuConfigPage, GearHdl, const OUString&, rIdent, void)
278{
279 if (rIdent == "menu_gear_add")
280 {
281 SvxMainMenuOrganizerDialog aDialog(GetFrameWeld(), GetSaveInData()->GetEntries(), nullptr,
282 true);
283
284 if (aDialog.run() == RET_OK)
285 {
286 GetSaveInData()->SetEntries(aDialog.ReleaseEntries());
287 ReloadTopLevelListBox(aDialog.GetSelectedEntry());
288 GetSaveInData()->SetModified();
289 }
290 }
291 else if (rIdent == "menu_gear_delete")
292 {
293 DeleteSelectedTopLevel();
294 }
295 else if (rIdent == "menu_gear_rename")
296 {
297 SvxConfigEntry* pMenuData = GetTopLevelSelection();
298
299 OUString sCurrentName(SvxConfigPageHelper::stripHotKey(pMenuData->GetName()));
300 OUString sDesc = CuiResId(RID_CUISTR_LABEL_NEW_NAME);
301
302 SvxNameDialog aNameDialog(GetFrameWeld(), sCurrentName, sDesc);
304 aNameDialog.set_title(CuiResId(RID_CUISTR_RENAME_MENU));
305
306 if (aNameDialog.run() == RET_OK)
307 {
308 OUString sNewName = aNameDialog.GetName();
309
310 if (sCurrentName == sNewName)
311 return;
312
313 pMenuData->SetName(sNewName);
314
315 ReloadTopLevelListBox();
316
317 GetSaveInData()->SetModified();
318 }
319 }
320 else if (rIdent == "menu_gear_move")
321 {
322 SvxConfigEntry* pMenuData = GetTopLevelSelection();
323
324 SvxMainMenuOrganizerDialog aDialog(GetFrameWeld(), GetSaveInData()->GetEntries(), pMenuData,
325 false);
326 if (aDialog.run() == RET_OK)
327 {
328 GetSaveInData()->SetEntries(aDialog.ReleaseEntries());
329
330 ReloadTopLevelListBox();
331
332 GetSaveInData()->SetModified();
333 }
334 }
335 else
336 {
337 //This block should never be reached
338 SAL_WARN("cui.customize", "Unknown gear menu option: " << rIdent);
339 return;
340 }
341
342 UpdateButtonStates();
343}
344
346{
347 OUString aSearchTerm(m_xSearchEdit->get_text());
348
349 m_xCommandCategoryListBox->categorySelected(m_xFunctions.get(), aSearchTerm, GetSaveInData());
350
351 SelectFunctionHdl(m_xFunctions->get_widget());
352}
353
355{
356 int nPos = AddFunction(-1, /*bAllowDuplicates*/ false);
357 if (nPos == -1)
358 return;
359 weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
360 SvxConfigEntry* pEntry = weld::fromId<SvxConfigEntry*>(rTreeView.get_id(nPos));
361 InsertEntryIntoUI(pEntry, rTreeView, nPos, true);
362}
363
365{
366 DeleteSelectedContent();
367 if (GetSaveInData()->IsModified())
368 {
369 UpdateButtonStates();
370 }
371}
372
373IMPL_LINK(SvxMenuConfigPage, InsertHdl, const OUString&, rIdent, void)
374{
375 weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
376 if (rIdent == "insertseparator")
377 {
378 SvxConfigEntry* pNewEntryData = new SvxConfigEntry;
379 pNewEntryData->SetUserDefined();
380 int nPos = AppendEntry(pNewEntryData, -1);
381 InsertEntryIntoUI(pNewEntryData, rTreeView, nPos, true);
382 }
383 else if (rIdent == "insertsubmenu")
384 {
385 OUString aNewName;
386 OUString aDesc = CuiResId(RID_CUISTR_SUBMENU_NAME);
387
388 SvxNameDialog aNameDialog(GetFrameWeld(), aNewName, aDesc);
390 aNameDialog.set_title(CuiResId(RID_CUISTR_ADD_SUBMENU));
391
392 if (aNameDialog.run() == RET_OK)
393 {
394 aNewName = aNameDialog.GetName();
395
396 SvxConfigEntry* pNewEntryData
397 = new SvxConfigEntry(aNewName, aNewName, true, /*bParentData*/ false);
398 pNewEntryData->SetName(aNewName);
399 pNewEntryData->SetUserDefined();
400
401 int nPos = AppendEntry(pNewEntryData, -1);
402 InsertEntryIntoUI(pNewEntryData, rTreeView, nPos, true);
403
404 ReloadTopLevelListBox();
405
406 m_xContentsListBox->scroll_to_row(nPos);
407 m_xContentsListBox->select(nPos);
408
409 GetSaveInData()->SetModified();
410 }
411 }
412 else
413 {
414 //This block should never be reached
415 SAL_WARN("cui.customize", "Unknown insert option: " << rIdent);
416 return;
417 }
418
419 if (GetSaveInData()->IsModified())
420 {
421 UpdateButtonStates();
422 }
423}
424
425IMPL_LINK(SvxMenuConfigPage, ModifyItemHdl, const OUString&, rIdent, void)
426{
427 if (rIdent == "renameItem")
428 {
429 int nActEntry = m_xContentsListBox->get_selected_index();
430 SvxConfigEntry* pEntry
431 = weld::fromId<SvxConfigEntry*>(m_xContentsListBox->get_id(nActEntry));
432
433 OUString aNewName(SvxConfigPageHelper::stripHotKey(pEntry->GetName()));
434 OUString aDesc = CuiResId(RID_CUISTR_LABEL_NEW_NAME);
435
436 SvxNameDialog aNameDialog(GetFrameWeld(), aNewName, aDesc);
438 aNameDialog.set_title(CuiResId(RID_CUISTR_RENAME_MENU));
439
440 if (aNameDialog.run() == RET_OK)
441 {
442 aNewName = aNameDialog.GetName();
443
444 pEntry->SetName(aNewName);
445 m_xContentsListBox->set_text(nActEntry, aNewName, 0);
446
447 GetSaveInData()->SetModified();
448 GetTopLevelSelection()->SetModified();
449 }
450 }
451 else
452 {
453 //This block should never be reached
454 SAL_WARN("cui.customize", "Unknown insert option: " << rIdent);
455 return;
456 }
457
458 if (GetSaveInData()->IsModified())
459 {
460 UpdateButtonStates();
461 }
462}
463
465{
466 SvxConfigEntry* pMenuData = GetTopLevelSelection();
467
468 if (pMenuData == nullptr)
469 {
470 SAL_WARN("cui.customize",
471 "RHB top level selection is null. A menu must be selected to reset!");
472 return;
473 }
474
475 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(
476 GetFrameWeld(), VclMessageType::Question, VclButtonsType::YesNo,
477 CuiResId(RID_CUISTR_CONFIRM_RESTORE_DEFAULT_MENU)));
478
479 // Resetting individual top-level menus is not possible at the moment.
480 // So we are resetting only if it is a context menu
481 if (m_bIsMenuBar || xQueryBox->run() != RET_YES)
482 return;
483
484 sal_Int32 nPos = m_xTopLevelListBox->get_active();
485 ContextMenuSaveInData* pSaveInData = static_cast<ContextMenuSaveInData*>(GetSaveInData());
486
487 pSaveInData->ResetContextMenu(pMenuData);
488
489 // ensure that the UI is cleared before populating it
490 m_xTopLevelListBox->clear();
491 m_xContentsListBox->clear();
492
493 ReloadTopLevelListBox();
494
495 // Reselect the reset menu
496 m_xTopLevelListBox->set_active(nPos);
497 SelectElement();
498}
499
501 const css::uno::Reference<css::ui::XUIConfigurationManager>& xCfgMgr,
502 const css::uno::Reference<css::ui::XUIConfigurationManager>& xParentCfgMgr,
503 const OUString& aModuleId, bool bDocConfig)
504{
505 if (!m_bIsMenuBar)
506 return static_cast<SaveInData*>(
507 new ContextMenuSaveInData(xCfgMgr, xParentCfgMgr, aModuleId, bDocConfig));
508
509 return static_cast<SaveInData*>(
510 new MenuSaveInData(xCfgMgr, xParentCfgMgr, aModuleId, bDocConfig));
511}
512
513IMPL_LINK(SvxMenuConfigPage, ContentContextMenuHdl, const CommandEvent&, rCEvt, bool)
514{
515 if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
516 return false;
517
518 weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
519
520 // Select clicked entry
521 std::unique_ptr<weld::TreeIter> xIter(rTreeView.make_iterator());
522 if (!rTreeView.get_dest_row_at_pos(rCEvt.GetMousePosPixel(), xIter.get(), false))
523 return false;
524 rTreeView.select(*xIter);
525 SelectMenuEntry(rTreeView);
526
527 int nSelectIndex = m_xContentsListBox->get_selected_index();
528
529 bool bIsSeparator
530 = nSelectIndex != -1
531 && weld::fromId<SvxConfigEntry*>(m_xContentsListBox->get_id(nSelectIndex))->IsSeparator();
532 bool bIsValidSelection = (m_xContentsListBox->n_children() != 0 && nSelectIndex != -1);
533
534 std::unique_ptr<weld::Builder> xBuilder(
535 Application::CreateBuilder(&rTreeView, "cui/ui/entrycontextmenu.ui"));
536 auto xContextMenu = xBuilder->weld_menu("menu");
537 xContextMenu->set_visible("add", false);
538 xContextMenu->set_visible("remove", bIsValidSelection);
539 xContextMenu->set_visible("rename", bIsValidSelection && !bIsSeparator);
540 xContextMenu->set_visible("changeIcon", false);
541 xContextMenu->set_visible("resetIcon", false);
542 xContextMenu->set_visible("restoreDefault", false);
543 OUString sCommand(xContextMenu->popup_at_rect(
544 &rTreeView, tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1, 1))));
545
546 if (sCommand == "remove")
547 {
548 RemoveCommandHdl(*m_xRemoveCommandButton);
549 }
550 else if (sCommand == "rename")
551 {
552 ModifyItemHdl("renameItem");
553 }
554 else if (!sCommand.isEmpty())
555 SAL_WARN("cui.customize", "Unknown context menu action: " << sCommand);
556 return true;
557}
558
559IMPL_LINK(SvxMenuConfigPage, FunctionContextMenuHdl, const CommandEvent&, rCEvt, bool)
560{
561 if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
562 return false;
563
564 weld::TreeView& rTreeView = m_xFunctions->get_widget();
565
566 // Select clicked entry
567 std::unique_ptr<weld::TreeIter> xIter(rTreeView.make_iterator());
568 if (!rTreeView.get_dest_row_at_pos(rCEvt.GetMousePosPixel(), xIter.get(), false))
569 return false;
570 rTreeView.select(*xIter);
571 SelectFunctionHdl(rTreeView);
572
573 std::unique_ptr<weld::Builder> xBuilder(
574 Application::CreateBuilder(&rTreeView, "cui/ui/entrycontextmenu.ui"));
575 auto xContextMenu = xBuilder->weld_menu("menu");
576 xContextMenu->set_visible("add", true);
577 xContextMenu->set_visible("remove", false);
578 xContextMenu->set_visible("rename", false);
579 xContextMenu->set_visible("changeIcon", false);
580 xContextMenu->set_visible("resetIcon", false);
581 xContextMenu->set_visible("restoreDefault", false);
582 OUString sCommand(xContextMenu->popup_at_rect(
583 &rTreeView, tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1, 1))));
584
585 if (sCommand == "add")
586 {
587 AddCommandHdl(*m_xAddCommandButton);
588 }
589 else if (!sCommand.isEmpty())
590 SAL_WARN("cui.customize", "Unknown context menu action: " << sCommand);
591 return true;
592}
593
594/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
IMPL_LINK(SvxMenuConfigPage, MenuEntriesSizeAllocHdl, const Size &, rSize, void)
IMPL_LINK_NOARG(SvxMenuConfigPage, SelectMenuEntry, weld::TreeView &, void)
std::vector< SvxConfigEntry * > SvxEntries
Definition: cfg.hxx:63
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
void ResetContextMenu(const SvxConfigEntry *pEntry)
Definition: cfg.cxx:908
void SetModified(bool bValue=true)
Definition: cfg.hxx:129
weld::Window * GetFrameWeld() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
bool IsDeletable() const
Definition: cfg.cxx:1957
SvxEntries * GetEntries() const
Definition: cfg.hxx:293
bool IsMovable() const
Definition: cfg.cxx:1952
bool IsPopup() const
Definition: cfg.hxx:285
void SetName(const OUString &rStr)
Definition: cfg.hxx:282
void SetModified(bool bValue=true)
Definition: cfg.hxx:302
void SetUserDefined(bool bOn=true)
Definition: cfg.hxx:287
bool IsRenamable() const
Definition: cfg.cxx:1962
const OUString & GetName() const
Definition: cfg.hxx:281
static OUString replaceSaveInName(const OUString &rMessage, std::u16string_view rSaveInName)
static OUString stripHotKey(const OUString &str)
static void RemoveEntry(SvxEntries *pEntries, SvxConfigEntry const *pChildEntry)
void ReloadTopLevelListBox(SvxConfigEntry const *pSelection=nullptr)
Definition: cfg.cxx:1365
OUString GetScriptURL() const
Definition: cfg.cxx:1318
std::unique_ptr< weld::Button > m_xMoveUpButton
Definition: cfg.hxx:410
OUString m_aModuleId
Definition: cfg.hxx:386
std::unique_ptr< weld::ComboBox > m_xTopLevelListBox
Definition: cfg.hxx:404
std::unique_ptr< weld::MenuButton > m_xGearBtn
Definition: cfg.hxx:406
std::unique_ptr< SvxConfigPageFunctionDropTarget > m_xDropTargetHelper
Definition: cfg.hxx:408
SvxConfigEntry * GetTopLevelSelection()
Definition: cfg.hxx:503
std::unique_ptr< CuiConfigFunctionListBox > m_xFunctions
Definition: cfg.hxx:391
std::unique_ptr< weld::Button > m_xRemoveCommandButton
Definition: cfg.hxx:424
std::unique_ptr< CommandCategoryListBox > m_xCommandCategoryListBox
Definition: cfg.hxx:390
std::unique_ptr< weld::Button > m_xResetBtn
Definition: cfg.hxx:419
static bool IsCommandInMenuList(const SvxConfigEntry *pEntryData, const SvxEntries *pEntries)
Definition: cfg.cxx:1468
std::unique_ptr< weld::MenuButton > m_xInsertBtn
Definition: cfg.hxx:416
SvxConfigEntry * CreateCommandFromSelection(const OUString &aURL)
Definition: cfg.cxx:1440
std::unique_ptr< weld::Button > m_xMoveDownButton
Definition: cfg.hxx:411
css::uno::Reference< css::frame::XFrame > m_xFrame
Definition: cfg.hxx:385
std::unique_ptr< weld::MenuButton > m_xModifyBtn
Definition: cfg.hxx:417
std::unique_ptr< weld::Button > m_xAddCommandButton
Definition: cfg.hxx:423
std::unique_ptr< weld::ComboBox > m_xSaveInListBox
Definition: cfg.hxx:413
SaveInData * GetSaveInData()
Definition: cfg.hxx:484
SvxEntries * FindParentForChild(SvxEntries *pParentEntries, SvxConfigEntry *pChildData)
Definition: cfg.cxx:1416
std::unique_ptr< SvxMenuEntriesListBox > m_xContentsListBox
Definition: cfg.hxx:407
std::unique_ptr< SvxEntries > ReleaseEntries()
Definition: cfg.hxx:548
SvxConfigEntry * GetSelectedEntry()
Definition: cfg.cxx:1913
virtual void ListModified() override
void Init() override
void UpdateButtonStates() override
SvxMenuConfigPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rItemSet, bool bIsMenuBar=true)
short QueryReset() override
void DeleteSelectedContent() override
void DeleteSelectedTopLevel() override
SaveInData * CreateSaveInData(const css::uno::Reference< css::ui::XUIConfigurationManager > &, const css::uno::Reference< css::ui::XUIConfigurationManager > &, const OUString &aModuleId, bool docConfig) override
virtual ~SvxMenuConfigPage() override
virtual void SelectElement() override
Dialog for editing a name.
Definition: dlgname.hxx:27
OUString GetName() const
Definition: dlgname.hxx:41
virtual short run()
void set_title(const OUString &rTitle)
void set_help_id(const OUString &rHelpId)
virtual std::unique_ptr< TreeIter > make_iterator(const TreeIter *pOrig=nullptr) const=0
virtual void connect_popup_menu(const Link< const CommandEvent &, bool > &rLink)
int get_checkbox_column_width() const
virtual void clear()=0
virtual bool get_dest_row_at_pos(const Point &rPos, weld::TreeIter *pResult, bool bDnDMode, bool bAutoScroll=true)=0
void connect_changed(const Link< TreeView &, void > &rLink)
virtual void select(int pos)=0
virtual void set_column_fixed_widths(const std::vector< int > &rWidths)=0
virtual void bulk_insert_for_each(int nSourceCount, const std::function< void(TreeIter &, int nSourceIndex)> &func, const weld::TreeIter *pParent=nullptr, const std::vector< int > *pFixedWidths=nullptr)=0
virtual OUString get_id(int pos) const=0
virtual void show()=0
virtual void set_vexpand(bool bExpand)=0
virtual void set_size_request(int nWidth, int nHeight)=0
virtual void connect_size_allocate(const Link< const Size &, void > &rLink)
virtual void set_hexpand(bool bExpand)=0
OUString CuiResId(TranslateId aKey)
Definition: cuiresmgr.cxx:23
int nCount
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
constexpr OUStringLiteral HID_SVX_CONFIG_NAME_SUBMENU
Definition: helpids.h:38
constexpr OUStringLiteral HID_SVX_CONFIG_RENAME_MENU_ITEM
Definition: helpids.h:41
constexpr OUStringLiteral HID_SVX_CONFIG_RENAME_MENU
Definition: helpids.h:39
sal_uInt16 nPos
#define SAL_WARN(area, stream)
def label(st)
Reference< XComponentContext > getProcessComponentContext()
int i
static SfxItemSet & rSet
RET_OK
RET_YES