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  SwView::SetMoveType( nSet );
380  SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( GetFrame()->getController(), UNO_QUERY ),
381  ".uno:NavElement", aArgs );
382  }
383  else
384  {
386  OUString cmd(".uno:ScrollToPrevious");
387  if (NID_NEXT == nSet)
388  cmd = ".uno:ScrollToNext";
389  SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( GetFrame()->getController(), UNO_QUERY ),
390  cmd, aArgs );
391  }
392 }
393 
395 {
396  disposeOnce();
397 }
398 
400 {
403 }
404 
406 {
407  ToolBox::MouseButtonUp(rMEvt);
408  if (m_pNaviPopup->IsInPopupMode())
409  m_pNaviPopup->EndPopupMode(FloatWinPopupEndFlags::CloseAll);
410 }
411 
413 {
416  ToolBox::RequestHelp( rHEvt );
417 }
418 
419 OUString SwScrollNaviPopup::GetToolTip(bool bNext)
420 {
421  sal_uInt16 nResId = SwView::GetMoveType();
422  if (!bNext)
423  nResId += NID_COUNT;
424  const char* id = STR_IMGBTN_ARY[nResId - NID_START];
425  return id ? SwResId(id): OUString();
426 }
427 
428 void SwScrollNaviPopup::statusChanged( const css::frame::FeatureStateEvent& rEvent )
429 {
430  if ( rEvent.FeatureURL.Path == "NavElement" )
431  {
432  sal_uInt16 nSet = SwView::GetMoveType();
436  // check the current button only
437  for( ToolBox::ImplToolItems::size_type i = 0; i < NID_COUNT; i++ )
438  {
439  sal_uInt16 nItemId = m_pToolBox->GetItemId( i );
440  m_pToolBox->CheckItem( nItemId, nItemId == nSet );
441  }
442  }
443 }
444 
445 class SwZoomBox_Impl : public ComboBox
446 {
447  sal_uInt16 const nSlotId;
448  bool bRelease;
449 
450 public:
452  vcl::Window* pParent,
453  sal_uInt16 nSlot );
454 
455 protected:
456  virtual void Select() override;
457  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
458 
459  void ReleaseFocus();
460 
461 };
462 
463 SwZoomBox_Impl::SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot)
465  , nSlotId(nSlot)
466  , bRelease(true)
467 {
469  SetSizePixel(LogicToPixel(Size(30, 86), MapMode(MapUnit::MapAppFont)));
470  EnableAutocomplete( false );
471  const char* const aZoomValues[] =
472  { RID_SVXSTR_ZOOM_25 , RID_SVXSTR_ZOOM_50 ,
473  RID_SVXSTR_ZOOM_75 , RID_SVXSTR_ZOOM_100 ,
474  RID_SVXSTR_ZOOM_150 , RID_SVXSTR_ZOOM_200 ,
475  RID_SVXSTR_ZOOM_WHOLE_PAGE, RID_SVXSTR_ZOOM_PAGE_WIDTH ,
476  RID_SVXSTR_ZOOM_OPTIMAL_VIEW };
477  for(const char* pZoomValue : aZoomValues)
478  {
479  OUString sEntry = SvxResId(pZoomValue);
480  InsertEntry(sEntry);
481  }
482 }
483 
485 {
486  if ( !IsTravelSelect() )
487  {
488  OUString sEntry = GetText().replaceAll("%", "");
489  SvxZoomItem aZoom(SvxZoomType::PERCENT,100);
490  if(sEntry == SvxResId( RID_SVXSTR_ZOOM_PAGE_WIDTH ) )
491  aZoom.SetType(SvxZoomType::PAGEWIDTH);
492  else if(sEntry == SvxResId( RID_SVXSTR_ZOOM_OPTIMAL_VIEW ) )
493  aZoom.SetType(SvxZoomType::OPTIMAL);
494  else if(sEntry == SvxResId( RID_SVXSTR_ZOOM_WHOLE_PAGE) )
495  aZoom.SetType(SvxZoomType::WHOLEPAGE);
496  else
497  {
498  sal_uInt16 nZoom = static_cast<sal_uInt16>(sEntry.toInt32());
499  if(nZoom < MINZOOM)
500  nZoom = MINZOOM;
501  if(nZoom > MAXZOOM)
502  nZoom = MAXZOOM;
503  aZoom.SetValue(nZoom);
504  }
505  if( FN_PREVIEW_ZOOM == nSlotId )
506  {
507  SfxObjectShell* pCurrentShell = SfxObjectShell::Current();
508 
509  pCurrentShell->GetDispatcher()->ExecuteList(SID_ATTR_ZOOM,
510  SfxCallMode::ASYNCHRON, { &aZoom });
511  }
512  ReleaseFocus();
513  }
514 }
515 
517 {
518  bool bHandled = false;
519 
520  if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
521  {
522  sal_uInt16 nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
523 
524  switch ( nCode )
525  {
526  case KEY_RETURN:
527  case KEY_TAB:
528  {
529  if ( KEY_TAB == nCode )
530  bRelease = false;
531  else
532  bHandled = true;
533  Select();
534  break;
535  }
536 
537  case KEY_ESCAPE:
538  SetText( GetSavedValue() );
539  ReleaseFocus();
540  break;
541  }
542  }
543  else if ( MouseNotifyEvent::LOSEFOCUS == rNEvt.GetType() )
544  {
546  if ( !HasFocus() && GetSubEdit() != pFocusWin )
547  SetText( GetSavedValue() );
548  }
549 
550  return bHandled || ComboBox::EventNotify(rNEvt);
551 }
552 
554 {
555  if ( !bRelease )
556  {
557  bRelease = true;
558  return;
559  }
561 
562  if ( pCurSh )
563  {
564  vcl::Window* pShellWnd = pCurSh->GetWindow();
565 
566  if ( pShellWnd )
567  pShellWnd->GrabFocus();
568  }
569 }
570 
572 
574  sal_uInt16 nSlotId,
575  sal_uInt16 nId,
576  ToolBox& rTbx) :
577  SfxToolBoxControl( nSlotId, nId, rTbx )
578 {
579 }
580 
582 {
583 }
584 
585 void SwPreviewZoomControl::StateChanged( sal_uInt16 /*nSID*/,
586  SfxItemState eState,
587  const SfxPoolItem* pState )
588 {
589  sal_uInt16 nId = GetId();
590  GetToolBox().EnableItem( nId, (GetItemState(pState) != SfxItemState::DISABLED) );
591  SwZoomBox_Impl* pBox = static_cast<SwZoomBox_Impl*>(GetToolBox().GetItemWindow( GetId() ));
592  if(SfxItemState::DEFAULT <= eState)
593  {
594  OUString sZoom(unicode::formatPercent(static_cast<const SfxUInt16Item*>(pState)->GetValue(),
595  Application::GetSettings().GetUILanguageTag()));
596  pBox->SetText(sZoom);
597  pBox->SaveValue();
598  }
599 }
600 
602 {
603  VclPtrInstance<SwZoomBox_Impl> pRet( pParent, GetSlotId() );
604  return pRet.get();
605 }
606 
608 {
609  sal_uInt16 const nSlotId;
610 
611 public:
612  SwJumpToSpecificBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot);
613 
614 protected:
615  void Select();
616  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
617 };
618 
620  : NumericField(pParent, WB_HIDE | WB_BORDER)
621  , nSlotId(nSlot)
622 {
623  SetSizePixel(LogicToPixel(Size(16, 12), MapMode(MapUnit::MapAppFont)));
624 }
625 
627 {
628  OUString sEntry(GetText());
629  SfxUInt16Item aPageNum(nSlotId);
630  aPageNum.SetValue(static_cast<sal_uInt16>(sEntry.toInt32()));
631  SfxObjectShell* pCurrentShell = SfxObjectShell::Current();
632  pCurrentShell->GetDispatcher()->ExecuteList(nSlotId, SfxCallMode::ASYNCHRON,
633  { &aPageNum });
634 }
635 
637 {
638  if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
639  Select();
640  return NumericField::EventNotify(rNEvt);
641 }
642 
644 
646  sal_uInt16 nSlotId,
647  sal_uInt16 nId,
648  ToolBox& rTbx) :
649  SfxToolBoxControl( nSlotId, nId, rTbx )
650 {}
651 
653 {}
654 
656 {
658  return pRet.get();
659 }
660 
661 class NavElementBox_Impl;
663  public lang::XServiceInfo
664 {
665  public:
666  explicit NavElementToolBoxControl(
667  const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
668 
669  // XInterface
670  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
671  virtual void SAL_CALL acquire() throw () override;
672  virtual void SAL_CALL release() throw () override;
673 
674  // XServiceInfo
675  virtual OUString SAL_CALL getImplementationName() override;
676  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
677  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
678 
679  // XComponent
680  virtual void SAL_CALL dispose() override;
681 
682  // XStatusListener
683  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
684 
685  // XToolbarController
686  virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
687  virtual void SAL_CALL click() override;
688  virtual void SAL_CALL doubleClick() override;
689  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override;
690  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
691 
692  void dispatchCommand( const css::uno::Sequence< css::beans::PropertyValue >& rArgs );
694 
695  private:
697 };
698 
700 {
701 public:
703  const uno::Reference< frame::XFrame >& _xFrame,
704  NavElementToolBoxControl& rCtrl );
705 
706  void Update();
707 
708  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
709 
710 protected:
711  virtual void Select() override;
712 
713 private:
716  uno::Reference< frame::XFrame > m_xFrame;
717 
718  void ReleaseFocus_Impl();
719 };
720 
722  vcl::Window* _pParent,
723  const uno::Reference< frame::XFrame >& _xFrame,
724  NavElementToolBoxControl& _rCtrl ) :
725 
726  ListBox( _pParent, WinBits( WB_DROPDOWN ) ),
727 
728  m_pCtrl ( &_rCtrl ),
729  m_bRelease ( true ),
730  m_xFrame ( _xFrame )
731 {
732  SetSizePixel( Size( 150, 260 ) );
733 
734  sal_uInt16 i;
735  for ( i = 0; i < NID_COUNT; i++ )
736  {
737  sal_uInt16 nNaviId = aNavigationInsertIds[i];
738  if ( ( NID_PREV != nNaviId ) && ( NID_NEXT != nNaviId ) )
739  InsertEntry( SwResId( aNavigationStrIds[i] ), Image( StockImage::Yes, aNavigationImgIds[i] ) );
740  }
741 }
742 
744 {
745  if ( !m_bRelease )
746  {
747  m_bRelease = true;
748  return;
749  }
750 
751  if ( m_xFrame.is() && m_xFrame->getContainerWindow().is() )
752  m_xFrame->getContainerWindow()->setFocus();
753 }
754 
756 {
757  ListBox::Select();
758 
759  if ( !IsTravelSelect() )
760  {
761  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
762 
763  sal_uInt16 nPos = GetSelectedEntryPos();
764  // adjust array index for Ids after NID_PREV in aNavigationInsertIds
765  if ( nPos >= NID_COUNT/2 - 1 )
766  ++nPos;
767 
768  sal_uInt16 nMoveType = aNavigationInsertIds[nPos];
769  SwView::SetMoveType( nMoveType );
770 
771  css::uno::Sequence< css::beans::PropertyValue > aArgs;
772 
773  /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call.
774  This instance may be deleted in the meantime (i.e. when a dialog is opened
775  while in Dispatch()), accessing members will crash in this case. */
777 
778  m_pCtrl->dispatchCommand( aArgs );
779  }
780 }
781 
783 {
784  sal_uInt16 nMoveType = SwView::GetMoveType();
785  for ( size_t i = 0; i < SAL_N_ELEMENTS( aNavigationInsertIds ); ++i )
786  {
787  if ( nMoveType == aNavigationInsertIds[i] )
788  {
789  const char* id = aNavigationStrIds[i];
790  OUString sText = SwResId( id );
791  SelectEntry( sText );
792  break;
793  }
794  }
795 }
796 
798 {
799  bool bHandled = false;
800 
801  if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
802  {
803  sal_uInt16 nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
804 
805  switch ( nCode )
806  {
807  case KEY_RETURN:
808  case KEY_TAB:
809  {
810  if ( KEY_TAB == nCode )
811  m_bRelease = false;
812  else
813  bHandled = true;
814  Select();
815  break;
816  }
817 
818  case KEY_ESCAPE:
820  bHandled = true;
821  break;
822  }
823  }
824 
825  return bHandled || ListBox::EventNotify( rNEvt );
826 }
827 
828 NavElementToolBoxControl::NavElementToolBoxControl( const uno::Reference< uno::XComponentContext >& rxContext )
829  : svt::ToolboxController( rxContext,
830  uno::Reference< frame::XFrame >(),
831  ".uno:NavElement" ),
832  m_pBox( nullptr )
833 {
834 }
835 
836 // XInterface
837 css::uno::Any SAL_CALL NavElementToolBoxControl::queryInterface( const css::uno::Type& aType )
838 {
839  uno::Any a = ToolboxController::queryInterface( aType );
840  if ( a.hasValue() )
841  return a;
842 
843  return ::cppu::queryInterface( aType, static_cast< lang::XServiceInfo* >( this ) );
844 }
845 
846 void SAL_CALL NavElementToolBoxControl::acquire() throw ()
847 {
848  ToolboxController::acquire();
849 }
850 
851 void SAL_CALL NavElementToolBoxControl::release() throw ()
852 {
853  ToolboxController::release();
854 }
855 
856 // XServiceInfo
857 sal_Bool SAL_CALL NavElementToolBoxControl::supportsService( const OUString& ServiceName )
858 {
859  return cppu::supportsService( this, ServiceName );
860 }
861 
863 {
864  return OUString("lo.writer.NavElementToolBoxController");
865 }
866 
867 uno::Sequence< OUString > SAL_CALL NavElementToolBoxControl::getSupportedServiceNames()
868 {
869  uno::Sequence<OUString> aSNS { "com.sun.star.frame.ToolbarController" };
870  return aSNS;
871 }
872 
873 // XComponent
875 {
877 
878  SolarMutexGuard aSolarMutexGuard;
880 }
881 
882 // XStatusListener
883 void SAL_CALL NavElementToolBoxControl::statusChanged( const frame::FeatureStateEvent& rEvent )
884 {
885  if ( m_pBox )
886  {
887  SolarMutexGuard aSolarMutexGuard;
888  if ( rEvent.FeatureURL.Path == "NavElement" )
889  {
890  if ( rEvent.IsEnabled )
891  {
892  m_pBox->Enable();
893  m_pBox->Update();
894  }
895  else
896  m_pBox->Disable();
897  }
898  }
899 }
900 
901 // XToolbarController
902 void SAL_CALL NavElementToolBoxControl::execute( sal_Int16 /*KeyModifier*/ )
903 {
904 }
905 
907 {
908 }
909 
911 {
912 }
913 
914 uno::Reference< awt::XWindow > SAL_CALL NavElementToolBoxControl::createPopupWindow()
915 {
916  return uno::Reference< awt::XWindow >();
917 }
918 
919 uno::Reference< awt::XWindow > SAL_CALL NavElementToolBoxControl::createItemWindow(
920  const uno::Reference< awt::XWindow >& xParent )
921 {
922  uno::Reference< awt::XWindow > xItemWindow;
923 
924  VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
925  if ( pParent )
926  {
927  SolarMutexGuard aSolarMutexGuard;
929  xItemWindow = VCLUnoHelper::GetInterface( m_pBox );
930  }
931 
932  uno::Reference< util::XURLTransformer > xURLTransformer = getURLTransformer();
933 
934  return xItemWindow;
935 }
936 
938  const uno::Sequence< beans::PropertyValue >& rArgs )
939 {
940  uno::Reference< frame::XDispatchProvider > xDispatchProvider( m_xFrame, uno::UNO_QUERY );
941  if ( xDispatchProvider.is() )
942  {
943  util::URL aURL;
944  uno::Reference< frame::XDispatch > xDispatch;
945  uno::Reference< util::XURLTransformer > xURLTransformer = getURLTransformer();
946 
947  aURL.Complete = ".uno:NavElement";
948  xURLTransformer->parseStrict( aURL );
949  xDispatch = xDispatchProvider->queryDispatch( aURL, OUString(), 0 );
950  if ( xDispatch.is() )
951  xDispatch->dispatch( aURL, rArgs );
952  }
953 }
954 
955 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
957  css::uno::XComponentContext *rxContext,
958  css::uno::Sequence<css::uno::Any> const &)
959 {
960  return cppu::acquire( new NavElementToolBoxControl( rxContext ) );
961 }
962 
964  public css::lang::XServiceInfo
965 {
966 public:
967  enum Type { PREVIOUS, NEXT };
968 
969  PrevNextScrollToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, Type eType );
970 
971  // XInterface
972  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
973  virtual void SAL_CALL acquire() throw () override;
974  virtual void SAL_CALL release() throw () override;
975 
976  // XServiceInfo
977  virtual OUString SAL_CALL getImplementationName() override;
978  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
979  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
980 
981  // XComponent
982  virtual void SAL_CALL dispose() override;
983 
984  // XToolbarController
985  virtual void SAL_CALL execute( sal_Int16 /* KeyModifier */ ) override;
986  virtual void SAL_CALL click() override;
987 
988  // XStatusListener
989  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
990 
991 private:
992  Type const meType;
993 };
994 
995 PrevNextScrollToolboxController::PrevNextScrollToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, Type eType )
996  : svt::ToolboxController( rxContext,
997  css::uno::Reference< css::frame::XFrame >(),
998  (eType == PREVIOUS) ? OUString( ".uno:ScrollToPrevious" ): OUString( ".uno:ScrollToNext" ) ),
999  meType( eType )
1000 {
1001  addStatusListener(".uno:NavElement");
1002 }
1003 
1004 // XInterface
1005 css::uno::Any SAL_CALL PrevNextScrollToolboxController::queryInterface( const css::uno::Type& aType )
1006 {
1007  css::uno::Any a = ToolboxController::queryInterface( aType );
1008  if ( a.hasValue() )
1009  return a;
1010 
1011  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
1012 }
1013 
1015 {
1016  ToolboxController::acquire();
1017 }
1018 
1020 {
1021  ToolboxController::release();
1022 }
1023 
1024 // XServiceInfo
1026 {
1028  OUString( "lo.writer.PreviousScrollToolboxController" ) :
1029  OUString( "lo.writer.NextScrollToolboxController" );
1030 }
1031 
1032 sal_Bool SAL_CALL PrevNextScrollToolboxController::supportsService( const OUString& ServiceName )
1033 {
1034  return cppu::supportsService(this, ServiceName);
1035 }
1036 
1037 css::uno::Sequence< OUString > SAL_CALL PrevNextScrollToolboxController::getSupportedServiceNames()
1038 {
1039  return { "com.sun.star.frame.ToolbarController" };
1040 }
1041 
1042 // XComponent
1044 {
1045  SolarMutexGuard aSolarMutexGuard;
1046 
1048 }
1049 
1050 // XToolbarController
1051 void SAL_CALL PrevNextScrollToolboxController::execute( sal_Int16 /* KeyModifier */ )
1052 {
1053 }
1054 
1056 {
1057  uno::Sequence< beans::PropertyValue > rArgs;
1058 
1059  uno::Reference< frame::XDispatchProvider > xDispatchProvider( m_xFrame, uno::UNO_QUERY );
1060  if ( xDispatchProvider.is() )
1061  {
1062  util::URL aURL;
1063  uno::Reference< frame::XDispatch > xDispatch;
1064  uno::Reference< util::XURLTransformer > xURLTransformer = getURLTransformer();
1065 
1066  aURL.Complete = getCommandURL();
1067  xURLTransformer->parseStrict( aURL );
1068  xDispatch = xDispatchProvider->queryDispatch( aURL, OUString(), 0 );
1069  if ( xDispatch.is() )
1070  xDispatch->dispatch( aURL, rArgs );
1071  }
1072 }
1073 
1074 // XStatusListener
1075 void SAL_CALL PrevNextScrollToolboxController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
1076 {
1077  if ( rEvent.FeatureURL.Path == "NavElement" )
1078  {
1079  ToolBox* pToolBox = nullptr;
1080  sal_uInt16 nId = 0;
1081  if ( getToolboxId( nId, &pToolBox ) )
1083  SwScrollNaviPopup::GetToolTip( true ) ) );
1084  }
1085 }
1086 
1087 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1089  css::uno::XComponentContext *context,
1090  css::uno::Sequence<css::uno::Any> const &)
1091 {
1092  return cppu::acquire( new PrevNextScrollToolboxController( context, PrevNextScrollToolboxController::PREVIOUS ) );
1093 }
1094 
1095 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1097  css::uno::XComponentContext *context,
1098  css::uno::Sequence<css::uno::Any> const &)
1099 {
1100  return cppu::acquire( new PrevNextScrollToolboxController( context, PrevNextScrollToolboxController::NEXT ) );
1101 }
1102 
1103 /* 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:655
#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
sal_uInt16 GetBlockCount(size_t nGroup)
Definition: gloslst.cxx:193
bool hasValue()
#define HID_NID_MARK
Definition: helpids.h:130
void SetQuickHelpText(sal_uInt16 nItemId, const OUString &rText)
#define NID_GRF
Definition: workctrl.hxx:41
virtual void SAL_CALL release() override
Definition: workctrl.cxx:1019
#define NID_POSTIT
Definition: workctrl.hxx:47
virtual ~SwScrollNaviToolBox() override
Definition: workctrl.cxx:394
static sal_uInt16 GetMoveType()
Definition: viewmdi.cxx:652
#define HID_PVIEW_ZOOM_LB
Definition: helpids.h:122
virtual void SAL_CALL dispose() override
Definition: workctrl.cxx:874
#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
sal_Int32 GetSelectedEntryPos(sal_Int32 nSelIndex=0) const
virtual ~SwTbxAutoTextCtrl() override
Definition: workctrl.cxx:85
SwView * GetActiveView()
Definition: swmodul1.cxx:123
uno::Reference< frame::XFrame > m_xFrame
Definition: workctrl.cxx:716
#define NID_BKM
Definition: workctrl.hxx:40
#define KEY_TAB
#define FN_PREVIEW_ZOOM
Definition: cmdid.h:173
Edit * GetSubEdit() const
std::string GetValue
#define NID_MARK
Definition: workctrl.hxx:46
#define HID_NID_SRCH_REP
Definition: helpids.h:139
ToolBox & GetToolBox() const
void SetType(SvxZoomType eNewType)
void(* GlossarySetActGroup)(const OUString &rNewGroup)
Definition: swabstdlg.hxx:85
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:1096
#define HID_NID_PREV
Definition: helpids.h:133
sal_uInt16 const nSlotId
Definition: workctrl.cxx:609
const OUString & GetItemText(sal_uInt16 nItemId) const
#define NID_SEL
Definition: workctrl.hxx:44
#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()
void SaveValue()
#define HID_NID_TBL
Definition: helpids.h:124
PrevNextScrollToolboxController(const css::uno::Reference< css::uno::XComponentContext > &rxContext, Type eType)
Definition: workctrl.cxx:995
virtual void SetSizePixel(const Size &rNewSize)
#define NID_TABLE_FORMULA
Definition: workctrl.hxx:50
virtual void SAL_CALL click() override
Definition: workctrl.cxx:906
virtual void SAL_CALL acquire() override
Definition: workctrl.cxx:1014
virtual void dispose() override
Reference
sal_Int16 nId
#define NID_OUTL
Definition: workctrl.hxx:43
virtual void SAL_CALL doubleClick() override
Definition: workctrl.cxx:910
sal_uInt16 GetCode() const
#define HID_NID_GRF
Definition: helpids.h:126
size_t GetGroupCount()
Definition: gloslst.cxx:163
virtual OUString SAL_CALL getImplementationName() override
Definition: workctrl.cxx:1025
const KeyEvent * GetKeyEvent() const
virtual void statusChanged(const css::frame::FeatureStateEvent &rEvent) override
Definition: workctrl.cxx:428
sal_uInt16 Execute(vcl::Window *pWindow, const Point &rPopupPos)
#define HID_NID_REG
Definition: helpids.h:134
static SfxObjectShell * Current()
bool IsTravelSelect() const
#define HID_NID_NEXT
Definition: helpids.h:143
void SetHelpId(const OString &)
#define TOOLBOX_STYLE_FLAT
void SetItemText(sal_uInt16 nItemId, const OUString &rText)
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: workctrl.cxx:585
void SetValue(sal_uInt16 nTheValue)
void AddStatusListener(const OUString &rCommandURL)
static OUString GetToolTip(bool bNext)
Definition: workctrl.cxx:419
IMPL_STATIC_LINK(SwTbxAutoTextCtrl, PopupHdl, Menu *, pMenu, bool)
Definition: workctrl.cxx:144
NavElementToolBoxControl(const css::uno::Reference< css::uno::XComponentContext > &rServiceManager)
Definition: workctrl.cxx:828
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
#define NID_SRCH_REP
Definition: workctrl.hxx:48
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:956
void SelectEntry(const OUString &rStr, bool bSelect=true)
virtual ~SwJumpToSpecificPageControl() override
Definition: workctrl.cxx:652
sal_Int64 WinBits
void Enable(bool bEnable=true, bool bChild=true)
static OUStringLiteral const aNavigationImgIds[NAVI_ENTRIES]
Definition: workctrl.cxx:194
OUString SvxResId(const char *pId)
VclPtr< NavElementBox_Impl > m_pBox
Definition: workctrl.cxx:696
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: workctrl.cxx:1037
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:101
OUString GetBlockLongName(size_t nGroup, sal_uInt16 nBlock)
Definition: gloslst.cxx:204
OUString GetGroupName(size_t nPos)
Definition: gloslst.cxx:170
OUString GetBlockShortName(size_t nGroup, sal_uInt16 nBlock)
Definition: gloslst.cxx:215
SwScrollNaviPopup(sal_uInt16 nId, const css::uno::Reference< css::frame::XFrame > &rFrame, vcl::Window *pParent)
Definition: workctrl.cxx:317
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: workctrl.cxx:1005
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)
SwZoomBox_Impl(vcl::Window *pParent, sal_uInt16 nSlot)
Definition: workctrl.cxx:463
void addStatusListener(const OUString &aCommandURL)
#define HID_NID_SEL
Definition: helpids.h:136
virtual void SAL_CALL execute(sal_Int16 KeyModifier) override
Definition: workctrl.cxx:902
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
Definition: workctrl.cxx:883
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)
#define HID_NID_DRW
Definition: helpids.h:131
void dispatchCommand(const OUString &sCommandURL, const css::uno::Sequence< css::beans::PropertyValue > &rArgs, const OUString &rTarget=OUString())
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 dispatchCommand(const css::uno::Sequence< css::beans::PropertyValue > &rArgs)
Definition: workctrl.cxx:937
void EndSelection()
VclPtr< SwScrollNaviPopup > m_pNaviPopup
Definition: workctrl.hxx:74
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: workctrl.cxx:797
virtual void dispose() override
Definition: workctrl.cxx:399
SfxDispatcher * GetDispatcher() const
virtual void SAL_CALL release() override
Definition: workctrl.cxx:851
#define NID_INDEX_ENTRY
Definition: workctrl.hxx:49
#define NID_START
Definition: workctrl.hxx:31
NavElementToolBoxControl * m_pCtrl
Definition: workctrl.cxx:714
OUString GetGroupTitle(size_t nPos)
Definition: gloslst.cxx:182
sal_uInt16 const nSlotId
Definition: workctrl.cxx:447
virtual bool EventNotify(NotifyEvent &rNEvt) override
static SwGlossaryList * pGlossaryList
Definition: initui.cxx:45
virtual ~SwPreviewZoomControl() override
Definition: workctrl.cxx:581
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
bool IsTravelSelect() const
void SetItemBits(sal_uInt16 nItemId, ToolBoxItemBits nBits)
virtual OUString GetText() const override
virtual bool EventNotify(NotifyEvent &rNEvt) override
void CheckItem(sal_uInt16 nItemId, bool bCheck=true)
unsigned char sal_Bool
virtual void Select() override
Definition: workctrl.cxx:484
#define NID_REG
Definition: workctrl.hxx:39
#define NID_TABLE_FORMULA_ERROR
Definition: workctrl.hxx:51
sal_Int32 InsertEntry(const OUString &rStr, sal_Int32 nPos=LISTBOX_APPEND)
MouseNotifyEvent GetType() const
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: workctrl.cxx:636
vcl::Window * GetItemWindow(sal_uInt16 nItemId) const
WinBits const WB_DROPDOWN
#define NID_FTN
Definition: workctrl.hxx:45
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
SwJumpToSpecificBox_Impl(vcl::Window *pParent, sal_uInt16 nSlot)
Definition: workctrl.cxx:619
static void SetMoveType(sal_uInt16 nSet)
Definition: viewmdi.cxx:657
bool HasReadonlySel() const
Definition: crsrsh.cxx:3227
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:32
#define NID_DRW
Definition: workctrl.hxx:37
SwDocShell * GetDocShell()
Definition: view.cxx:1115
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)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: workctrl.cxx:857
void Disable(bool bChild=true)
bool IsReadOnly() const
VclPtr< SwScrollNaviToolBox > m_pToolBox
Definition: workctrl.hxx:91
void EnableAutocomplete(bool bEnable, bool bMatchCase=false)
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:1088
Point LogicToPixel(const Point &rLogicPt) const
static SfxItemState GetItemState(const SfxPoolItem *pState)
SwPreviewZoomControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx)
Definition: workctrl.cxx:573
OUString sQuickHelp[2 *NID_COUNT]
Definition: workctrl.hxx:94
#define KEY_RETURN
void ReleaseFocus_Impl()
Definition: workctrl.cxx:743
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: workctrl.cxx:837
#define NID_OLE
Definition: workctrl.hxx:42
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:495
const vcl::KeyCode & GetKeyCode() const
static vcl::Window * GetFocusWindow()
#define NID_PGE
Definition: workctrl.hxx:36
#define NID_CTRL
Definition: workctrl.hxx:38
static OUString formatPercent(double dNumber, const LanguageTag &rLangTag)
void SetLineCount(ImplToolItems::size_type nNewLines)
SfxItemState
#define NID_TBL
Definition: workctrl.hxx:34
virtual void Select() override
Definition: workctrl.cxx:755
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: workctrl.cxx:412
WinBits const WB_BORDER
virtual void SAL_CALL dispose() override
Definition: workctrl.cxx:1043
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override
Definition: workctrl.cxx:914
const OUString & getCommandURL() const
#define HID_NID_FRM
Definition: helpids.h:125
unsigned short GetId() const
WindowAlign GetAlign() const
const OUString & GetSavedValue() const
virtual void SAL_CALL execute(sal_Int16) override
Definition: workctrl.cxx:1051
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
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: workctrl.cxx:867
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:1614
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: workctrl.cxx:516
#define HID_NID_OLE
Definition: helpids.h:127
virtual VclPtr< vcl::Window > CreateItemWindow(vcl::Window *pParent) override
Definition: workctrl.cxx:601
void InsertBreak(ImplToolItems::size_type nPos=APPEND)
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &rEvent) override
Definition: workctrl.cxx:1075
sal_uInt16 GetItemId(ImplToolItems::size_type nPos) const
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow(const css::uno::Reference< css::awt::XWindow > &Parent) override
Definition: workctrl.cxx:919
NavElementBox_Impl(vcl::Window *pParent, const uno::Reference< frame::XFrame > &_xFrame, NavElementToolBoxControl &rCtrl)
Definition: workctrl.cxx:721
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
sal_Int32 InsertEntry(const OUString &rStr, sal_Int32 nPos=COMBOBOX_APPEND)
virtual OUString SAL_CALL getImplementationName() override
Definition: workctrl.cxx:862
void ReleaseFocus()
Definition: workctrl.cxx:553
void SetHelpId(sal_uInt16 nItemId, const OString &rHelpId)
virtual void SAL_CALL click() override
Definition: workctrl.cxx:1055
virtual void SAL_CALL acquire() override
Definition: workctrl.cxx:846
const css::uno::Reference< css::util::XURLTransformer > & getURLTransformer() const
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: workctrl.cxx:1032
virtual GlossarySetActGroup SetGlossaryActGroupFunc()=0
bool HasFocus() const
sal_Int32 nPos
virtual void SetText(const OUString &rStr) override
#define NID_PREV
Definition: workctrl.hxx:33
#define HID_NID_POSTIT
Definition: helpids.h:138
#define NID_FRM
Definition: workctrl.hxx:35
#define NID_COUNT
Definition: workctrl.hxx:52
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:405
Definition: view.hxx:146
SwJumpToSpecificPageControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx)
Definition: workctrl.cxx:645
VclPtr< FixedText > m_pInfoField
Definition: workctrl.hxx:92
virtual bool EventNotify(NotifyEvent &rNEvt) override
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
SwGlossaryList * GetGlossaryList()
Definition: initui.cxx:187