LibreOffice Module sw (master)  1
workctrl.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 
22 #include <string_view>
23 
24 #include <i18nutil/unicode.hxx>
26 #include <sfx2/dispatch.hxx>
27 #include <sfx2/bindings.hxx>
28 #include <swmodule.hxx>
29 #include <view.hxx>
30 #include <initui.hxx>
31 #include <docsh.hxx>
32 #include <gloshdl.hxx>
33 #include <gloslst.hxx>
34 #include <workctrl.hxx>
35 #include <strings.hrc>
36 #include <cmdid.h>
37 #include <helpids.h>
38 #include <wrtsh.hxx>
41 #include <vcl/event.hxx>
42 #include <vcl/menu.hxx>
43 #include <vcl/settings.hxx>
44 #include <rtl/ustring.hxx>
45 #include <swabstdlg.hxx>
46 #include <sfx2/zoomitem.hxx>
47 #include <vcl/svapp.hxx>
48 #include <vcl/weldutils.hxx>
49 #include <svx/dialmgr.hxx>
50 #include <svx/strings.hrc>
51 #include <bitmaps.hlst>
53 #include <svx/srchdlg.hxx>
54 #include <com/sun/star/frame/XDispatchProvider.hpp>
55 #include <com/sun/star/frame/XFrame.hpp>
56 #include <com/sun/star/lang/XServiceInfo.hpp>
57 #include <com/sun/star/util/XURLTransformer.hpp>
58 
59 #include <sfx2/viewfrm.hxx>
60 
61 // Size check
62 #define NAVI_ENTRIES 21
63 
64 using namespace ::com::sun::star;
65 using namespace ::com::sun::star::uno;
66 using namespace ::com::sun::star::beans;
67 using namespace ::com::sun::star::frame;
68 
70 
72  sal_uInt16 nSlotId,
73  ToolBoxItemId nId,
74  ToolBox& rTbx ) :
75  SfxToolBoxControl( nSlotId, nId, rTbx )
76 {
77  rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits( nId ) );
78 }
79 
81 {
82 }
83 
85 {
86  SwView* pView = ::GetActiveView();
87  if(pView && !pView->GetDocShell()->IsReadOnly() &&
88  !pView->GetWrtShell().HasReadonlySel() )
89  {
90  Link<Menu*,bool> aLnk = LINK(this, SwTbxAutoTextCtrl, PopupHdl);
91 
94  const size_t nGroupCount = pGlossaryList->GetGroupCount();
95  for(size_t i = 1; i <= nGroupCount; ++i)
96  {
97  OUString sTitle = pGlossaryList->GetGroupTitle(i - 1);
98  const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i -1);
99  if(nBlockCount)
100  {
101  sal_uInt16 nIndex = o3tl::narrowing<sal_uInt16>(100*i);
102  // but insert without extension
103  pPopup->InsertItem( i, sTitle);
105  pSub->SetSelectHdl(aLnk);
106  pPopup->SetPopupMenu(i, pSub);
107  for(sal_uInt16 j = 0; j < nBlockCount; j++)
108  {
109  OUString sLongName(pGlossaryList->GetBlockLongName(i - 1, j));
110  OUString sShortName(pGlossaryList->GetBlockShortName(i - 1, j));
111 
112  OUString sEntry = sShortName + " - " + sLongName;
113  pSub->InsertItem(++nIndex, sEntry);
114  }
115  }
116  }
117 
118  ToolBox* pToolBox = &GetToolBox();
119  ToolBoxItemId nId = GetId();
120  pToolBox->SetItemDown( nId, true );
121 
122  pPopup->Execute( pToolBox, pToolBox->GetItemRect( nId ),
123  (pToolBox->GetAlign() == WindowAlign::Top || pToolBox->GetAlign() == WindowAlign::Bottom) ?
124  PopupMenuFlags::ExecuteDown : PopupMenuFlags::ExecuteRight );
125 
126  pToolBox->SetItemDown( nId, false );
127  }
129 }
130 
132  SfxItemState,
133  const SfxPoolItem* pState )
134 {
135  GetToolBox().EnableItem( GetId(), (GetItemState(pState) != SfxItemState::DISABLED) );
136 }
137 
138 IMPL_STATIC_LINK(SwTbxAutoTextCtrl, PopupHdl, Menu*, pMenu, bool)
139 {
140  sal_uInt16 nId = pMenu->GetCurItemId();
141 
142  sal_uInt16 nBlock = nId / 100;
143 
145  OUString sGroup = pGlossaryList->GetGroupName(nBlock - 1);
146  OUString sShortName =
147  pGlossaryList->GetBlockShortName(nBlock - 1, nId - (100 * nBlock) - 1);
148 
149  SwGlossaryHdl* pGlosHdl = ::GetActiveView()->GetGlosHdl();
151  ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc();
152  if ( fnSetActGroup )
153  (*fnSetActGroup)( sGroup );
154  pGlosHdl->SetCurGroup(sGroup, true);
155  pGlosHdl->InsertGlossary(sShortName);
156 
157  return false;
158 }
159 
160 // Navigation-Popup
161 // determine the order of the toolbox items
162 static sal_uInt16 aNavigationInsertIds[ NAVI_ENTRIES ] =
163 {
164  NID_TBL,
165  NID_FRM,
166  NID_GRF,
167  NID_OLE,
168  NID_PGE,
169  NID_OUTL,
170  NID_MARK,
171  NID_DRW,
172  NID_CTRL,
173  NID_REG,
174  NID_BKM,
175  NID_SEL,
176  NID_FTN,
177  NID_POSTIT,
178  NID_SRCH_REP,
182  NID_RECENCY,
183  NID_FIELD,
185 };
186 
187 std::u16string_view const aNavigationImgIds[ NAVI_ENTRIES ] =
188 {
189  u"" RID_BMP_RIBBAR_TBL,
190  u"" RID_BMP_RIBBAR_FRM,
191  u"" RID_BMP_RIBBAR_GRF,
192  u"" RID_BMP_RIBBAR_OLE,
193  u"" RID_BMP_RIBBAR_PGE,
194  u"" RID_BMP_RIBBAR_OUTL,
195  u"" RID_BMP_RIBBAR_MARK,
196  u"" RID_BMP_RIBBAR_DRW,
197  u"" RID_BMP_RIBBAR_CTRL,
198  u"" RID_BMP_RIBBAR_REG,
199  u"" RID_BMP_RIBBAR_BKM,
200  u"" RID_BMP_RIBBAR_SEL,
201  u"" RID_BMP_RIBBAR_FTN,
202  u"" RID_BMP_RIBBAR_POSTIT,
203  u"" RID_BMP_RIBBAR_REP,
204  u"" RID_BMP_RIBBAR_ENTRY,
205  u"" RID_BMP_RIBBAR_FORMULA,
206  u"" RID_BMP_RIBBAR_ERROR,
207  u"" RID_BMP_RIBBAR_RECENCY,
208  u"" RID_BMP_RIBBAR_FIELD,
209  u"" RID_BMP_RIBBAR_FIELD_BYTYPE
210 };
211 
213 {
214  ST_TBL,
215  ST_FRM,
216  ST_GRF,
217  ST_OLE,
218  ST_PGE,
219  ST_OUTL,
220  ST_MARK,
221  ST_DRW,
222  ST_CTRL,
223  ST_REG,
224  ST_BKM,
225  ST_SEL,
226  ST_FTN,
227  ST_POSTIT,
228  ST_SRCH_REP,
229  ST_INDEX_ENTRY,
230  ST_TABLE_FORMULA,
231  ST_TABLE_FORMULA_ERROR,
232  ST_RECENCY,
233  ST_FIELD,
234  ST_FIELD_BYTYPE
235 };
236 
237 // these are global strings
239 {
240  STR_IMGBTN_TBL_DOWN,
241  STR_IMGBTN_FRM_DOWN,
242  STR_IMGBTN_PGE_DOWN,
243  STR_IMGBTN_DRW_DOWN,
244  STR_IMGBTN_CTRL_DOWN,
245  STR_IMGBTN_REG_DOWN,
246  STR_IMGBTN_BKM_DOWN,
247  STR_IMGBTN_GRF_DOWN,
248  STR_IMGBTN_OLE_DOWN,
249  STR_IMGBTN_OUTL_DOWN,
250  STR_IMGBTN_SEL_DOWN,
251  STR_IMGBTN_FTN_DOWN,
252  STR_IMGBTN_MARK_DOWN,
253  STR_IMGBTN_POSTIT_DOWN,
254  STR_IMGBTN_SRCH_REP_DOWN,
255  STR_IMGBTN_INDEX_ENTRY_DOWN,
256  STR_IMGBTN_TBLFML_DOWN,
257  STR_IMGBTN_TBLFML_ERR_DOWN,
258  STR_IMGBTN_RECENCY_DOWN,
259  STR_IMGBTN_FIELD_DOWN,
260  STR_IMGBTN_FIELD_BYTYPE_DOWN,
261  STR_IMGBTN_TBL_UP,
262  STR_IMGBTN_FRM_UP,
263  STR_IMGBTN_PGE_UP,
264  STR_IMGBTN_DRW_UP,
265  STR_IMGBTN_CTRL_UP,
266  STR_IMGBTN_REG_UP,
267  STR_IMGBTN_BKM_UP,
268  STR_IMGBTN_GRF_UP,
269  STR_IMGBTN_OLE_UP,
270  STR_IMGBTN_OUTL_UP,
271  STR_IMGBTN_SEL_UP,
272  STR_IMGBTN_FTN_UP,
273  STR_IMGBTN_MARK_UP,
274  STR_IMGBTN_POSTIT_UP,
275  STR_IMGBTN_SRCH_REP_UP,
276  STR_IMGBTN_INDEX_ENTRY_UP,
277  STR_IMGBTN_TBLFML_UP,
278  STR_IMGBTN_TBLFML_ERR_UP,
279  STR_IMGBTN_RECENCY_UP,
280  STR_IMGBTN_FIELD_UP,
281  STR_IMGBTN_FIELD_BYTYPE_UP,
282 };
283 
284 static OUString lcl_GetScrollToolTip(bool bNext)
285 {
286  sal_uInt16 nResId = SwView::GetMoveType();
287  OUString sToolTip = SwResId(STR_IMGBTN_ARY[(!bNext ? NID_COUNT : 0) + nResId - NID_START]);
288  if (nResId == NID_FIELD_BYTYPE)
289  {
290  OUString sFieldType;
291  SwWrtShell* pWrtSh = GetActiveWrtShell();
292  if (pWrtSh)
293  {
294  SwField* pCurField = pWrtSh->GetCurField(true);
295  if (pCurField)
296  sFieldType = SwFieldType::GetTypeStr(pCurField->GetTypeId());
297  }
298  if (!sFieldType.isEmpty())
299  sToolTip = sToolTip.replaceFirst(u"%FIELDTYPE", sFieldType);
300  else
301  sToolTip = SwResId(SW_STR_NONE);
302  }
303  return sToolTip;
304 }
305 
306 namespace {
307 
308 class SwZoomBox_Impl final : public InterimItemWindow
309 {
310  std::unique_ptr<weld::ComboBox> m_xWidget;
311  sal_uInt16 nSlotId;
312  bool bRelease;
313 
314  DECL_LINK(SelectHdl, weld::ComboBox&, void);
315  DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
316  DECL_LINK(ActivateHdl, weld::ComboBox&, bool);
317  DECL_LINK(FocusOutHdl, weld::Widget&, void);
318 
319  void Select();
320 
321  void ReleaseFocus();
322 
323 public:
324  SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot);
325 
326  virtual void dispose() override
327  {
328  m_xWidget.reset();
330  }
331 
332  void save_value()
333  {
334  m_xWidget->save_value();
335  }
336 
337  void set_entry_text(const OUString& rText)
338  {
339  m_xWidget->set_entry_text(rText);
340  }
341 
342  virtual ~SwZoomBox_Impl() override
343  {
344  disposeOnce();
345  }
346 };
347 
348 }
349 
350 SwZoomBox_Impl::SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot)
351  : InterimItemWindow(pParent, "modules/swriter/ui/zoombox.ui", "ZoomBox")
352  , m_xWidget(m_xBuilder->weld_combo_box("zoom"))
353  , nSlotId(nSlot)
354  , bRelease(true)
355 {
356  InitControlBase(m_xWidget.get());
357 
358  m_xWidget->set_help_id(HID_PVIEW_ZOOM_LB);
359  m_xWidget->set_entry_completion(false);
360  m_xWidget->connect_changed(LINK(this, SwZoomBox_Impl, SelectHdl));
361  m_xWidget->connect_key_press(LINK(this, SwZoomBox_Impl, KeyInputHdl));
362  m_xWidget->connect_entry_activate(LINK(this, SwZoomBox_Impl, ActivateHdl));
363  m_xWidget->connect_focus_out(LINK(this, SwZoomBox_Impl, FocusOutHdl));
364 
365  const TranslateId aZoomValues[] =
366  { RID_SVXSTR_ZOOM_25 , RID_SVXSTR_ZOOM_50 ,
367  RID_SVXSTR_ZOOM_75 , RID_SVXSTR_ZOOM_100 ,
368  RID_SVXSTR_ZOOM_150 , RID_SVXSTR_ZOOM_200 ,
369  RID_SVXSTR_ZOOM_WHOLE_PAGE, RID_SVXSTR_ZOOM_PAGE_WIDTH ,
370  RID_SVXSTR_ZOOM_OPTIMAL_VIEW };
371  for(const TranslateId& pZoomValue : aZoomValues)
372  {
373  OUString sEntry = SvxResId(pZoomValue);
374  m_xWidget->append_text(sEntry);
375  }
376 
377  int nWidth = m_xWidget->get_pixel_size(SvxResId(RID_SVXSTR_ZOOM_200)).Width();
378  m_xWidget->set_entry_width_chars(std::ceil(nWidth / m_xWidget->get_approximate_digit_width()));
379 
380  SetSizePixel(m_xWidget->get_preferred_size());
381 }
382 
383 IMPL_LINK(SwZoomBox_Impl, SelectHdl, weld::ComboBox&, rComboBox, void)
384 {
385  if (rComboBox.changed_by_direct_pick()) // only when picked from the list
386  Select();
387 }
388 
389 IMPL_LINK_NOARG(SwZoomBox_Impl, ActivateHdl, weld::ComboBox&, bool)
390 {
391  Select();
392  return true;
393 }
394 
395 void SwZoomBox_Impl::Select()
396 {
397  if( FN_PREVIEW_ZOOM == nSlotId )
398  {
399  bool bNonNumeric = true;
400 
401  OUString sEntry = m_xWidget->get_active_text().replaceAll("%", "");
402  SvxZoomItem aZoom(SvxZoomType::PERCENT,100);
403  if(sEntry == SvxResId( RID_SVXSTR_ZOOM_PAGE_WIDTH ) )
404  aZoom.SetType(SvxZoomType::PAGEWIDTH);
405  else if(sEntry == SvxResId( RID_SVXSTR_ZOOM_OPTIMAL_VIEW ) )
406  aZoom.SetType(SvxZoomType::OPTIMAL);
407  else if(sEntry == SvxResId( RID_SVXSTR_ZOOM_WHOLE_PAGE) )
408  aZoom.SetType(SvxZoomType::WHOLEPAGE);
409  else
410  {
411  bNonNumeric = false;
412 
413  sal_uInt16 nZoom = o3tl::narrowing<sal_uInt16>(sEntry.toInt32());
414  if(nZoom < MINZOOM)
415  nZoom = MINZOOM;
416  if(nZoom > MAXZOOM)
417  nZoom = MAXZOOM;
418  aZoom.SetValue(nZoom);
419  }
420 
421  if (bNonNumeric)
422  {
423  // put old value back, in case its effectively the same
424  // as the picked option and no update to number comes
425  // back from writer
426  m_xWidget->set_entry_text(m_xWidget->get_saved_value());
427  }
428 
429  SfxObjectShell* pCurrentShell = SfxObjectShell::Current();
430 
431  pCurrentShell->GetDispatcher()->ExecuteList(SID_ATTR_ZOOM,
432  SfxCallMode::ASYNCHRON, { &aZoom });
433  }
434  ReleaseFocus();
435 }
436 
437 IMPL_LINK(SwZoomBox_Impl, KeyInputHdl, const KeyEvent&, rKEvt, bool)
438 {
439  bool bHandled = false;
440 
441  sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
442 
443  switch (nCode)
444  {
445  case KEY_TAB:
446  bRelease = false;
447  Select();
448  break;
449 
450  case KEY_ESCAPE:
451  m_xWidget->set_entry_text(m_xWidget->get_saved_value());
452  ReleaseFocus();
453  bHandled = true;
454  break;
455  }
456 
457  return bHandled || ChildKeyInput(rKEvt);
458 }
459 
460 IMPL_LINK_NOARG(SwZoomBox_Impl, FocusOutHdl, weld::Widget&, void)
461 {
462  if (!m_xWidget->has_focus()) // a combobox can be comprised of different subwidget so double-check if none of those has focus
463  m_xWidget->set_entry_text(m_xWidget->get_saved_value());
464 }
465 
466 void SwZoomBox_Impl::ReleaseFocus()
467 {
468  if ( !bRelease )
469  {
470  bRelease = true;
471  return;
472  }
474 
475  if ( pCurSh )
476  {
477  vcl::Window* pShellWnd = pCurSh->GetWindow();
478 
479  if ( pShellWnd )
480  pShellWnd->GrabFocus();
481  }
482 }
483 
485 
487  sal_uInt16 nSlotId,
488  ToolBoxItemId nId,
489  ToolBox& rTbx) :
490  SfxToolBoxControl( nSlotId, nId, rTbx )
491 {
492 }
493 
495 {
496 }
497 
499  SfxItemState eState,
500  const SfxPoolItem* pState )
501 {
502  ToolBoxItemId nId = GetId();
503  GetToolBox().EnableItem( nId, (GetItemState(pState) != SfxItemState::DISABLED) );
504  SwZoomBox_Impl* pBox = static_cast<SwZoomBox_Impl*>(GetToolBox().GetItemWindow( GetId() ));
505  if(SfxItemState::DEFAULT <= eState)
506  {
507  OUString sZoom(unicode::formatPercent(static_cast<const SfxUInt16Item*>(pState)->GetValue(),
508  Application::GetSettings().GetUILanguageTag()));
509  pBox->set_entry_text(sZoom);
510  pBox->save_value();
511  }
512 }
513 
515 {
516  VclPtrInstance<SwZoomBox_Impl> pRet( pParent, GetSlotId() );
517  return pRet.get();
518 }
519 
520 namespace {
521 
522 class SwJumpToSpecificBox_Impl final : public InterimItemWindow
523 {
524  std::unique_ptr<weld::Entry> m_xWidget;
525 
526  sal_uInt16 nSlotId;
527 
528  DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
529  DECL_LINK(SelectHdl, weld::Entry&, bool);
530 public:
531  SwJumpToSpecificBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot);
532  virtual void dispose() override
533  {
534  m_xWidget.reset();
536  }
537  virtual ~SwJumpToSpecificBox_Impl() override
538  {
539  disposeOnce();
540  }
541 };
542 
543 }
544 
545 IMPL_LINK(SwJumpToSpecificBox_Impl, KeyInputHdl, const KeyEvent&, rKEvt, bool)
546 {
547  return ChildKeyInput(rKEvt);
548 }
549 
550 SwJumpToSpecificBox_Impl::SwJumpToSpecificBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot)
551  : InterimItemWindow(pParent, "modules/swriter/ui/jumpposbox.ui", "JumpPosBox")
552  , m_xWidget(m_xBuilder->weld_entry("jumppos"))
553  , nSlotId(nSlot)
554 {
555  InitControlBase(m_xWidget.get());
556 
557  m_xWidget->connect_key_press(LINK(this, SwJumpToSpecificBox_Impl, KeyInputHdl));
558  m_xWidget->connect_activate(LINK(this, SwJumpToSpecificBox_Impl, SelectHdl));
559 
560  SetSizePixel(m_xWidget->get_preferred_size());
561 }
562 
563 IMPL_LINK_NOARG(SwJumpToSpecificBox_Impl, SelectHdl, weld::Entry&, bool)
564 {
565  OUString sEntry(m_xWidget->get_text());
566  SfxUInt16Item aPageNum(nSlotId);
567  aPageNum.SetValue(o3tl::narrowing<sal_uInt16>(sEntry.toInt32()));
568  SfxObjectShell* pCurrentShell = SfxObjectShell::Current();
569  pCurrentShell->GetDispatcher()->ExecuteList(nSlotId, SfxCallMode::ASYNCHRON,
570  { &aPageNum });
571  return true;
572 }
573 
575 
577  sal_uInt16 nSlotId,
578  ToolBoxItemId nId,
579  ToolBox& rTbx) :
580  SfxToolBoxControl( nSlotId, nId, rTbx )
581 {}
582 
584 {}
585 
587 {
589  return pRet.get();
590 }
591 
592 namespace {
593 
594 class NavElementBox_Base;
595 class NavElementBox_Impl;
596 
597 class NavElementToolBoxControl : public svt::ToolboxController,
598  public lang::XServiceInfo
599 {
600  public:
601  explicit NavElementToolBoxControl(
602  const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
603 
604  // XInterface
605  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
606  virtual void SAL_CALL acquire() noexcept override;
607  virtual void SAL_CALL release() noexcept override;
608 
609  // XServiceInfo
610  virtual OUString SAL_CALL getImplementationName() override;
611  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
612  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
613 
614  // XComponent
615  virtual void SAL_CALL dispose() override;
616 
617  // XStatusListener
618  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
619 
620  // XToolbarController
621  virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
622  virtual void SAL_CALL click() override;
623  virtual void SAL_CALL doubleClick() override;
624  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override;
625  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
626 
627  void dispatchCommand( const css::uno::Sequence< css::beans::PropertyValue >& rArgs );
628  using svt::ToolboxController::dispatchCommand;
629 
630  private:
631  VclPtr<NavElementBox_Impl> m_xVclBox;
632  std::unique_ptr<NavElementBox_Base> m_xWeldBox;
633  NavElementBox_Base* m_pBox;
634 };
635 
636 class NavElementBox_Base
637 {
638 public:
639  NavElementBox_Base(std::unique_ptr<weld::ComboBox> xWidget,
640  const uno::Reference<frame::XFrame>& _xFrame,
641  NavElementToolBoxControl& rCtrl);
642 
643  virtual ~NavElementBox_Base()
644  {
645  }
646 
647  void set_sensitive(bool bSensitive)
648  {
649  m_xWidget->set_sensitive(bSensitive);
650  }
651 
652  void UpdateBox();
653 
654 protected:
655  std::unique_ptr<weld::ComboBox> m_xWidget;
656  NavElementToolBoxControl* m_pCtrl;
657  bool m_bRelease;
658  uno::Reference< frame::XFrame > m_xFrame;
659 
660  virtual bool DoKeyInput(const KeyEvent& rKEvt);
661 
662  DECL_LINK(SelectHdl, weld::ComboBox&, void);
663  DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
664 
665  void ReleaseFocus_Impl();
666 };
667 
668 
669 class NavElementBox_Impl final : public InterimItemWindow
670  , public NavElementBox_Base
671 {
672 public:
673  NavElementBox_Impl(vcl::Window* pParent,
674  const uno::Reference<frame::XFrame>& _xFrame,
675  NavElementToolBoxControl& rCtrl);
676 
677  virtual void dispose() override
678  {
679  m_xWidget.reset();
681  }
682 
683  virtual void GetFocus() override
684  {
685  if (m_xWidget)
686  m_xWidget->grab_focus();
688  }
689 
690  virtual bool DoKeyInput(const KeyEvent& rKEvt) override;
691 
692  virtual ~NavElementBox_Impl() override
693  {
694  disposeOnce();
695  }
696 };
697 
698 }
699 
700 NavElementBox_Base::NavElementBox_Base(
701  std::unique_ptr<weld::ComboBox> xWidget,
702  const uno::Reference< frame::XFrame >& _xFrame,
703  NavElementToolBoxControl& _rCtrl )
704  : m_xWidget(std::move(xWidget))
705  , m_pCtrl(&_rCtrl)
706  , m_bRelease(true)
707  , m_xFrame(_xFrame)
708 {
709  m_xWidget->set_size_request(150, -1);
710 
711  m_xWidget->make_sorted();
712  m_xWidget->freeze();
713  for (sal_uInt16 i = 0; i < NID_COUNT; i++)
714  m_xWidget->append(OUString::number(aNavigationInsertIds[i]), SwResId(aNavigationStrIds[i]), OUString(aNavigationImgIds[i]));
715  m_xWidget->thaw();
716 
717  m_xWidget->connect_changed(LINK(this, NavElementBox_Base, SelectHdl));
718  m_xWidget->connect_key_press(LINK(this, NavElementBox_Base, KeyInputHdl));
719 }
720 
721 NavElementBox_Impl::NavElementBox_Impl(
722  vcl::Window* _pParent,
723  const uno::Reference< frame::XFrame >& _xFrame,
724  NavElementToolBoxControl& _rCtrl )
725  : InterimItemWindow(_pParent, "modules/swriter/ui/combobox.ui", "ComboBox")
726  , NavElementBox_Base(m_xBuilder->weld_combo_box("combobox"), _xFrame, _rCtrl)
727 {
728  SetSizePixel(m_xContainer->get_preferred_size());
729 }
730 
731 void NavElementBox_Base::ReleaseFocus_Impl()
732 {
733  if ( !m_bRelease )
734  {
735  m_bRelease = true;
736  return;
737  }
738 
739  if ( m_xFrame.is() && m_xFrame->getContainerWindow().is() )
740  m_xFrame->getContainerWindow()->setFocus();
741 }
742 
743 IMPL_LINK(NavElementBox_Base, SelectHdl, weld::ComboBox&, rComboBox, void)
744 {
745  if (!rComboBox.changed_by_direct_pick()) // only when picked from the list
746  return;
747 
748  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
749 
750  sal_uInt16 nMoveType = rComboBox.get_active_id().toUInt32();
751  SwView::SetMoveType( nMoveType );
752 
753  css::uno::Sequence< css::beans::PropertyValue > aArgs;
754  m_pCtrl->dispatchCommand( aArgs );
755 }
756 
757 void NavElementBox_Base::UpdateBox()
758 {
759  sal_uInt16 nMoveType = SwView::GetMoveType();
760  for ( size_t i = 0; i < SAL_N_ELEMENTS( aNavigationInsertIds ); ++i )
761  {
762  if ( nMoveType == aNavigationInsertIds[i] )
763  {
764  TranslateId id = aNavigationStrIds[i];
765  OUString sText = SwResId( id );
766  m_xWidget->set_active_text(sText);
767  break;
768  }
769  }
770 }
771 
772 IMPL_LINK(NavElementBox_Base, KeyInputHdl, const KeyEvent&, rKEvt, bool)
773 {
774  return DoKeyInput(rKEvt);
775 }
776 
777 bool NavElementBox_Base::DoKeyInput(const KeyEvent& rKEvt)
778 {
779  bool bHandled = false;
780 
781  vcl::KeyCode aKeyCode = rKEvt.GetKeyCode();
782  sal_uInt16 nCode = aKeyCode.GetCode();
783 
784  switch ( nCode )
785  {
786  case KEY_TAB:
787  {
788  m_bRelease = false;
789  SelectHdl(*m_xWidget);
790  break;
791  }
792  case KEY_RETURN:
793  {
794  m_bRelease = false;
795  SelectHdl(*m_xWidget);
796  break;
797  }
798  }
799 
800  return bHandled;
801 }
802 
803 bool NavElementBox_Impl::DoKeyInput(const KeyEvent& rKEvt)
804 {
805  if (KEY_ESCAPE == rKEvt.GetKeyCode().GetCode())
806  {
807  ReleaseFocus_Impl();
808  return true;
809  }
810  return NavElementBox_Base::DoKeyInput(rKEvt) || ChildKeyInput(rKEvt);
811 }
812 
813 
814 NavElementToolBoxControl::NavElementToolBoxControl( const uno::Reference< uno::XComponentContext >& rxContext )
815  : svt::ToolboxController( rxContext,
816  uno::Reference< frame::XFrame >(),
817  ".uno:NavElement" ),
818  m_pBox( nullptr )
819 {
820 }
821 
822 // XInterface
823 css::uno::Any SAL_CALL NavElementToolBoxControl::queryInterface( const css::uno::Type& aType )
824 {
825  uno::Any a = ToolboxController::queryInterface( aType );
826  if ( a.hasValue() )
827  return a;
828 
829  return ::cppu::queryInterface( aType, static_cast< lang::XServiceInfo* >( this ) );
830 }
831 
832 void SAL_CALL NavElementToolBoxControl::acquire() noexcept
833 {
834  ToolboxController::acquire();
835 }
836 
837 void SAL_CALL NavElementToolBoxControl::release() noexcept
838 {
839  ToolboxController::release();
840 }
841 
842 // XServiceInfo
843 sal_Bool SAL_CALL NavElementToolBoxControl::supportsService( const OUString& ServiceName )
844 {
845  return cppu::supportsService( this, ServiceName );
846 }
847 
848 OUString SAL_CALL NavElementToolBoxControl::getImplementationName()
849 {
850  return "lo.writer.NavElementToolBoxController";
851 }
852 
853 uno::Sequence< OUString > SAL_CALL NavElementToolBoxControl::getSupportedServiceNames()
854 {
855  return { "com.sun.star.frame.ToolbarController" };
856 }
857 
858 // XComponent
859 void SAL_CALL NavElementToolBoxControl::dispose()
860 {
862 
863  SolarMutexGuard aSolarMutexGuard;
864  m_xVclBox.disposeAndClear();
865  m_xWeldBox.reset();
866  m_pBox = nullptr;
867 }
868 
869 // XStatusListener
870 void SAL_CALL NavElementToolBoxControl::statusChanged( const frame::FeatureStateEvent& rEvent )
871 {
872  if (!m_pBox)
873  return;
874 
875  SolarMutexGuard aSolarMutexGuard;
876  if ( rEvent.FeatureURL.Path != "NavElement" )
877  return;
878 
879  if ( rEvent.IsEnabled )
880  {
881  m_pBox->set_sensitive(true);
882  m_pBox->UpdateBox();
883  }
884  else
885  m_pBox->set_sensitive(true);
886 
887  SwView* pView = GetActiveView();
888  if (pView && pView->GetViewFrame())
889  {
892  }
893 }
894 
895 // XToolbarController
896 void SAL_CALL NavElementToolBoxControl::execute( sal_Int16 /*KeyModifier*/ )
897 {
898 }
899 
900 void SAL_CALL NavElementToolBoxControl::click()
901 {
902 }
903 
904 void SAL_CALL NavElementToolBoxControl::doubleClick()
905 {
906 }
907 
908 uno::Reference< awt::XWindow > SAL_CALL NavElementToolBoxControl::createPopupWindow()
909 {
910  return uno::Reference< awt::XWindow >();
911 }
912 
913 uno::Reference< awt::XWindow > SAL_CALL NavElementToolBoxControl::createItemWindow(
914  const uno::Reference< awt::XWindow >& xParent )
915 {
916  uno::Reference< awt::XWindow > xItemWindow;
917 
918  if (m_pBuilder)
919  {
920  SolarMutexGuard aSolarMutexGuard;
921 
922  std::unique_ptr<weld::ComboBox> xWidget(m_pBuilder->weld_combo_box("NavElementWidget"));
923 
924  xItemWindow = css::uno::Reference<css::awt::XWindow>(new weld::TransportAsXWindow(xWidget.get()));
925 
926  m_xWeldBox.reset(new NavElementBox_Base(std::move(xWidget), m_xFrame, *this));
927  m_pBox = m_xWeldBox.get();
928  }
929  else
930  {
931  VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
932  if ( pParent )
933  {
934  SolarMutexGuard aSolarMutexGuard;
935  m_xVclBox = VclPtr<NavElementBox_Impl>::Create( pParent, m_xFrame, *this );
936  m_pBox = m_xVclBox.get();
937  xItemWindow = VCLUnoHelper::GetInterface(m_xVclBox);
938  }
939  }
940 
941  return xItemWindow;
942 }
943 
944 void NavElementToolBoxControl::dispatchCommand(
945  const uno::Sequence< beans::PropertyValue >& rArgs )
946 {
947  uno::Reference< frame::XDispatchProvider > xDispatchProvider( m_xFrame, uno::UNO_QUERY );
948  if ( xDispatchProvider.is() )
949  {
950  util::URL aURL;
951  uno::Reference< frame::XDispatch > xDispatch;
952  uno::Reference< util::XURLTransformer > xURLTransformer = getURLTransformer();
953 
954  aURL.Complete = ".uno:NavElement";
955  xURLTransformer->parseStrict( aURL );
956  xDispatch = xDispatchProvider->queryDispatch( aURL, OUString(), 0 );
957  if ( xDispatch.is() )
958  xDispatch->dispatch( aURL, rArgs );
959  }
960 }
961 
962 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
964  css::uno::XComponentContext *rxContext,
965  css::uno::Sequence<css::uno::Any> const &)
966 {
967  return cppu::acquire( new NavElementToolBoxControl( rxContext ) );
968 }
969 
970 namespace {
971 
972 class PrevNextScrollToolboxController : public svt::ToolboxController,
973  public css::lang::XServiceInfo
974 {
975 public:
976  enum Type { PREVIOUS, NEXT };
977 
978  PrevNextScrollToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, Type eType );
979 
980  // XInterface
981  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
982  virtual void SAL_CALL acquire() noexcept override;
983  virtual void SAL_CALL release() noexcept override;
984 
985  // XServiceInfo
986  virtual OUString SAL_CALL getImplementationName() override;
987  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
988  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
989 
990  // XComponent
991  virtual void SAL_CALL dispose() override;
992 
993  // XStatusListener
994  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
995 
996 private:
997  Type meType;
998 };
999 
1000 }
1001 
1002 PrevNextScrollToolboxController::PrevNextScrollToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, Type eType )
1003  : svt::ToolboxController( rxContext,
1004  css::uno::Reference< css::frame::XFrame >(),
1005  (eType == PREVIOUS) ? OUString( ".uno:ScrollToPrevious" ): OUString( ".uno:ScrollToNext" ) ),
1006  meType( eType )
1007 {
1008  addStatusListener(".uno:NavElement");
1009 }
1010 
1011 // XInterface
1012 css::uno::Any SAL_CALL PrevNextScrollToolboxController::queryInterface( const css::uno::Type& aType )
1013 {
1014  css::uno::Any a = ToolboxController::queryInterface( aType );
1015  if ( a.hasValue() )
1016  return a;
1017 
1018  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
1019 }
1020 
1021 void SAL_CALL PrevNextScrollToolboxController::acquire() noexcept
1022 {
1024 }
1025 
1026 void SAL_CALL PrevNextScrollToolboxController::release() noexcept
1027 {
1029 }
1030 
1031 // XServiceInfo
1032 OUString SAL_CALL PrevNextScrollToolboxController::getImplementationName()
1033 {
1034  return meType == PrevNextScrollToolboxController::PREVIOUS?
1035  OUString( "lo.writer.PreviousScrollToolboxController" ) :
1036  OUString( "lo.writer.NextScrollToolboxController" );
1037 }
1038 
1039 sal_Bool SAL_CALL PrevNextScrollToolboxController::supportsService( const OUString& ServiceName )
1040 {
1041  return cppu::supportsService(this, ServiceName);
1042 }
1043 
1044 css::uno::Sequence< OUString > SAL_CALL PrevNextScrollToolboxController::getSupportedServiceNames()
1045 {
1046  return { "com.sun.star.frame.ToolbarController" };
1047 }
1048 
1049 // XComponent
1051 {
1052  SolarMutexGuard aSolarMutexGuard;
1053 
1055 }
1056 
1057 // XStatusListener
1058 void SAL_CALL PrevNextScrollToolboxController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
1059 {
1060  if (rEvent.FeatureURL.Path == "NavElement")
1061  {
1062  if (m_pToolbar)
1063  m_pToolbar->set_item_tooltip_text(m_aCommandURL.toUtf8(), lcl_GetScrollToolTip(meType != PrevNextScrollToolboxController::PREVIOUS));
1064  else
1065  {
1066  ToolBox* pToolBox = nullptr;
1068  if (getToolboxId(nId, &pToolBox))
1069  pToolBox->SetQuickHelpText(nId, lcl_GetScrollToolTip(meType != PrevNextScrollToolboxController::PREVIOUS));
1070  }
1071  }
1072  else if (rEvent.FeatureURL.Path == "ScrollToPrevious" || rEvent.FeatureURL.Path == "ScrollToNext")
1073  {
1074  if (m_pToolbar)
1075  m_pToolbar->set_item_sensitive(m_aCommandURL.toUtf8(), rEvent.IsEnabled);
1076  else
1077  {
1078  ToolBox* pToolBox = nullptr;
1079  ToolBoxItemId nId;
1080  if (getToolboxId(nId, &pToolBox))
1081  pToolBox->EnableItem(nId, rEvent.IsEnabled);
1082  }
1083  }
1084 }
1085 
1086 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1088  css::uno::XComponentContext *context,
1089  css::uno::Sequence<css::uno::Any> const &)
1090 {
1091  return cppu::acquire( new PrevNextScrollToolboxController( context, PrevNextScrollToolboxController::PREVIOUS ) );
1092 }
1093 
1094 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1096  css::uno::XComponentContext *context,
1097  css::uno::Sequence<css::uno::Any> const &)
1098 {
1099  return cppu::acquire( new PrevNextScrollToolboxController( context, PrevNextScrollToolboxController::NEXT ) );
1100 }
1101 
1102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxViewFrame * GetViewFrame() const
#define MAXZOOM
Definition: view.hxx:81
Type
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
#define MINZOOM
Definition: view.hxx:80
URL aURL
sal_uInt16 GetBlockCount(size_t nGroup)
Definition: gloslst.cxx:198
bool hasValue()
sal_Int32 nIndex
#define NID_GRF
Definition: workctrl.hxx:38
#define NID_POSTIT
Definition: workctrl.hxx:44
static sal_uInt16 GetMoveType()
Definition: viewmdi.cxx:691
#define HID_PVIEW_ZOOM_LB
Definition: helpids.h:123
virtual void SAL_CALL dispose() override
virtual ~SwTbxAutoTextCtrl() override
Definition: workctrl.cxx:80
ToolBoxItemBits GetItemBits(ToolBoxItemId nItemId) const
SwView * GetActiveView()
Definition: swmodul1.cxx:116
vcl::Window * GetItemWindow(ToolBoxItemId nItemId) const
#define NID_BKM
Definition: workctrl.hxx:37
#define FN_PREVIEW_ZOOM
Definition: cmdid.h:173
std::string GetValue
#define NID_MARK
Definition: workctrl.hxx:43
ToolBox & GetToolBox() const
void(* GlossarySetActGroup)(const OUString &rNewGroup)
Definition: swabstdlg.hxx:86
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * lo_writer_NextScrollToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: workctrl.cxx:1095
#define NID_SEL
Definition: workctrl.hxx:41
virtual void SAL_CALL acquire() noexcept override
virtual std::unique_ptr< ComboBox > weld_combo_box(const OString &id)=0
static const AllSettings & GetSettings()
Base class of all fields.
Definition: fldbas.hxx:289
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
css::uno::Reference< css::lang::XComponent > m_xFrame
#define NID_TABLE_FORMULA
Definition: workctrl.hxx:47
weld::Builder * m_pBuilder
Reference
sal_Int16 nId
#define NID_OUTL
Definition: workctrl.hxx:40
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
sal_uInt16 GetCode() const
size_t GetGroupCount()
Definition: gloslst.cxx:168
sal_uInt16 Execute(vcl::Window *pWindow, const Point &rPopupPos)
static SfxObjectShell * Current()
void Invalidate(sal_uInt16 nId)
SwJumpToSpecificPageControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
Definition: workctrl.cxx:576
static const OUString & GetTypeStr(SwFieldTypesEnum nTypeId)
Definition: fldbas.cxx:122
tools::Rectangle GetItemRect(ToolBoxItemId nItemId)
IMPL_STATIC_LINK(SwTbxAutoTextCtrl, PopupHdl, Menu *, pMenu, bool)
Definition: workctrl.cxx:138
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: workctrl.cxx:131
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
#define NID_SRCH_REP
Definition: workctrl.hxx:45
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * lo_writer_NavElementToolBoxController_get_implementation(css::uno::XComponentContext *rxContext, css::uno::Sequence< css::uno::Any > const &)
Definition: workctrl.cxx:963
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
virtual ~SwJumpToSpecificPageControl() override
Definition: workctrl.cxx:583
Reference< XNameAccess > m_xContainer
void SetItemDown(ToolBoxItemId nItemId, bool bDown)
virtual void CreatePopupWindow() override
Definition: workctrl.cxx:84
exports com.sun.star. frame
PREVIOUS
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
Definition: crstrvl.cxx:908
void SetItemBits(ToolBoxItemId nItemId, ToolBoxItemBits nBits)
OUString SvxResId(TranslateId aId)
virtual void GetFocus() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
static SfxViewShell * Current()
bool getToolboxId(ToolBoxItemId &rItemId, ToolBox **ppToolBox)
void SetCurGroup(const OUString &aGrp, bool bApi=false, bool bAlwaysCreateNew=false)
Definition: gloshdl.cxx:93
virtual void SAL_CALL release() noexcept override
OUString GetBlockLongName(size_t nGroup, sal_uInt16 nBlock)
Definition: gloslst.cxx:209
OUString GetGroupName(size_t nPos)
Definition: gloslst.cxx:175
OUString GetBlockShortName(size_t nGroup, sal_uInt16 nBlock)
Definition: gloslst.cxx:220
void addStatusListener(const OUString &aCommandURL)
sal_uInt16 nCode
#define NAVI_ENTRIES
Definition: workctrl.cxx:62
void SetPopupMenu(sal_uInt16 nItemId, PopupMenu *pMenu)
#define SAL_N_ELEMENTS(arr)
std::u16string_view const aNavigationImgIds[NAVI_ENTRIES]
Definition: workctrl.cxx:187
static sal_uInt16 aNavigationInsertIds[NAVI_ENTRIES]
Definition: workctrl.cxx:162
void SetSelectHdl(const Link< Menu *, bool > &rLink)
void EndSelection()
SfxDispatcher * GetDispatcher() const
int i
#define NID_INDEX_ENTRY
Definition: workctrl.hxx:46
#define NID_START
Definition: workctrl.hxx:30
uno_Any a
OUString GetGroupTitle(size_t nPos)
Definition: gloslst.cxx:187
DECL_LINK(DoLayout, Timer *, void)
static OUString lcl_GetScrollToolTip(bool bNext)
Definition: workctrl.cxx:284
void SetQuickHelpText(ToolBoxItemId nItemId, const OUString &rText)
SwPreviewZoomControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
Definition: workctrl.cxx:486
static SwGlossaryList * pGlossaryList
Definition: initui.cxx:41
virtual ~SwPreviewZoomControl() override
Definition: workctrl.cxx:494
SfxBindings & GetBindings()
float u
unsigned char sal_Bool
#define FN_SCROLL_NEXT
Definition: cmdid.h:181
#define NID_REG
Definition: workctrl.hxx:36
#define NID_TABLE_FORMULA_ERROR
Definition: workctrl.hxx:48
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
#define FN_SCROLL_PREV
Definition: cmdid.h:180
#define NID_FTN
Definition: workctrl.hxx:42
static void SetMoveType(sal_uInt16 nSet)
Definition: viewmdi.cxx:696
#define NID_RECENCY
Definition: workctrl.hxx:49
bool HasReadonlySel() const
Definition: crsrsh.cxx:3346
void GrabFocus()
SwTbxAutoTextCtrl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
Definition: workctrl.cxx:71
static void SetSearchLabel(const SearchLabel &rSL)
virtual VclPtr< InterimItemWindow > CreateItemWindow(vcl::Window *pParent) override
Definition: workctrl.cxx:586
#define NID_DRW
Definition: workctrl.hxx:34
SwDocShell * GetDocShell()
Definition: view.cxx:1127
SFX_IMPL_TOOLBOX_CONTROL(SwTbxAutoTextCtrl, SfxVoidItem)
bool IsReadOnly() const
constexpr sal_uInt16 KEY_RETURN
void EnableItem(ToolBoxItemId nItemId, bool bEnable=true)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * lo_writer_PreviousScrollToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: workctrl.cxx:1087
static SfxItemState GetItemState(const SfxPoolItem *pState)
NEXT
#define NID_OLE
Definition: workctrl.hxx:39
void InsertItem(sal_uInt16 nItemId, const OUString &rStr, MenuItemBits nItemBits=MenuItemBits::NONE, const OString &rIdent=OString(), sal_uInt16 nPos=MENU_APPEND)
SwFieldTypesEnum GetTypeId() const
Definition: fldbas.cxx:252
bool InsertGlossary(const OUString &rName)
Definition: gloshdl.cxx:488
const vcl::KeyCode & GetKeyCode() const
#define NID_PGE
Definition: workctrl.hxx:33
#define NID_CTRL
Definition: workctrl.hxx:35
Reference< XDispatch > xDispatch
static OUString formatPercent(double dNumber, const LanguageTag &rLangTag)
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: workctrl.cxx:498
SfxItemState
#define NID_TBL
Definition: workctrl.hxx:31
IMPL_LINK_NOARG(SwZoomBox_Impl, ActivateHdl, weld::ComboBox &, bool)
Definition: workctrl.cxx:389
const TranslateId STR_IMGBTN_ARY[]
Definition: workctrl.cxx:238
constexpr sal_uInt16 KEY_ESCAPE
virtual void dispose() override
WindowAlign GetAlign() const
ToolBoxItemId GetId() const
static VclPtr< reference_type > Create(Arg &&...arg)
unsigned short GetSlotId() const
vcl::Window * GetWindow() const
css::uno::Reference< css::frame::XFrame > m_xFrame
SwGlossaryHdl * GetGlosHdl()
Definition: view.cxx:1641
reference_type * get() const
virtual VclPtr< InterimItemWindow > CreateItemWindow(vcl::Window *pParent) override
Definition: workctrl.cxx:514
#define NID_FIELD_BYTYPE
Definition: workctrl.hxx:51
const TranslateId aNavigationStrIds[NAVI_ENTRIES]
Definition: workctrl.cxx:212
std::unique_ptr< weld::Image > m_xWidget
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
virtual GlossarySetActGroup SetGlossaryActGroupFunc()=0
#define NID_FRM
Definition: workctrl.hxx:32
#define NID_COUNT
Definition: workctrl.hxx:52
RedlineType meType
Definition: view.hxx:144
constexpr sal_uInt16 KEY_TAB
#define NID_FIELD
Definition: workctrl.hxx:50
IMPL_LINK(SwZoomBox_Impl, SelectHdl, weld::ComboBox &, rComboBox, void)
Definition: workctrl.cxx:383
SwGlossaryList * GetGlossaryList()
Definition: initui.cxx:174