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  : SvxConfigPage(pPage, pController, rSet)
41  , m_bIsMenuBar(bIsMenuBar)
42 {
43  m_xGearBtn = m_xBuilder->weld_menu_button("menugearbtn");
44  m_xGearBtn->show();
45  m_xContentsListBox.reset(new SvxMenuEntriesListBox(m_xBuilder->weld_tree_view("menucontents"), this));
46  weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
47  m_xDropTargetHelper.reset(new SvxConfigPageFunctionDropTarget(*this, rTreeView));
48  rTreeView.connect_size_allocate(LINK(this, SvxMenuConfigPage, MenuEntriesSizeAllocHdl));
49  Size aSize(m_xFunctions->get_size_request());
50  rTreeView.set_size_request(aSize.Width(), aSize.Height());
51  MenuEntriesSizeAllocHdl(aSize);
52  rTreeView.set_hexpand(true);
53  rTreeView.set_vexpand(true);
54  rTreeView.show();
55 
56  rTreeView.connect_changed(
57  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(
74  LINK( this, SvxMenuConfigPage, InsertHdl ) );
75  m_xModifyBtn->connect_selected(
76  LINK( this, SvxMenuConfigPage, ModifyItemHdl ) );
77  m_xResetBtn->connect_clicked(
78  LINK( this, SvxMenuConfigPage, ResetMenuHdl ) );
79 
80  // These operations are not possible on menus/context menus yet
81  m_xModifyBtn->remove_item("changeIcon");
82  m_xModifyBtn->remove_item("resetIcon");
83  m_xModifyBtn->remove_item("restoreItem");
84 
85  if ( !bIsMenuBar )
86  {
87  //TODO: Remove this when the gear button is implemented for context menus
88  m_xGearBtn->set_sensitive(false);
89  m_xGearBtn->hide();
90  }
91  else
92  {
93  // TODO: Remove this when it is possible to reset menubar menus individually
94  m_xResetBtn->set_sensitive(false);
95  }
96 }
97 
99 {
100  // regenerate with the current ordering within the list
101  SvxEntries* pEntries = GetTopLevelSelection()->GetEntries();
102  pEntries->clear();
103 
104  for (int i = 0; i < m_xContentsListBox->n_children(); ++i)
105  pEntries->push_back(reinterpret_cast<SvxConfigEntry*>(m_xContentsListBox->get_id(i).toInt64()));
106 
110 }
111 
112 IMPL_LINK(SvxMenuConfigPage, MenuEntriesSizeAllocHdl, const Size&, rSize, void)
113 {
114  weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
115  std::vector<int> aWidths;
116 
117  int nStandardImageColWidth = rTreeView.get_checkbox_column_width();
118  int nMargin = 16;
119 
120  aWidths.push_back(rSize.Width() - (nMargin + nStandardImageColWidth));
121  rTreeView.set_column_fixed_widths(aWidths);
122 }
123 
125 {
126  for (int i = 0, nCount = m_xSaveInListBox->get_count(); i < nCount; ++i)
127  delete reinterpret_cast<SaveInData*>(m_xSaveInListBox->get_id(i).toInt64());
128  m_xSaveInListBox->clear();
129 }
130 
131 // Populates the Menu combo box
133 {
134  // ensure that the UI is cleared before populating it
135  m_xTopLevelListBox->clear();
136  m_xContentsListBox->clear();
137 
139 
140  m_xTopLevelListBox->set_active(0);
141  SelectElement();
142 
146  m_xCommandCategoryListBox->categorySelected(m_xFunctions.get(), OUString(), GetSaveInData());
147  SelectFunctionHdl(m_xFunctions->get_widget());
148 }
149 
151 {
152  UpdateButtonStates();
153 }
154 
156 {
157  // Disable Up and Down buttons depending on current selection
158  int selection = m_xContentsListBox->get_selected_index();
159 
160  bool bIsSeparator =
161  selection != -1 && reinterpret_cast<SvxConfigEntry*>(m_xContentsListBox->get_id(selection).toInt64())->IsSeparator();
162  bool bIsValidSelection =
163  (m_xContentsListBox->n_children() != 0 && selection != -1);
164 
165  m_xMoveUpButton->set_sensitive(
166  bIsValidSelection && selection != 0 );
167  m_xMoveDownButton->set_sensitive(
168  bIsValidSelection && selection != m_xContentsListBox->n_children() - 1);
169 
170  m_xRemoveCommandButton->set_sensitive( bIsValidSelection );
171 
172  m_xModifyBtn->set_sensitive( bIsValidSelection && !bIsSeparator);
173 
174  // If there is no top level selection (menu), then everything working on the right box
175  // which contains the functions of the selected menu/toolbar needs to be disabled
176  SvxConfigEntry* pMenuData = GetTopLevelSelection();
177 
178  m_xInsertBtn->set_sensitive(pMenuData != nullptr);
179 
180  m_xAddCommandButton->set_sensitive(pMenuData != nullptr);
181  m_xRemoveCommandButton->set_sensitive(pMenuData != nullptr);
182 
183  //Handle the gear button
184  if (pMenuData && m_bIsMenuBar)
185  {
186  // Add option (gear_add) will always be enabled
187  m_xGearBtn->set_item_sensitive( "menu_gear_delete", pMenuData->IsDeletable() );
188  m_xGearBtn->set_item_sensitive( "menu_gear_rename", pMenuData->IsRenamable() );
189  m_xGearBtn->set_item_sensitive( "menu_gear_move", pMenuData->IsMovable() );
190  }
191 }
192 
194 {
195  SvxConfigEntry* pMenuData = GetTopLevelSelection();
196 
197  SvxEntries* pParentEntries =
198  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  reinterpret_cast<SvxConfigEntry*>(m_xContentsListBox->get_id(nActEntry).toInt64());
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_SVXSTR_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(GetFrameWeld(),
250  VclMessageType::Question, VclButtonsType::YesNo,
251  label));
252  return xQueryBox->run();
253 }
254 
256 {
257  weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
258 
259  SvxConfigEntry* pMenuData = GetTopLevelSelection();
260  if (!pMenuData)
261  rTreeView.clear();
262  else
263  {
264  SvxEntries* pEntries = pMenuData->GetEntries();
265 
266  rTreeView.bulk_insert_for_each(pEntries->size(), [this, &rTreeView, pEntries](weld::TreeIter& rIter, int nIdx) {
267  auto const& entry = (*pEntries)[nIdx];
268  OUString sId(OUString::number(reinterpret_cast<sal_Int64>(entry)));
269  rTreeView.set_id(rIter, sId);
270  InsertEntryIntoUI(entry, rTreeView, rIter, true);
271  });
272  }
273 
275 }
276 
277 IMPL_LINK(SvxMenuConfigPage, GearHdl, const OString&, rIdent, void)
278 {
279  if (rIdent == "menu_gear_add")
280  {
282  GetSaveInData()->GetEntries(), nullptr, 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_SVXSTR_LABEL_NEW_NAME );
301 
302  SvxNameDialog aNameDialog(GetFrameWeld(), sCurrentName, sDesc);
304  aNameDialog.set_title(CuiResId(RID_SVXSTR_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(),
325  pMenuData, 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 =
361  reinterpret_cast<SvxConfigEntry*>(rTreeView.get_id(nPos).toInt64());
362  InsertEntryIntoUI(pEntry, rTreeView, nPos, true);
363 }
364 
365 IMPL_LINK_NOARG( SvxMenuConfigPage, RemoveCommandHdl, weld::Button&, void )
366 {
367  DeleteSelectedContent();
368  if ( GetSaveInData()->IsModified() )
369  {
370  UpdateButtonStates();
371  }
372 }
373 
374 IMPL_LINK(SvxMenuConfigPage, InsertHdl, const OString&, rIdent, void)
375 {
376  weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
377  if (rIdent == "insertseparator")
378  {
379  SvxConfigEntry* pNewEntryData = new SvxConfigEntry;
380  pNewEntryData->SetUserDefined();
381  int nPos = AppendEntry(pNewEntryData, -1);
382  InsertEntryIntoUI(pNewEntryData, rTreeView, nPos, true);
383  }
384  else if (rIdent == "insertsubmenu")
385  {
386  OUString aNewName;
387  OUString aDesc = CuiResId( RID_SVXSTR_SUBMENU_NAME );
388 
389  SvxNameDialog aNameDialog(GetFrameWeld(), aNewName, aDesc);
391  aNameDialog.set_title(CuiResId( RID_SVXSTR_ADD_SUBMENU));
392 
393  if (aNameDialog.run() == RET_OK)
394  {
395  aNewName = aNameDialog.GetName();
396 
397  SvxConfigEntry* pNewEntryData =
398  new SvxConfigEntry( aNewName, aNewName, true, /*bParentData*/false );
399  pNewEntryData->SetName( aNewName );
400  pNewEntryData->SetUserDefined();
401 
402  int nPos = AppendEntry(pNewEntryData, -1);
403  InsertEntryIntoUI(pNewEntryData, rTreeView, nPos, true);
404 
405  ReloadTopLevelListBox();
406 
407  m_xContentsListBox->scroll_to_row(nPos);
408  m_xContentsListBox->select(nPos);
409 
410  GetSaveInData()->SetModified();
411  }
412 
413  }
414  else
415  {
416  //This block should never be reached
417  SAL_WARN("cui.customize", "Unknown insert option: " << rIdent);
418  return;
419  }
420 
421  if ( GetSaveInData()->IsModified() )
422  {
423  UpdateButtonStates();
424  }
425 }
426 
427 IMPL_LINK(SvxMenuConfigPage, ModifyItemHdl, const OString&, rIdent, void)
428 {
429  if (rIdent == "renameItem")
430  {
431  int nActEntry = m_xContentsListBox->get_selected_index();
432  SvxConfigEntry* pEntry =
433  reinterpret_cast<SvxConfigEntry*>(m_xContentsListBox->get_id(nActEntry).toInt64());
434 
435  OUString aNewName( SvxConfigPageHelper::stripHotKey( pEntry->GetName() ) );
436  OUString aDesc = CuiResId( RID_SVXSTR_LABEL_NEW_NAME );
437 
438  SvxNameDialog aNameDialog(GetFrameWeld(), aNewName, aDesc);
440  aNameDialog.set_title(CuiResId(RID_SVXSTR_RENAME_MENU));
441 
442  if (aNameDialog.run() == RET_OK)
443  {
444  aNewName = aNameDialog.GetName();
445 
446  pEntry->SetName( aNewName );
447  m_xContentsListBox->set_text(nActEntry, aNewName, 0);
448 
449  GetSaveInData()->SetModified();
450  GetTopLevelSelection()->SetModified();
451  }
452  }
453  else
454  {
455  //This block should never be reached
456  SAL_WARN("cui.customize", "Unknown insert option: " << rIdent);
457  return;
458  }
459 
460  if ( GetSaveInData()->IsModified() )
461  {
462  UpdateButtonStates();
463  }
464 }
465 
467 {
468  SvxConfigEntry* pMenuData = GetTopLevelSelection();
469 
470  if (pMenuData == nullptr)
471  {
472  SAL_WARN("cui.customize", "RHB top level selection is null. A menu must be selected to reset!");
473  return;
474  }
475 
476  std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
477  VclMessageType::Question, VclButtonsType::YesNo,
478  CuiResId(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT_MENU)));
479 
480  // Resetting individual top-level menus is not possible at the moment.
481  // So we are resetting only if it is a context menu
482  if (m_bIsMenuBar || xQueryBox->run() != RET_YES)
483  return;
484 
485  sal_Int32 nPos = m_xTopLevelListBox->get_active();
486  ContextMenuSaveInData* pSaveInData = static_cast< ContextMenuSaveInData* >(GetSaveInData());
487 
488  pSaveInData->ResetContextMenu(pMenuData);
489 
490  // ensure that the UI is cleared before populating it
491  m_xTopLevelListBox->clear();
492  m_xContentsListBox->clear();
493 
494  ReloadTopLevelListBox();
495 
496  // Reselect the reset menu
497  m_xTopLevelListBox->set_active(nPos);
498  SelectElement();
499 }
500 
502  const css::uno::Reference< css::ui::XUIConfigurationManager >& xCfgMgr,
503  const css::uno::Reference< css::ui::XUIConfigurationManager >& xParentCfgMgr,
504  const OUString& aModuleId,
505  bool bDocConfig )
506 {
507  if ( !m_bIsMenuBar )
508  return static_cast< SaveInData* >( new ContextMenuSaveInData( xCfgMgr, xParentCfgMgr, aModuleId, bDocConfig ) );
509 
510  return static_cast< SaveInData* >( new MenuSaveInData( xCfgMgr, xParentCfgMgr, aModuleId, bDocConfig ) );
511 }
512 
513 IMPL_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 && reinterpret_cast<SvxConfigEntry*>(m_xContentsListBox->get_id(nSelectIndex).toInt64())->IsSeparator();
531  bool bIsValidSelection =
532  ( m_xContentsListBox->n_children() != 0 && nSelectIndex != -1 );
533 
534  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder( &rTreeView, "cui/ui/entrycontextmenu.ui" ) );
535  auto xContextMenu = xBuilder->weld_menu("menu");
536  xContextMenu->set_visible("add", false);
537  xContextMenu->set_visible("remove", bIsValidSelection);
538  xContextMenu->set_visible("rename", bIsValidSelection && !bIsSeparator);
539  xContextMenu->set_visible("changeIcon", false);
540  xContextMenu->set_visible("resetIcon", false);
541  xContextMenu->set_visible("restoreDefault", false);
542  OString sCommand(xContextMenu->popup_at_rect( &rTreeView, tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1) ) ) );
543 
544  if ( sCommand == "remove")
545  {
546  RemoveCommandHdl( *m_xRemoveCommandButton );
547  }
548  else if ( sCommand == "rename" )
549  {
550  ModifyItemHdl( "renameItem" );
551  }
552  else if ( !sCommand.isEmpty() )
553  SAL_WARN("cui.customize", "Unknown context menu action: " << sCommand );
554  return true;
555 }
556 
557 IMPL_LINK( SvxMenuConfigPage, FunctionContextMenuHdl, const CommandEvent&, rCEvt, bool )
558 {
559  if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
560  return false;
561 
562  weld::TreeView& rTreeView = m_xFunctions->get_widget();
563 
564  // Select clicked entry
565  std::unique_ptr<weld::TreeIter> xIter(rTreeView.make_iterator());
566  if (! rTreeView.get_dest_row_at_pos( rCEvt.GetMousePosPixel(), xIter.get(), false ))
567  return false;
568  rTreeView.select(*xIter);
569  SelectFunctionHdl( rTreeView );
570 
571  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder( &rTreeView, "cui/ui/entrycontextmenu.ui" ) );
572  auto xContextMenu = xBuilder->weld_menu("menu");
573  xContextMenu->set_visible("add", true);
574  xContextMenu->set_visible("remove", false);
575  xContextMenu->set_visible("rename", false);
576  xContextMenu->set_visible("changeIcon", false);
577  xContextMenu->set_visible("resetIcon", false);
578  xContextMenu->set_visible("restoreDefault", false);
579  OString sCommand(xContextMenu->popup_at_rect( &rTreeView, tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1) ) ) );
580 
581  if ( sCommand == "add")
582  {
583  AddCommandHdl( *m_xAddCommandButton );
584  }
585  else if ( !sCommand.isEmpty() )
586  SAL_WARN("cui.customize", "Unknown context menu action: " << sCommand );
587  return true;
588 }
589 
590  /* 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