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