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