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