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 <string>
21 #include <i18nutil/unicode.hxx>
22 #include <svl/eitem.hxx>
23 #include <sfx2/htmlmode.hxx>
24 #include <sfx2/dispatch.hxx>
25 #include <sfx2/bindings.hxx>
26 #include <sfx2/msgpool.hxx>
27 #include <swmodule.hxx>
28 #include <view.hxx>
29 #include <initui.hxx>
30 #include <viewopt.hxx>
31 #include <docsh.hxx>
32 #include <gloshdl.hxx>
33 #include <glosdoc.hxx>
34 #include <gloslst.hxx>
35 #include <workctrl.hxx>
36 #include <strings.hrc>
37 #include <cmdid.h>
38 #include <helpids.h>
39 #include <wrtsh.hxx>
42 #include <svl/imageitm.hxx>
43 #include <vcl/event.hxx>
44 #include <vcl/fixed.hxx>
45 #include <vcl/lstbox.hxx>
46 #include <vcl/settings.hxx>
47 #include <rtl/ustring.hxx>
48 #include <swabstdlg.hxx>
49 #include <sfx2/zoomitem.hxx>
50 #include <vcl/field.hxx>
51 #include <vcl/svapp.hxx>
52 #include <svx/dialmgr.hxx>
53 #include <svx/dialogs.hrc>
54 #include <svx/strings.hrc>
55 #include <bitmaps.hlst>
57 #include <svx/srchdlg.hxx>
58 #include <com/sun/star/frame/XDispatchProvider.hpp>
59 #include <com/sun/star/frame/XFrame.hpp>
60 #include <com/sun/star/lang/XServiceInfo.hpp>
61 #include <com/sun/star/util/XURLTransformer.hpp>
62 
63 // Size check
64 #define NAVI_ENTRIES 20
65 #if NAVI_ENTRIES != NID_COUNT
66 #error SwScrollNaviPopup-CTOR static array wrong size. Are new IDs added?
67 #endif
68 
69 using namespace ::com::sun::star;
70 using namespace ::com::sun::star::uno;
71 using namespace ::com::sun::star::beans;
72 using namespace ::com::sun::star::frame;
73 
75 
77  sal_uInt16 nSlotId,
78  sal_uInt16 nId,
79  ToolBox& rTbx ) :
80  SfxToolBoxControl( nSlotId, nId, rTbx )
81 {
82  rTbx.SetItemBits( nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits( nId ) );
83 }
84 
86 {
87 }
88 
90 {
91  SwView* pView = ::GetActiveView();
92  if(pView && !pView->GetDocShell()->IsReadOnly() &&
93  !pView->GetWrtShell().HasReadonlySel() )
94  {
95  Link<Menu*,bool> aLnk = LINK(this, SwTbxAutoTextCtrl, PopupHdl);
96 
99  const size_t nGroupCount = pGlossaryList->GetGroupCount();
100  for(size_t i = 1; i <= nGroupCount; ++i)
101  {
102  OUString sTitle = pGlossaryList->GetGroupTitle(i - 1);
103  const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i -1);
104  if(nBlockCount)
105  {
106  sal_uInt16 nIndex = static_cast<sal_uInt16>(100*i);
107  // but insert without extension
108  pPopup->InsertItem( i, sTitle);
110  pSub->SetSelectHdl(aLnk);
111  pPopup->SetPopupMenu(i, pSub);
112  for(sal_uInt16 j = 0; j < nBlockCount; j++)
113  {
114  OUString sLongName(pGlossaryList->GetBlockLongName(i - 1, j));
115  OUString sShortName(pGlossaryList->GetBlockShortName(i - 1, j));
116 
117  OUString sEntry = sShortName + " - " + sLongName;
118  pSub->InsertItem(++nIndex, sEntry);
119  }
120  }
121  }
122 
123  ToolBox* pToolBox = &GetToolBox();
124  sal_uInt16 nId = GetId();
125  pToolBox->SetItemDown( nId, true );
126 
127  pPopup->Execute( pToolBox, pToolBox->GetItemRect( nId ),
128  (pToolBox->GetAlign() == WindowAlign::Top || pToolBox->GetAlign() == WindowAlign::Bottom) ?
129  PopupMenuFlags::ExecuteDown : PopupMenuFlags::ExecuteRight );
130 
131  pToolBox->SetItemDown( nId, false );
132  }
134  return nullptr;
135 }
136 
138  SfxItemState,
139  const SfxPoolItem* pState )
140 {
141  GetToolBox().EnableItem( GetId(), (GetItemState(pState) != SfxItemState::DISABLED) );
142 }
143 
144 IMPL_STATIC_LINK(SwTbxAutoTextCtrl, PopupHdl, Menu*, pMenu, bool)
145 {
146  sal_uInt16 nId = pMenu->GetCurItemId();
147 
148  sal_uInt16 nBlock = nId / 100;
149 
151  OUString sGroup = pGlossaryList->GetGroupName(nBlock - 1);
152  OUString sShortName =
153  pGlossaryList->GetBlockShortName(nBlock - 1, nId - (100 * nBlock) - 1);
154 
155  SwGlossaryHdl* pGlosHdl = ::GetActiveView()->GetGlosHdl();
157  ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc();
158  if ( fnSetActGroup )
159  (*fnSetActGroup)( sGroup );
160  pGlosHdl->SetCurGroup(sGroup, true);
161  pGlosHdl->InsertGlossary(sShortName);
162 
163  return false;
164 }
165 
166 // Navigation-Popup
167 // determine the order of the toolbox items
168 static sal_uInt16 aNavigationInsertIds[ NAVI_ENTRIES ] =
169 {
170  // -- first line
171  NID_TBL,
172  NID_FRM,
173  NID_GRF,
174  NID_OLE,
175  NID_PGE,
176  NID_OUTL,
177  NID_MARK,
178  NID_DRW,
179  NID_CTRL,
180  NID_PREV,
181  // -- second line
182  NID_REG,
183  NID_BKM,
184  NID_SEL,
185  NID_FTN,
186  NID_POSTIT,
187  NID_SRCH_REP,
191  NID_NEXT
192 };
193 
194 static OUStringLiteral const aNavigationImgIds[ NAVI_ENTRIES ] =
195 {
196  // -- first line
197  RID_BMP_RIBBAR_TBL,
198  RID_BMP_RIBBAR_FRM,
199  RID_BMP_RIBBAR_GRF,
200  RID_BMP_RIBBAR_OLE,
201  RID_BMP_RIBBAR_PGE,
202  RID_BMP_RIBBAR_OUTL,
203  RID_BMP_RIBBAR_MARK,
204  RID_BMP_RIBBAR_DRW,
205  RID_BMP_RIBBAR_CTRL,
206  RID_BMP_RIBBAR_PREV,
207  // -- second line
208  RID_BMP_RIBBAR_REG,
209  RID_BMP_RIBBAR_BKM,
210  RID_BMP_RIBBAR_SEL,
211  RID_BMP_RIBBAR_FTN,
212  RID_BMP_RIBBAR_POSTIT,
213  RID_BMP_RIBBAR_REP,
214  RID_BMP_RIBBAR_ENTRY,
215  RID_BMP_RIBBAR_FORMULA,
216  RID_BMP_RIBBAR_ERROR,
217  RID_BMP_RIBBAR_NEXT
218 };
219 
220 static const char* aNavigationHelpIds[ NAVI_ENTRIES ] =
221 {
222  // -- first line
223  HID_NID_TBL,
224  HID_NID_FRM,
225  HID_NID_GRF,
226  HID_NID_OLE,
227  HID_NID_PGE,
228  HID_NID_OUTL,
229  HID_NID_MARK,
230  HID_NID_DRW,
231  HID_NID_CTRL,
232  HID_NID_PREV,
233  // -- second line
234  HID_NID_REG,
235  HID_NID_BKM,
236  HID_NID_SEL,
237  HID_NID_FTN,
244 };
245 
246 static const char* aNavigationStrIds[ NAVI_ENTRIES ] =
247 {
248  // -- first line
249  ST_TBL,
250  ST_FRM,
251  ST_GRF,
252  ST_OLE,
253  ST_PGE,
254  ST_OUTL,
255  ST_MARK,
256  ST_DRW,
257  ST_CTRL,
258  STR_IMGBTN_PGE_UP,
259  // -- second line
260  ST_REG,
261  ST_BKM,
262  ST_SEL,
263  ST_FTN,
264  ST_POSTIT,
265  ST_SRCH_REP,
266  ST_INDEX_ENTRY,
267  ST_TABLE_FORMULA,
268  ST_TABLE_FORMULA_ERROR,
269  STR_IMGBTN_PGE_DOWN
270 };
271 
272 // these are global strings
273 static const char* STR_IMGBTN_ARY[] =
274 {
275  nullptr,
276  nullptr,
277  STR_IMGBTN_TBL_DOWN,
278  STR_IMGBTN_FRM_DOWN,
279  STR_IMGBTN_PGE_DOWN,
280  STR_IMGBTN_DRW_DOWN,
281  STR_IMGBTN_CTRL_DOWN,
282  STR_IMGBTN_REG_DOWN,
283  STR_IMGBTN_BKM_DOWN,
284  STR_IMGBTN_GRF_DOWN,
285  STR_IMGBTN_OLE_DOWN,
286  STR_IMGBTN_OUTL_DOWN,
287  STR_IMGBTN_SEL_DOWN,
288  STR_IMGBTN_FTN_DOWN,
289  STR_IMGBTN_MARK_DOWN,
290  STR_IMGBTN_POSTIT_DOWN,
291  STR_IMGBTN_SRCH_REP_DOWN,
292  STR_IMGBTN_INDEX_ENTRY_DOWN,
293  STR_IMGBTN_TBLFML_DOWN,
294  STR_IMGBTN_TBLFML_ERR_DOWN,
295  nullptr,
296  nullptr,
297  STR_IMGBTN_TBL_UP,
298  STR_IMGBTN_FRM_UP,
299  STR_IMGBTN_PGE_UP,
300  STR_IMGBTN_DRW_UP,
301  STR_IMGBTN_CTRL_UP,
302  STR_IMGBTN_REG_UP,
303  STR_IMGBTN_BKM_UP,
304  STR_IMGBTN_GRF_UP,
305  STR_IMGBTN_OLE_UP,
306  STR_IMGBTN_OUTL_UP,
307  STR_IMGBTN_SEL_UP,
308  STR_IMGBTN_FTN_UP,
309  STR_IMGBTN_MARK_UP,
310  STR_IMGBTN_POSTIT_UP,
311  STR_IMGBTN_SRCH_REP_UP,
312  STR_IMGBTN_INDEX_ENTRY_UP,
313  STR_IMGBTN_TBLFML_UP,
314  STR_IMGBTN_TBLFML_ERR_UP
315 };
316 
317 SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >& rFrame, vcl::Window *pParent)
318  : SfxPopupWindow(nId, pParent, "FloatingNavigation",
319  "modules/swriter/ui/floatingnavigation.ui", rFrame)
320 {
321  m_pToolBox = VclPtr<SwScrollNaviToolBox>::Create(get<vcl::Window>("box"), this, 0);
322  get(m_pInfoField, "label");
323 
324  size_t i;
325 
327  m_pToolBox->SetLineCount( 2 );
329  for( i = 0; i < NID_COUNT; i++)
330  {
331  sal_uInt16 nNaviId = aNavigationInsertIds[i];
332  ToolBoxItemBits nTbxBits = ToolBoxItemBits::NONE;
333  if ((NID_PREV != nNaviId) && (NID_NEXT != nNaviId))
334  nTbxBits = ToolBoxItemBits::CHECKABLE;
335  m_pToolBox->InsertItem(nNaviId, Image(StockImage::Yes, aNavigationImgIds[i]),
336  SwResId(aNavigationStrIds[i]), nTbxBits);
338  }
339 
340  m_pToolBox->InsertBreak(NID_COUNT/2);
341 
342  for (i = 0; i < SAL_N_ELEMENTS(STR_IMGBTN_ARY); ++i)
343  {
344  const char* id = STR_IMGBTN_ARY[i];
345  if (!id)
346  continue;
347  sQuickHelp[i] = SwResId(id);
348  }
349 
350  sal_uInt16 nItemId = SwView::GetMoveType();
352  m_pToolBox->CheckItem( nItemId );
353 
354  m_pToolBox->SetSelectHdl(LINK(this, SwScrollNaviPopup, SelectHdl));
356  m_pToolBox->Show();
357 
358  AddStatusListener(".uno:NavElement");
359 }
360 
362 {
363  disposeOnce();
364 }
365 
367 {
371 }
372 
373 IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet, void)
374 {
375  sal_uInt16 nSet = pSet->GetCurItemId();
376  if( nSet != NID_PREV && nSet != NID_NEXT )
377  {
378  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
379  SwView::SetMoveType( nSet );
380  Sequence< PropertyValue > aArgs;
381  SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( GetFrame()->getController(), UNO_QUERY ),
382  ".uno:NavElement", aArgs );
383  }
384  else
385  {
386  Sequence< PropertyValue > aArgs;
387  OUString cmd(".uno:ScrollToPrevious");
388  if (NID_NEXT == nSet)
389  cmd = ".uno:ScrollToNext";
390  SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( GetFrame()->getController(), UNO_QUERY ),
391  cmd, aArgs );
392  }
393 }
394 
396 {
397  disposeOnce();
398 }
399 
401 {
404 }
405 
407 {
408  ToolBox::MouseButtonUp(rMEvt);
409  if (m_pNaviPopup->IsInPopupMode())
410  m_pNaviPopup->EndPopupMode(FloatWinPopupEndFlags::CloseAll);
411 }
412 
414 {
417  ToolBox::RequestHelp( rHEvt );
418 }
419 
420 OUString SwScrollNaviPopup::GetToolTip(bool bNext)
421 {
422  sal_uInt16 nResId = SwView::GetMoveType();
423  if (!bNext)
424  nResId += NID_COUNT;
425  const char* id = STR_IMGBTN_ARY[nResId - NID_START];
426  return id ? SwResId(id): OUString();
427 }
428 
429 void SwScrollNaviPopup::statusChanged( const css::frame::FeatureStateEvent& rEvent )
430 {
431  if ( rEvent.FeatureURL.Path == "NavElement" )
432  {
433  sal_uInt16 nSet = SwView::GetMoveType();
437  // check the current button only
438  for( ToolBox::ImplToolItems::size_type i = 0; i < NID_COUNT; i++ )
439  {
440  sal_uInt16 nItemId = m_pToolBox->GetItemId( i );
441  m_pToolBox->CheckItem( nItemId, nItemId == nSet );
442  }
443  }
444 }
445 
446 namespace {
447 
448 class SwZoomBox_Impl : public ComboBox
449 {
450  sal_uInt16 const nSlotId;
451  bool bRelease;
452 
453 public:
454  SwZoomBox_Impl(
455  vcl::Window* pParent,
456  sal_uInt16 nSlot );
457 
458 protected:
459  virtual void Select() override;
460  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
461 
462  void ReleaseFocus();
463 
464 };
465 
466 }
467 
468 SwZoomBox_Impl::SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot)
470  , nSlotId(nSlot)
471  , bRelease(true)
472 {
473  SetHelpId(HID_PVIEW_ZOOM_LB);
474  SetSizePixel(LogicToPixel(Size(30, 86), MapMode(MapUnit::MapAppFont)));
475  EnableAutocomplete( false );
476  const char* const aZoomValues[] =
477  { RID_SVXSTR_ZOOM_25 , RID_SVXSTR_ZOOM_50 ,
478  RID_SVXSTR_ZOOM_75 , RID_SVXSTR_ZOOM_100 ,
479  RID_SVXSTR_ZOOM_150 , RID_SVXSTR_ZOOM_200 ,
480  RID_SVXSTR_ZOOM_WHOLE_PAGE, RID_SVXSTR_ZOOM_PAGE_WIDTH ,
481  RID_SVXSTR_ZOOM_OPTIMAL_VIEW };
482  for(const char* pZoomValue : aZoomValues)
483  {
484  OUString sEntry = SvxResId(pZoomValue);
485  InsertEntry(sEntry);
486  }
487 }
488 
489 void SwZoomBox_Impl::Select()
490 {
491  if ( !IsTravelSelect() )
492  {
493  OUString sEntry = GetText().replaceAll("%", "");
494  SvxZoomItem aZoom(SvxZoomType::PERCENT,100);
495  if(sEntry == SvxResId( RID_SVXSTR_ZOOM_PAGE_WIDTH ) )
496  aZoom.SetType(SvxZoomType::PAGEWIDTH);
497  else if(sEntry == SvxResId( RID_SVXSTR_ZOOM_OPTIMAL_VIEW ) )
498  aZoom.SetType(SvxZoomType::OPTIMAL);
499  else if(sEntry == SvxResId( RID_SVXSTR_ZOOM_WHOLE_PAGE) )
500  aZoom.SetType(SvxZoomType::WHOLEPAGE);
501  else
502  {
503  sal_uInt16 nZoom = static_cast<sal_uInt16>(sEntry.toInt32());
504  if(nZoom < MINZOOM)
505  nZoom = MINZOOM;
506  if(nZoom > MAXZOOM)
507  nZoom = MAXZOOM;
508  aZoom.SetValue(nZoom);
509  }
510  if( FN_PREVIEW_ZOOM == nSlotId )
511  {
512  SfxObjectShell* pCurrentShell = SfxObjectShell::Current();
513 
514  pCurrentShell->GetDispatcher()->ExecuteList(SID_ATTR_ZOOM,
515  SfxCallMode::ASYNCHRON, { &aZoom });
516  }
517  ReleaseFocus();
518  }
519 }
520 
521 bool SwZoomBox_Impl::EventNotify( NotifyEvent& rNEvt )
522 {
523  bool bHandled = false;
524 
525  if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
526  {
527  sal_uInt16 nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
528 
529  switch ( nCode )
530  {
531  case KEY_RETURN:
532  case KEY_TAB:
533  {
534  if ( KEY_TAB == nCode )
535  bRelease = false;
536  else
537  bHandled = true;
538  Select();
539  break;
540  }
541 
542  case KEY_ESCAPE:
543  SetText( GetSavedValue() );
544  ReleaseFocus();
545  break;
546  }
547  }
548  else if ( MouseNotifyEvent::LOSEFOCUS == rNEvt.GetType() )
549  {
551  if ( !HasFocus() && GetSubEdit() != pFocusWin )
552  SetText( GetSavedValue() );
553  }
554 
555  return bHandled || ComboBox::EventNotify(rNEvt);
556 }
557 
558 void SwZoomBox_Impl::ReleaseFocus()
559 {
560  if ( !bRelease )
561  {
562  bRelease = true;
563  return;
564  }
566 
567  if ( pCurSh )
568  {
569  vcl::Window* pShellWnd = pCurSh->GetWindow();
570 
571  if ( pShellWnd )
572  pShellWnd->GrabFocus();
573  }
574 }
575 
577 
579  sal_uInt16 nSlotId,
580  sal_uInt16 nId,
581  ToolBox& rTbx) :
582  SfxToolBoxControl( nSlotId, nId, rTbx )
583 {
584 }
585 
587 {
588 }
589 
590 void SwPreviewZoomControl::StateChanged( sal_uInt16 /*nSID*/,
591  SfxItemState eState,
592  const SfxPoolItem* pState )
593 {
594  sal_uInt16 nId = GetId();
595  GetToolBox().EnableItem( nId, (GetItemState(pState) != SfxItemState::DISABLED) );
596  SwZoomBox_Impl* pBox = static_cast<SwZoomBox_Impl*>(GetToolBox().GetItemWindow( GetId() ));
597  if(SfxItemState::DEFAULT <= eState)
598  {
599  OUString sZoom(unicode::formatPercent(static_cast<const SfxUInt16Item*>(pState)->GetValue(),
600  Application::GetSettings().GetUILanguageTag()));
601  pBox->SetText(sZoom);
602  pBox->SaveValue();
603  }
604 }
605 
607 {
608  VclPtrInstance<SwZoomBox_Impl> pRet( pParent, GetSlotId() );
609  return pRet.get();
610 }
611 
612 namespace {
613 
614 class SwJumpToSpecificBox_Impl : public NumericField
615 {
616  sal_uInt16 const nSlotId;
617 
618 public:
619  SwJumpToSpecificBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot);
620 
621 protected:
622  void Select();
623  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
624 };
625 
626 }
627 
628 SwJumpToSpecificBox_Impl::SwJumpToSpecificBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot)
629  : NumericField(pParent, WB_HIDE | WB_BORDER)
630  , nSlotId(nSlot)
631 {
632  SetSizePixel(LogicToPixel(Size(16, 12), MapMode(MapUnit::MapAppFont)));
633 }
634 
635 void SwJumpToSpecificBox_Impl::Select()
636 {
637  OUString sEntry(GetText());
638  SfxUInt16Item aPageNum(nSlotId);
639  aPageNum.SetValue(static_cast<sal_uInt16>(sEntry.toInt32()));
640  SfxObjectShell* pCurrentShell = SfxObjectShell::Current();
641  pCurrentShell->GetDispatcher()->ExecuteList(nSlotId, SfxCallMode::ASYNCHRON,
642  { &aPageNum });
643 }
644 
645 bool SwJumpToSpecificBox_Impl::EventNotify( NotifyEvent& rNEvt )
646 {
647  if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
648  Select();
649  return NumericField::EventNotify(rNEvt);
650 }
651 
653 
655  sal_uInt16 nSlotId,
656  sal_uInt16 nId,
657  ToolBox& rTbx) :
658  SfxToolBoxControl( nSlotId, nId, rTbx )
659 {}
660 
662 {}
663 
665 {
667  return pRet.get();
668 }
669 
670 namespace {
671 
672 class NavElementBox_Impl;
673 class NavElementToolBoxControl : public svt::ToolboxController,
674  public lang::XServiceInfo
675 {
676  public:
677  explicit NavElementToolBoxControl(
678  const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
679 
680  // XInterface
681  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
682  virtual void SAL_CALL acquire() throw () override;
683  virtual void SAL_CALL release() throw () override;
684 
685  // XServiceInfo
686  virtual OUString SAL_CALL getImplementationName() override;
687  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
688  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
689 
690  // XComponent
691  virtual void SAL_CALL dispose() override;
692 
693  // XStatusListener
694  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
695 
696  // XToolbarController
697  virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
698  virtual void SAL_CALL click() override;
699  virtual void SAL_CALL doubleClick() override;
700  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override;
701  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
702 
703  void dispatchCommand( const css::uno::Sequence< css::beans::PropertyValue >& rArgs );
704  using svt::ToolboxController::dispatchCommand;
705 
706  private:
707  VclPtr<NavElementBox_Impl> m_pBox;
708 };
709 
710 class NavElementBox_Impl : public ListBox
711 {
712 public:
713  NavElementBox_Impl( vcl::Window* pParent,
714  const uno::Reference< frame::XFrame >& _xFrame,
715  NavElementToolBoxControl& rCtrl );
716 
717  void Update();
718 
719  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
720 
721 protected:
722  virtual void Select() override;
723 
724 private:
725  NavElementToolBoxControl* m_pCtrl;
726  bool m_bRelease;
727  uno::Reference< frame::XFrame > m_xFrame;
728 
729  void ReleaseFocus_Impl();
730 };
731 
732 }
733 
734 NavElementBox_Impl::NavElementBox_Impl(
735  vcl::Window* _pParent,
736  const uno::Reference< frame::XFrame >& _xFrame,
737  NavElementToolBoxControl& _rCtrl ) :
738 
739  ListBox( _pParent, WinBits( WB_DROPDOWN ) ),
740 
741  m_pCtrl ( &_rCtrl ),
742  m_bRelease ( true ),
743  m_xFrame ( _xFrame )
744 {
745  SetSizePixel( Size( 150, 260 ) );
746 
747  sal_uInt16 i;
748  for ( i = 0; i < NID_COUNT; i++ )
749  {
750  sal_uInt16 nNaviId = aNavigationInsertIds[i];
751  if ( ( NID_PREV != nNaviId ) && ( NID_NEXT != nNaviId ) )
752  InsertEntry( SwResId( aNavigationStrIds[i] ), Image( StockImage::Yes, aNavigationImgIds[i] ) );
753  }
754 }
755 
756 void NavElementBox_Impl::ReleaseFocus_Impl()
757 {
758  if ( !m_bRelease )
759  {
760  m_bRelease = true;
761  return;
762  }
763 
764  if ( m_xFrame.is() && m_xFrame->getContainerWindow().is() )
765  m_xFrame->getContainerWindow()->setFocus();
766 }
767 
768 void NavElementBox_Impl::Select()
769 {
770  ListBox::Select();
771 
772  if ( !IsTravelSelect() )
773  {
774  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
775 
776  sal_uInt16 nPos = GetSelectedEntryPos();
777  // adjust array index for Ids after NID_PREV in aNavigationInsertIds
778  if ( nPos >= NID_COUNT/2 - 1 )
779  ++nPos;
780 
781  sal_uInt16 nMoveType = aNavigationInsertIds[nPos];
782  SwView::SetMoveType( nMoveType );
783 
784  css::uno::Sequence< css::beans::PropertyValue > aArgs;
785 
786  /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call.
787  This instance may be deleted in the meantime (i.e. when a dialog is opened
788  while in Dispatch()), accessing members will crash in this case. */
789  ReleaseFocus_Impl();
790 
791  m_pCtrl->dispatchCommand( aArgs );
792  }
793 }
794 
795 void NavElementBox_Impl::Update()
796 {
797  sal_uInt16 nMoveType = SwView::GetMoveType();
798  for ( size_t i = 0; i < SAL_N_ELEMENTS( aNavigationInsertIds ); ++i )
799  {
800  if ( nMoveType == aNavigationInsertIds[i] )
801  {
802  const char* id = aNavigationStrIds[i];
803  OUString sText = SwResId( id );
804  SelectEntry( sText );
805  break;
806  }
807  }
808 }
809 
810 bool NavElementBox_Impl::EventNotify( NotifyEvent& rNEvt )
811 {
812  bool bHandled = false;
813 
814  if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
815  {
816  sal_uInt16 nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
817 
818  switch ( nCode )
819  {
820  case KEY_RETURN:
821  case KEY_TAB:
822  {
823  if ( KEY_TAB == nCode )
824  m_bRelease = false;
825  else
826  bHandled = true;
827  Select();
828  break;
829  }
830 
831  case KEY_ESCAPE:
832  ReleaseFocus_Impl();
833  bHandled = true;
834  break;
835  }
836  }
837 
838  return bHandled || ListBox::EventNotify( rNEvt );
839 }
840 
841 NavElementToolBoxControl::NavElementToolBoxControl( const uno::Reference< uno::XComponentContext >& rxContext )
842  : svt::ToolboxController( rxContext,
843  uno::Reference< frame::XFrame >(),
844  ".uno:NavElement" ),
845  m_pBox( nullptr )
846 {
847 }
848 
849 // XInterface
850 css::uno::Any SAL_CALL NavElementToolBoxControl::queryInterface( const css::uno::Type& aType )
851 {
852  uno::Any a = ToolboxController::queryInterface( aType );
853  if ( a.hasValue() )
854  return a;
855 
856  return ::cppu::queryInterface( aType, static_cast< lang::XServiceInfo* >( this ) );
857 }
858 
859 void SAL_CALL NavElementToolBoxControl::acquire() throw ()
860 {
861  ToolboxController::acquire();
862 }
863 
864 void SAL_CALL NavElementToolBoxControl::release() throw ()
865 {
866  ToolboxController::release();
867 }
868 
869 // XServiceInfo
870 sal_Bool SAL_CALL NavElementToolBoxControl::supportsService( const OUString& ServiceName )
871 {
872  return cppu::supportsService( this, ServiceName );
873 }
874 
875 OUString SAL_CALL NavElementToolBoxControl::getImplementationName()
876 {
877  return "lo.writer.NavElementToolBoxController";
878 }
879 
880 uno::Sequence< OUString > SAL_CALL NavElementToolBoxControl::getSupportedServiceNames()
881 {
882  uno::Sequence<OUString> aSNS { "com.sun.star.frame.ToolbarController" };
883  return aSNS;
884 }
885 
886 // XComponent
887 void SAL_CALL NavElementToolBoxControl::dispose()
888 {
890 
891  SolarMutexGuard aSolarMutexGuard;
892  m_pBox.disposeAndClear();
893 }
894 
895 // XStatusListener
896 void SAL_CALL NavElementToolBoxControl::statusChanged( const frame::FeatureStateEvent& rEvent )
897 {
898  if ( m_pBox )
899  {
900  SolarMutexGuard aSolarMutexGuard;
901  if ( rEvent.FeatureURL.Path == "NavElement" )
902  {
903  if ( rEvent.IsEnabled )
904  {
905  m_pBox->Enable();
906  m_pBox->Update();
907  }
908  else
909  m_pBox->Disable();
910  }
911  }
912 }
913 
914 // XToolbarController
915 void SAL_CALL NavElementToolBoxControl::execute( sal_Int16 /*KeyModifier*/ )
916 {
917 }
918 
919 void SAL_CALL NavElementToolBoxControl::click()
920 {
921 }
922 
923 void SAL_CALL NavElementToolBoxControl::doubleClick()
924 {
925 }
926 
927 uno::Reference< awt::XWindow > SAL_CALL NavElementToolBoxControl::createPopupWindow()
928 {
929  return uno::Reference< awt::XWindow >();
930 }
931 
932 uno::Reference< awt::XWindow > SAL_CALL NavElementToolBoxControl::createItemWindow(
933  const uno::Reference< awt::XWindow >& xParent )
934 {
935  uno::Reference< awt::XWindow > xItemWindow;
936 
937  VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
938  if ( pParent )
939  {
940  SolarMutexGuard aSolarMutexGuard;
941  m_pBox = VclPtr<NavElementBox_Impl>::Create( pParent, m_xFrame, *this );
942  xItemWindow = VCLUnoHelper::GetInterface( m_pBox );
943  }
944 
945  uno::Reference< util::XURLTransformer > xURLTransformer = getURLTransformer();
946 
947  return xItemWindow;
948 }
949 
950 void NavElementToolBoxControl::dispatchCommand(
951  const uno::Sequence< beans::PropertyValue >& rArgs )
952 {
953  uno::Reference< frame::XDispatchProvider > xDispatchProvider( m_xFrame, uno::UNO_QUERY );
954  if ( xDispatchProvider.is() )
955  {
956  util::URL aURL;
957  uno::Reference< frame::XDispatch > xDispatch;
958  uno::Reference< util::XURLTransformer > xURLTransformer = getURLTransformer();
959 
960  aURL.Complete = ".uno:NavElement";
961  xURLTransformer->parseStrict( aURL );
962  xDispatch = xDispatchProvider->queryDispatch( aURL, OUString(), 0 );
963  if ( xDispatch.is() )
964  xDispatch->dispatch( aURL, rArgs );
965  }
966 }
967 
968 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
970  css::uno::XComponentContext *rxContext,
971  css::uno::Sequence<css::uno::Any> const &)
972 {
973  return cppu::acquire( new NavElementToolBoxControl( rxContext ) );
974 }
975 
976 namespace {
977 
978 class PrevNextScrollToolboxController : public svt::ToolboxController,
979  public css::lang::XServiceInfo
980 {
981 public:
982  enum Type { PREVIOUS, NEXT };
983 
984  PrevNextScrollToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, Type eType );
985 
986  // XInterface
987  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
988  virtual void SAL_CALL acquire() throw () override;
989  virtual void SAL_CALL release() throw () override;
990 
991  // XServiceInfo
992  virtual OUString SAL_CALL getImplementationName() override;
993  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
994  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
995 
996  // XComponent
997  virtual void SAL_CALL dispose() override;
998 
999  // XToolbarController
1000  virtual void SAL_CALL execute( sal_Int16 /* KeyModifier */ ) override;
1001  virtual void SAL_CALL click() override;
1002 
1003  // XStatusListener
1004  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
1005 
1006 private:
1007  Type const meType;
1008 };
1009 
1010 }
1011 
1012 PrevNextScrollToolboxController::PrevNextScrollToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, Type eType )
1013  : svt::ToolboxController( rxContext,
1014  css::uno::Reference< css::frame::XFrame >(),
1015  (eType == PREVIOUS) ? OUString( ".uno:ScrollToPrevious" ): OUString( ".uno:ScrollToNext" ) ),
1016  meType( eType )
1017 {
1018  addStatusListener(".uno:NavElement");
1019 }
1020 
1021 // XInterface
1022 css::uno::Any SAL_CALL PrevNextScrollToolboxController::queryInterface( const css::uno::Type& aType )
1023 {
1024  css::uno::Any a = ToolboxController::queryInterface( aType );
1025  if ( a.hasValue() )
1026  return a;
1027 
1028  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
1029 }
1030 
1031 void SAL_CALL PrevNextScrollToolboxController::acquire() throw ()
1032 {
1034 }
1035 
1036 void SAL_CALL PrevNextScrollToolboxController::release() throw ()
1037 {
1039 }
1040 
1041 // XServiceInfo
1042 OUString SAL_CALL PrevNextScrollToolboxController::getImplementationName()
1043 {
1044  return meType == PrevNextScrollToolboxController::PREVIOUS?
1045  OUString( "lo.writer.PreviousScrollToolboxController" ) :
1046  OUString( "lo.writer.NextScrollToolboxController" );
1047 }
1048 
1049 sal_Bool SAL_CALL PrevNextScrollToolboxController::supportsService( const OUString& ServiceName )
1050 {
1051  return cppu::supportsService(this, ServiceName);
1052 }
1053 
1054 css::uno::Sequence< OUString > SAL_CALL PrevNextScrollToolboxController::getSupportedServiceNames()
1055 {
1056  return { "com.sun.star.frame.ToolbarController" };
1057 }
1058 
1059 // XComponent
1061 {
1062  SolarMutexGuard aSolarMutexGuard;
1063 
1065 }
1066 
1067 // XToolbarController
1068 void SAL_CALL PrevNextScrollToolboxController::execute( sal_Int16 /* KeyModifier */ )
1069 {
1070 }
1071 
1072 void SAL_CALL PrevNextScrollToolboxController::click()
1073 {
1074  uno::Sequence< beans::PropertyValue > rArgs;
1075 
1076  uno::Reference< frame::XDispatchProvider > xDispatchProvider( m_xFrame, uno::UNO_QUERY );
1077  if ( xDispatchProvider.is() )
1078  {
1079  util::URL aURL;
1080  uno::Reference< frame::XDispatch > xDispatch;
1081  uno::Reference< util::XURLTransformer > xURLTransformer = getURLTransformer();
1082 
1083  aURL.Complete = getCommandURL();
1084  xURLTransformer->parseStrict( aURL );
1085  xDispatch = xDispatchProvider->queryDispatch( aURL, OUString(), 0 );
1086  if ( xDispatch.is() )
1087  xDispatch->dispatch( aURL, rArgs );
1088  }
1089 }
1090 
1091 // XStatusListener
1092 void SAL_CALL PrevNextScrollToolboxController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
1093 {
1094  if ( rEvent.FeatureURL.Path == "NavElement" )
1095  {
1096  ToolBox* pToolBox = nullptr;
1097  sal_uInt16 nId = 0;
1098  if ( getToolboxId( nId, &pToolBox ) )
1099  pToolBox->SetQuickHelpText( nId, ( meType == PrevNextScrollToolboxController::PREVIOUS?SwScrollNaviPopup::GetToolTip( false ):
1100  SwScrollNaviPopup::GetToolTip( true ) ) );
1101  }
1102 }
1103 
1104 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1106  css::uno::XComponentContext *context,
1107  css::uno::Sequence<css::uno::Any> const &)
1108 {
1109  return cppu::acquire( new PrevNextScrollToolboxController( context, PrevNextScrollToolboxController::PREVIOUS ) );
1110 }
1111 
1112 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1114  css::uno::XComponentContext *context,
1115  css::uno::Sequence<css::uno::Any> const &)
1116 {
1117  return cppu::acquire( new PrevNextScrollToolboxController( context, PrevNextScrollToolboxController::NEXT ) );
1118 }
1119 
1120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define HID_NID_PGE
Definition: helpids.h:128
virtual VclPtr< vcl::Window > CreateItemWindow(vcl::Window *pParent) override
Definition: workctrl.cxx:664
#define MAXZOOM
Definition: view.hxx:83
Type
virtual void dispose() override
Definition: workctrl.cxx:366
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:82
URL aURL
sal_uInt16 GetBlockCount(size_t nGroup)
Definition: gloslst.cxx:198
bool hasValue()
#define HID_NID_MARK
Definition: helpids.h:130
sal_Int32 nIndex
void SetQuickHelpText(sal_uInt16 nItemId, const OUString &rText)
#define NID_GRF
Definition: workctrl.hxx:40
#define NID_POSTIT
Definition: workctrl.hxx:46
virtual ~SwScrollNaviToolBox() override
Definition: workctrl.cxx:395
static sal_uInt16 GetMoveType()
Definition: viewmdi.cxx:652
#define HID_PVIEW_ZOOM_LB
Definition: helpids.h:122
#define HID_NID_BKM
Definition: helpids.h:135
#define HID_NID_INDEX_ENTRY
Definition: helpids.h:140
virtual void SAL_CALL dispose() override
IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox *, pSet, void)
Definition: workctrl.cxx:373
virtual ~SwTbxAutoTextCtrl() override
Definition: workctrl.cxx:85
SwView * GetActiveView()
Definition: swmodul1.cxx:123
#define NID_BKM
Definition: workctrl.hxx:39
#define KEY_TAB
#define FN_PREVIEW_ZOOM
Definition: cmdid.h:174
std::string GetValue
#define NID_MARK
Definition: workctrl.hxx:45
#define HID_NID_SRCH_REP
Definition: helpids.h:139
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:1113
#define HID_NID_PREV
Definition: helpids.h:133
const OUString & GetItemText(sal_uInt16 nItemId) const
#define NID_SEL
Definition: workctrl.hxx:43
#define HID_NID_CTRL
Definition: helpids.h:132
ToolBoxItemBits GetItemBits(sal_uInt16 nItemId) const
void disposeAndClear()
void StartSelection()
static const AllSettings & GetSettings()
static VclPtr< vcl::Window > GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
virtual void Select()
css::uno::Reference< css::lang::XComponent > m_xFrame
#define HID_NID_TBL
Definition: helpids.h:124
#define NID_TABLE_FORMULA
Definition: workctrl.hxx:49
virtual void dispose() override
Reference
sal_Int16 nId
#define NID_OUTL
Definition: workctrl.hxx:42
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
sal_uInt16 GetCode() const
#define HID_NID_GRF
Definition: helpids.h:126
size_t GetGroupCount()
Definition: gloslst.cxx:168
const KeyEvent * GetKeyEvent() const
virtual void statusChanged(const css::frame::FeatureStateEvent &rEvent) override
Definition: workctrl.cxx:429
sal_uInt16 Execute(vcl::Window *pWindow, const Point &rPopupPos)
#define HID_NID_REG
Definition: helpids.h:134
static SfxObjectShell * Current()
#define HID_NID_NEXT
Definition: helpids.h:143
#define TOOLBOX_STYLE_FLAT
virtual void Select()
void SetItemText(sal_uInt16 nItemId, const OUString &rText)
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: workctrl.cxx:590
void AddStatusListener(const OUString &rCommandURL)
static OUString GetToolTip(bool bNext)
Definition: workctrl.cxx:420
IMPL_STATIC_LINK(SwTbxAutoTextCtrl, PopupHdl, Menu *, pMenu, bool)
Definition: workctrl.cxx:144
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
#define NID_SRCH_REP
Definition: workctrl.hxx:47
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:969
virtual ~SwJumpToSpecificPageControl() override
Definition: workctrl.cxx:661
sal_Int64 WinBits
static OUStringLiteral const aNavigationImgIds[NAVI_ENTRIES]
Definition: workctrl.cxx:194
OUString SvxResId(const char *pId)
PREVIOUS
virtual void SAL_CALL acquire() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
static SfxViewShell * Current()
SwTbxAutoTextCtrl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx)
Definition: workctrl.cxx:76
void SetCurGroup(const OUString &aGrp, bool bApi=false, bool bAlwaysCreateNew=false)
Definition: gloshdl.cxx:106
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
SwScrollNaviPopup(sal_uInt16 nId, const css::uno::Reference< css::frame::XFrame > &rFrame, vcl::Window *pParent)
Definition: workctrl.cxx:317
void EnableItem(sal_uInt16 nItemId, bool bEnable=true)
virtual void InsertItem(const OUString &rCommand, const css::uno::Reference< css::frame::XFrame > &rFrame, ToolBoxItemBits nBits, const Size &rRequestedSize, ImplToolItems::size_type nPos=APPEND)
void addStatusListener(const OUString &aCommandURL)
#define HID_NID_SEL
Definition: helpids.h:136
sal_uInt16 nCode
WinBits const WB_HIDE
#define NAVI_ENTRIES
Definition: workctrl.cxx:64
tools::Rectangle GetItemRect(sal_uInt16 nItemId)
void SetPopupMenu(sal_uInt16 nItemId, PopupMenu *pMenu)
#define SAL_N_ELEMENTS(arr)
virtual void SAL_CALL release() override
#define HID_NID_DRW
Definition: helpids.h:131
static sal_uInt16 aNavigationInsertIds[NAVI_ENTRIES]
Definition: workctrl.cxx:168
ToolBoxItemBits
virtual ~SwScrollNaviPopup() override
Definition: workctrl.cxx:361
void SetSelectHdl(const Link< Menu *, bool > &rLink)
void EndSelection()
VclPtr< SwScrollNaviPopup > m_pNaviPopup
Definition: workctrl.hxx:73
virtual void dispose() override
Definition: workctrl.cxx:400
SfxDispatcher * GetDispatcher() const
#define NID_INDEX_ENTRY
Definition: workctrl.hxx:48
#define NID_START
Definition: workctrl.hxx:30
uno_Any a
OUString GetGroupTitle(size_t nPos)
Definition: gloslst.cxx:187
virtual bool EventNotify(NotifyEvent &rNEvt) override
static SwGlossaryList * pGlossaryList
Definition: initui.cxx:44
virtual ~SwPreviewZoomControl() override
Definition: workctrl.cxx:586
virtual void SetText(const OUString &rStr) override
bool getToolboxId(sal_uInt16 &rItemId, ToolBox **ppToolBox)
static const char * aNavigationStrIds[NAVI_ENTRIES]
Definition: workctrl.cxx:246
int i
#define KEY_ESCAPE
static const char * STR_IMGBTN_ARY[]
Definition: workctrl.cxx:273
void SetItemBits(sal_uInt16 nItemId, ToolBoxItemBits nBits)
virtual bool EventNotify(NotifyEvent &rNEvt) override
void CheckItem(sal_uInt16 nItemId, bool bCheck=true)
unsigned char sal_Bool
#define NID_REG
Definition: workctrl.hxx:38
#define NID_TABLE_FORMULA_ERROR
Definition: workctrl.hxx:50
MouseNotifyEvent GetType() const
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
vcl::Window * GetItemWindow(sal_uInt16 nItemId) const
WinBits const WB_DROPDOWN
#define NID_FTN
Definition: workctrl.hxx:44
OUString SwResId(const char *pId)
Definition: swmodule.cxx:190
static void SetMoveType(sal_uInt16 nSet)
Definition: viewmdi.cxx:657
bool HasReadonlySel() const
Definition: crsrsh.cxx:3316
void SetSelectHdl(const Link< ToolBox *, void > &rLink)
void GrabFocus()
void SetItemDown(sal_uInt16 nItemId, bool bDown)
static void SetSearchLabel(const SearchLabel &rSL)
#define NID_NEXT
Definition: workctrl.hxx:31
#define NID_DRW
Definition: workctrl.hxx:36
SwDocShell * GetDocShell()
Definition: view.cxx:1128
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: workctrl.cxx:137
SFX_IMPL_TOOLBOX_CONTROL(SwTbxAutoTextCtrl, SfxVoidItem)
bool IsReadOnly() const
VclPtr< SwScrollNaviToolBox > m_pToolBox
Definition: workctrl.hxx:90
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:1105
static SfxItemState GetItemState(const SfxPoolItem *pState)
SwPreviewZoomControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx)
Definition: workctrl.cxx:578
OUString sQuickHelp[2 *NID_COUNT]
Definition: workctrl.hxx:93
#define KEY_RETURN
NEXT
#define NID_OLE
Definition: workctrl.hxx:41
void InsertItem(sal_uInt16 nItemId, const OUString &rStr, MenuItemBits nItemBits=MenuItemBits::NONE, const OString &rIdent=OString(), sal_uInt16 nPos=MENU_APPEND)
bool InsertGlossary(const OUString &rName)
Definition: gloshdl.cxx:501
const vcl::KeyCode & GetKeyCode() const
static vcl::Window * GetFocusWindow()
#define NID_PGE
Definition: workctrl.hxx:35
#define NID_CTRL
Definition: workctrl.hxx:37
Reference< XDispatch > xDispatch
static OUString formatPercent(double dNumber, const LanguageTag &rLangTag)
void SetLineCount(ImplToolItems::size_type nNewLines)
SfxItemState
#define NID_TBL
Definition: workctrl.hxx:33
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: workctrl.cxx:413
WinBits const WB_BORDER
const OUString & getCommandURL() const
#define HID_NID_FRM
Definition: helpids.h:125
unsigned short GetId() const
WindowAlign GetAlign() const
static VclPtr< reference_type > Create(Arg &&...arg)
unsigned short GetSlotId() const
#define HID_NAVI_VS
Definition: helpids.h:39
static const char * aNavigationHelpIds[NAVI_ENTRIES]
Definition: workctrl.cxx:220
vcl::Window * GetWindow() const
WinBits const WB_AUTOHSCROLL
#define HID_NID_OUTL
Definition: helpids.h:129
css::uno::Reference< css::frame::XFrame > m_xFrame
void SetOutStyle(sal_uInt16 nNewStyle)
SwGlossaryHdl * GetGlosHdl()
Definition: view.cxx:1625
#define HID_NID_OLE
Definition: helpids.h:127
virtual VclPtr< vcl::Window > CreateItemWindow(vcl::Window *pParent) override
Definition: workctrl.cxx:606
void InsertBreak(ImplToolItems::size_type nPos=APPEND)
sal_uInt16 GetItemId(ImplToolItems::size_type nPos) const
reference_type * get() const
#define HID_NID_TABLE_FORMULA
Definition: helpids.h:141
#define HID_NID_TABLE_FORMULA_ERROR
Definition: helpids.h:142
virtual VclPtr< SfxPopupWindow > CreatePopupWindow() override
Definition: workctrl.cxx:89
RedlineType const meType
void SetHelpId(sal_uInt16 nItemId, const OString &rHelpId)
const css::uno::Reference< css::util::XURLTransformer > & getURLTransformer() const
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
virtual GlossarySetActGroup SetGlossaryActGroupFunc()=0
#define NID_PREV
Definition: workctrl.hxx:32
#define HID_NID_POSTIT
Definition: helpids.h:138
#define NID_FRM
Definition: workctrl.hxx:34
#define NID_COUNT
Definition: workctrl.hxx:51
virtual void dispose() override
#define HID_NID_FTN
Definition: helpids.h:137
virtual void RequestHelp(const HelpEvent &rHEvt) override
void Dispatch(const OUString &aCommand, css::uno::Sequence< css::beans::PropertyValue > const &aArgs)
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: workctrl.cxx:406
Definition: view.hxx:146
sal_uInt16 nPos
SwJumpToSpecificPageControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx)
Definition: workctrl.cxx:654
VclPtr< FixedText > m_pInfoField
Definition: workctrl.hxx:91
virtual bool EventNotify(NotifyEvent &rNEvt) override
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
SwGlossaryList * GetGlossaryList()
Definition: initui.cxx:177