LibreOffice Module sw (master)  1
viewmdi.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 <sfx2/dispatch.hxx>
21 #include <sfx2/viewfrm.hxx>
22 #include <svx/ruler.hxx>
23 #include <editeng/lrspitem.hxx>
24 #include <svl/srchitem.hxx>
25 #include <svl/stritem.hxx>
26 #include <sfx2/request.hxx>
27 #include <swmodule.hxx>
28 #include <view.hxx>
29 #include <wrtsh.hxx>
30 #include <viewopt.hxx>
31 #include <frmatr.hxx>
32 #include <edtwin.hxx>
33 #include <pagedesc.hxx>
34 #include <IMark.hxx>
35 #include <fldbas.hxx>
36 #include <workctrl.hxx>
37 #include <usrpref.hxx>
38 #include <scroll.hxx>
39 #include <wview.hxx>
40 
41 #include <cmdid.h>
42 
43 #include <PostItMgr.hxx>
44 #include <AnnotationWin.hxx>
45 
46 #include <svx/srchdlg.hxx>
47 #include <svx/svdview.hxx>
48 
49 #include <vcl/uitest/logger.hxx>
51 
52 sal_uInt16 SwView::m_nMoveType = NID_PGE;
53 sal_Int32 SwView::m_nActMark = 0;
54 
55 using namespace ::com::sun::star::uno;
56 
57 namespace {
58 
59 void collectUIInformation(const OUString& aFactor)
60 {
61  EventDescription aDescription;
62  aDescription.aID = "writer_edit";
63  aDescription.aParameters = {{"ZOOM", aFactor}};
64  aDescription.aAction = "SET";
65  aDescription.aKeyWord = "SwEditWinUIObject";
66  aDescription.aParent = "MainWindow";
67  UITestLogger::getInstance().logEvent(aDescription);
68 }
69 
70 }
71 
72 void SwView::SetZoom( SvxZoomType eZoomType, short nFactor, bool bViewOnly )
73 {
74  bool const bCursorIsVisible(m_pWrtShell->IsCursorVisible());
75  SetZoom_( GetEditWin().GetOutputSizePixel(), eZoomType, nFactor, bViewOnly );
76  // fdo#40465 force the cursor to stay in view whilst zooming
77  if (bCursorIsVisible)
78  m_pWrtShell->ShowCursor();
79 
80  collectUIInformation(OUString::number(nFactor));
81 }
82 
83 void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
84  short nFactor, bool bViewOnly )
85 {
86  bool bUnLockView = !m_pWrtShell->IsViewLocked();
87  m_pWrtShell->LockView( true );
88  m_pWrtShell->LockPaint();
89 
90  { // start of SwActContext scope
91  SwActContext aActContext(m_pWrtShell.get());
92 
93  long nFac = nFactor;
94 
95  const bool bWeb = dynamic_cast< const SwWebView *>( this ) != nullptr;
96  SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(bWeb));
97 
98  const SwPageDesc &rDesc = m_pWrtShell->GetPageDesc( m_pWrtShell->GetCurPageDesc() );
99  const SvxLRSpaceItem &rLRSpace = rDesc.GetMaster().GetLRSpace();
100  const SwViewOption *pOpt = m_pWrtShell->GetViewOptions();
101  long lLeftMargin = 0;
102 
103  if( eZoomType != SvxZoomType::PERCENT )
104  {
105  const bool bAutomaticViewLayout = 0 == pOpt->GetViewLayoutColumns();
106 
107  const SwRect aPageRect( m_pWrtShell->GetAnyCurRect( CurRectType::PageCalc ) );
108  const SwRect aRootRect( m_pWrtShell->GetAnyCurRect( CurRectType::PagesArea ) );
109  Size aPageSize( aPageRect.SSize() );
110  Size aRootSize( aRootRect.SSize() );
111 
112  //mod #i6193# added sidebar width
113  SwPostItMgr* pPostItMgr = GetPostItMgr();
114  if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes())
115  aPageSize.AdjustWidth(pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() );
116 
117  const MapMode aTmpMap( MapUnit::MapTwip );
118  const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
119 
120  if( UseOnPage::Mirror == rDesc.GetUseOn() ) // mirrored pages
121  {
122  const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace();
123  aPageSize.AdjustWidth(std::abs( rLeftLRSpace.GetLeft() - rLRSpace.GetLeft() ) );
124  }
125 
126  if( SvxZoomType::OPTIMAL == eZoomType )
127  {
128  if (!pPostItMgr->HasNotes() || !pPostItMgr->ShowNotes())
129  aPageSize.AdjustWidth( -( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 ) );
130  lLeftMargin = rLRSpace.GetLeft() + DOCUMENTBORDER + nLeftOfst;
131  nFac = aWindowSize.Width() * 100 / aPageSize.Width();
132  }
133  else if(SvxZoomType::WHOLEPAGE == eZoomType || SvxZoomType::PAGEWIDTH == eZoomType )
134  {
135  const long nOf = DOCUMENTBORDER * 2;
136  long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
137  nTmpWidth += nOf;
138  aPageSize.AdjustHeight(nOf );
139  nFac = aWindowSize.Width() * 100 / nTmpWidth;
140 
141  if ( SvxZoomType::WHOLEPAGE == eZoomType )
142  {
143  long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
144  nFac = std::min( nFac, nVisPercent );
145  }
146  }
147  else
148  {
149  const long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
150  nFac = aWindowSize.Width() * 100 / nTmpWidth;
151  }
152  }
153 
154  nFac = std::max( long( MINZOOM ), nFac );
155  const sal_uInt16 nZoomFac = static_cast<sal_uInt16>(nFac);
156 
157  SwViewOption aOpt( *pOpt );
158  if ( !GetViewFrame()->GetFrame().IsInPlace() )
159  {
160  //Update MasterUsrPrefs and after that update the ViewOptions of the current View.
161  if ( !bViewOnly &&
162  (nZoomFac != pUsrPref->GetZoom() ||
163  eZoomType != pUsrPref->GetZoomType()) )
164  {
165  pUsrPref->SetZoom(nZoomFac);
166  pUsrPref->SetZoomType(eZoomType);
167  SW_MOD()->ApplyUsrPref(*pUsrPref, nullptr);
168  pUsrPref->SetModified();
169  }
170  if ( pOpt->GetZoom() != nZoomFac )
171  {
172  aOpt.SetZoom(nZoomFac);
173  aOpt.SetReadonly(pOpt->IsReadonly());
174  m_pWrtShell->ApplyViewOptions( aOpt );
175  }
176  if ( eZoomType != SvxZoomType::PERCENT )
177  {
178  Point aPos;
179 
180  if ( eZoomType == SvxZoomType::WHOLEPAGE )
181  aPos.setY( m_pWrtShell->GetAnyCurRect(CurRectType::Page).Top() - DOCUMENTBORDER );
182  else
183  {
184  // Make sure that the cursor is in the visible range, so that
185  // the scrolling will be performed only once.
186  aPos.setX( lLeftMargin );
187  const SwRect &rCharRect = m_pWrtShell->GetCharRect();
188  if ( rCharRect.Top() > GetVisArea().Bottom() ||
189  rCharRect.Bottom() < aPos.Y() )
190  aPos.setY( rCharRect.Top() - rCharRect.Height() );
191  else
192  aPos.setY( GetVisArea().Top() );
193  }
194  SetVisArea( aPos );
195  }
196  // Compromise solution - Under certain circumstances SetZoom is called
197  // in CalcVisAreas again and thus be set wrong values.
198  const_cast<SwViewOption*>(m_pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
199  CalcVisArea( rEditSize ); // for the recalculation of the viewable area
200  }
201  else if ( nZoomFac != pOpt->GetZoom() )
202  {
203  aOpt.SetZoom( nZoomFac );
204  m_pWrtShell->ApplyViewOptions( aOpt );
205  }
206 
207  const Fraction aFrac( nFac, 100 );
208  m_pVRuler->SetZoom( aFrac );
210  m_pHRuler->SetZoom( aFrac );
212  const_cast<SwViewOption*>(m_pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
213  } // end of SwActContext scope
214 
215  m_pWrtShell->UnlockPaint();
216  if( bUnLockView )
217  m_pWrtShell->LockView( false );
218 }
219 
220 void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly )
221 {
222  const bool bUnLockView = !m_pWrtShell->IsViewLocked();
223  m_pWrtShell->LockView( true );
224  m_pWrtShell->LockPaint();
225 
226  {
227 
228  SwActContext aActContext(m_pWrtShell.get());
229 
230  if ( !GetViewFrame()->GetFrame().IsInPlace() && !bViewOnly )
231  {
232  const bool bWeb = dynamic_cast< const SwWebView *>( this ) != nullptr;
233  SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(bWeb));
234 
235  // Update MasterUsrPrefs and after that update the ViewOptions of the current View.
236  if ( nColumns != pUsrPref->GetViewLayoutColumns() ||
237  bBookMode != pUsrPref->IsViewLayoutBookMode() )
238  {
239  pUsrPref->SetViewLayoutColumns(nColumns);
240  pUsrPref->SetViewLayoutBookMode(bBookMode);
241  SW_MOD()->ApplyUsrPref(*pUsrPref, nullptr);
242  pUsrPref->SetModified();
243  }
244  }
245 
246  const SwViewOption *pOpt = m_pWrtShell->GetViewOptions();
247 
248  if ( nColumns != pOpt->GetViewLayoutColumns() ||
249  bBookMode != pOpt->IsViewLayoutBookMode() )
250  {
251  SwViewOption aOpt( *pOpt );
252  aOpt.SetViewLayoutColumns( nColumns );
253  aOpt.SetViewLayoutBookMode( bBookMode );
254  m_pWrtShell->ApplyViewOptions( aOpt );
255  }
256 
259 
260  }
261 
262  m_pWrtShell->UnlockPaint();
263  if( bUnLockView )
264  m_pWrtShell->LockView( false );
265 
266  SfxBindings& rBnd = GetViewFrame()->GetBindings();
267  rBnd.Invalidate( SID_ATTR_VIEWLAYOUT );
268  rBnd.Invalidate( SID_ATTR_ZOOMSLIDER);
269 }
270 
271 // Scrollbar - Handler
272 
273 IMPL_LINK( SwView, WindowChildEventListener, VclWindowEvent&, rEvent, void )
274 {
275  OSL_ENSURE( rEvent.GetWindow(), "Window???" );
276  vcl::Window* pChildWin = static_cast< vcl::Window* >( rEvent.GetData() );
277 
278  switch ( rEvent.GetId() )
279  {
280  case VclEventId::WindowHide:
281  if( pChildWin == m_pHScrollbar )
282  ShowHScrollbar( false );
283  else if( pChildWin == m_pVScrollbar )
284  ShowVScrollbar( false );
285  break;
286  case VclEventId::WindowShow:
287  if( pChildWin == m_pHScrollbar )
288  ShowHScrollbar( true );
289  else if( pChildWin == m_pVScrollbar )
290  ShowVScrollbar( true );
291  break;
292  default: break;
293  }
294 }
295 
296 void SwView::CreateScrollbar( bool bHori )
297 {
298  vcl::Window *pMDI = &GetViewFrame()->GetWindow();
299  VclPtr<SwScrollbar>& ppScrollbar = bHori ? m_pHScrollbar : m_pVScrollbar;
300 
301  assert(!ppScrollbar.get()); //check beforehand!
302 
303  ppScrollbar = VclPtr<SwScrollbar>::Create( pMDI, bHori );
305  if(bHori)
306  ppScrollbar->SetScrollHdl( LINK( this, SwView, EndScrollHdl ));
307  else
308  ppScrollbar->SetScrollHdl( LINK( this, SwView, ScrollHdl ));
309  ppScrollbar->SetEndScrollHdl( LINK( this, SwView, EndScrollHdl ));
310 
311  ppScrollbar->EnableDrag();
312 
313  if(GetWindow())
315 
316  if (!m_bShowAtResize)
317  ppScrollbar->ExtendedShow();
318 }
319 
320 IMPL_LINK( SwView, MoveNavigationHdl, void*, p, void )
321 {
322  bool* pbNext = static_cast<bool*>(p);
323  if ( !pbNext )
324  return;
325  const bool bNext = *pbNext;
326  SwWrtShell& rSh = GetWrtShell();
327  if ( NID_SRCH_REP != m_nMoveType)
328  {
329  if ( rSh.GetDrawView()->IsTextEdit() )
330  rSh.EndTextEdit();
331  if ( IsDrawMode() )
332  LeaveDrawCreate();
333  }
334  if ( NID_POSTIT != m_nMoveType && m_pPostItMgr )
335  {
336  sw::annotation::SwAnnotationWin* pActiveSidebarWin = m_pPostItMgr->GetActiveSidebarWin();
337  if (pActiveSidebarWin)
338  pActiveSidebarWin->SwitchToFieldPos();
339  }
340  switch( m_nMoveType )
341  {
342  case NID_PGE:
343  if ( bNext )
344  {
345  if ( USHRT_MAX == rSh.GetNextPrevPageNum( true ) )
346  {
347  rSh.GotoPage( 1, true );
348  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::EndWrapped );
349  }
350  else
351  {
352  PhyPageDown();
353  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
354  }
355  }
356  else
357  {
358  if ( USHRT_MAX == rSh.GetNextPrevPageNum( false ) )
359  {
360  rSh.GotoPage( rSh.GetPageCnt(), true );
361  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::StartWrapped );
362  }
363  else
364  {
365  PhyPageUp();
366  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
367  }
368  }
369  break;
370  case NID_TBL :
371  rSh.EnterStdMode();
372  if(bNext)
374  else
376  break;
377  case NID_FRM :
378  case NID_GRF:
379  case NID_OLE:
380  {
382  if(m_nMoveType == NID_GRF)
383  eType = GotoObjFlags::FlyGrf;
384  else if(m_nMoveType == NID_OLE)
385  eType = GotoObjFlags::FlyOLE;
386  bool bSuccess = bNext ?
387  rSh.GotoNextFly(eType) :
388  rSh.GotoPrevFly(eType);
389  if(bSuccess)
390  {
391  rSh.HideCursor();
392  rSh.EnterSelFrameMode();
393  }
394  }
395  break;
396  case NID_CTRL:
397  if (!rSh.GetView().IsDesignMode())
398  rSh.GetView().GetFormShell()->SetDesignMode(true);
399  [[fallthrough]];
400  case NID_DRW:
401  {
402  bool bSuccess = rSh.GotoObj(bNext,
403  m_nMoveType == NID_DRW ?
406  if(bSuccess)
407  {
408  rSh.HideCursor();
409  rSh.EnterSelFrameMode();
410  }
411  }
412  break;
413  case NID_REG :
414  rSh.EnterStdMode();
415  if(bNext)
417  else
419 
420  break;
421  case NID_BKM :
422  rSh.EnterStdMode();
423  GetViewFrame()->GetDispatcher()->Execute(bNext ?
426  break;
427  case NID_OUTL:
428  rSh.EnterStdMode();
429  bNext ? rSh.GotoNextOutline() : rSh.GotoPrevOutline();
430  break;
431  case NID_SEL :
433  break;
434  case NID_FTN:
435  {
436  bool bFrameTypeFootnote(rSh.GetFrameType(nullptr, false) & FrameTypeFlags::FOOTNOTE);
437 
438  if (bFrameTypeFootnote)
439  {
440  rSh.LockView(true);
441  rSh.GotoFootnoteAnchor();
442  }
443 
444  rSh.EnterStdMode();
445  bNext ?
446  rSh.GotoNextFootnoteAnchor() :
448 
449  if (bFrameTypeFootnote)
450  {
451  rSh.LockView(false);
452  rSh.GotoFootnoteText();
453  }
454  }
455  break;
456  case NID_MARK:
457  {
458  // unselect
459  rSh.MoveCursor();
460  rSh.EnterStdMode();
461 
462  // collect and sort navigator reminder names
463  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
464  std::vector< OUString > vNavMarkNames;
465  for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAllMarksBegin();
466  ppMark != pMarkAccess->getAllMarksEnd();
467  ++ppMark)
468  {
470  vNavMarkNames.push_back((*ppMark)->GetName());
471  }
472  std::sort(vNavMarkNames.begin(), vNavMarkNames.end());
473 
474  // move
475  if(!vNavMarkNames.empty())
476  {
477  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
478 
479  if(bNext)
480  {
481  m_nActMark++;
482  if (m_nActMark >= MAX_MARKS || m_nActMark >= static_cast<sal_Int32>(vNavMarkNames.size()))
483  {
484  m_nActMark = 0;
485  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::ReminderEndWrapped );
486  }
487  }
488  else
489  {
490  m_nActMark--;
491  if (m_nActMark < 0 || m_nActMark >= static_cast<sal_Int32>(vNavMarkNames.size()))
492  {
493  m_nActMark = vNavMarkNames.size()-1;
494  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::ReminderStartWrapped );
495  }
496  }
497  rSh.GotoMark(vNavMarkNames[m_nActMark]);
498  }
499  else
500  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
501  }
502  break;
503 
504  case NID_POSTIT:
505  {
506  if ( m_pPostItMgr->HasNotes() )
507  {
508  rSh.EnterStdMode();
509  sw::annotation::SwAnnotationWin* pPostIt = GetPostItMgr()->GetActiveSidebarWin();
510  if (pPostIt)
511  GetPostItMgr()->SetActiveSidebarWin(nullptr);
512  SwFieldType* pFieldType = rSh.GetFieldType(0, SwFieldIds::Postit);
513  if ( !rSh.MoveFieldType( pFieldType, bNext ) )
514  {
515  bNext ? (*(m_pPostItMgr->begin()))->pPostIt->GotoPos() :
516  (*(m_pPostItMgr->end()-1))->pPostIt->GotoPos();
517  SvxSearchDialogWrapper::SetSearchLabel( bNext ? SearchLabel::EndWrapped : SearchLabel::StartWrapped );
518  }
519  else
520  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::Empty );
521  GetViewFrame()->GetDispatcher()->Execute(FN_POSTIT);
522  }
523  else
524  SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::NavElementNotFound );
525  }
526  break;
527 
528  case NID_SRCH_REP:
529  if(s_pSrchItem)
530  {
531  bool bBackward = s_pSrchItem->GetBackward();
532  if (rSh.HasSelection() && bNext != rSh.IsCursorPtAtEnd())
533  rSh.SwapPam();
534  s_pSrchItem->SetBackward(!bNext);
535  SfxRequest aReq(FN_REPEAT_SEARCH, SfxCallMode::SLOT, GetPool());
536  ExecSearch(aReq);
537  s_pSrchItem->SetBackward(bBackward);
538  }
539  break;
540  case NID_INDEX_ENTRY:
541  rSh.GotoNxtPrvTOXMark(bNext);
542  break;
543 
544  case NID_TABLE_FORMULA:
545  rSh.GotoNxtPrvTableFormula( bNext );
546  break;
547 
549  rSh.GotoNxtPrvTableFormula( bNext, true );
550  break;
551  }
552  m_pEditWin->GrabFocus();
553  delete pbNext;
554 }
555 
557 {
559 
560  m_pHRuler->Show();
562 }
563 
565 {
566  m_pHRuler->Hide();
568 }
569 
571 {
572  if(m_pHRuler->GetUnit() != eUnit )
573  {
574  m_pHRuler->SetUnit( eUnit );
575  m_pHRuler->Invalidate();
576  }
577 }
578 
580 {
581  if(m_pVRuler->GetUnit() != eUnit)
582  {
583  m_pVRuler->SetUnit( eUnit );
584  m_pVRuler->Invalidate();
585  }
586 }
587 
588 void SwView::GetVRulerMetric(FieldUnit& eToFill) const
589 {
590  eToFill = m_pVRuler->GetUnit();
591 }
592 
593 void SwView::GetHRulerMetric(FieldUnit& eToFill) const
594 {
595  eToFill = m_pHRuler->GetUnit();
596 }
597 
599 {
600  m_pHRuler->SetBorderPos( m_pVRuler->GetSizePixel().Width()-1 );
601 
603  m_pVRuler->Show();
605 }
606 
608 {
609  m_pVRuler->Hide();
610  m_pHRuler->SetBorderPos();
612 }
613 
614 IMPL_LINK( SwView, ExecRulerClick, Ruler *, pRuler, void )
615 {
616  OUString sDefPage;
617  sal_uInt16 nDefDlg = SID_PARA_DLG;
618  switch( pRuler->GetClickType() )
619  {
620  case RulerType::DontKnow:
621  case RulerType::Outside:
622  sDefPage="labelTP_BORDER";
623  break;
624  case RulerType::Indent:
625  sDefPage="labelTP_PARA_STD";
626  break;
627  case RulerType::Margin1:
628  case RulerType::Margin2:
629  nDefDlg= FN_FORMAT_PAGE_DLG;
630  sDefPage = "page";
631  break;
632  default:
633  sDefPage = "labelTP_TABULATOR";
634 
635  }
636 
637  SfxStringItem aDefPage(nDefDlg, sDefPage);
638  GetViewFrame()->GetDispatcher()->ExecuteList(nDefDlg,
639  SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
640  { &aDefPage });
641 }
642 
644 {
645  return m_nMoveType;
646 }
647 
648 void SwView::SetMoveType(sal_uInt16 nSet)
649 {
650  m_nMoveType = nSet;
651 }
652 
653 void SwView::SetActMark(sal_Int32 nSet)
654 {
655  m_nActMark = nSet;
656 }
657 
658 void SwView::ShowHScrollbar(bool bShow)
659 {
660  assert(m_pHScrollbar && "Scrollbar invalid");
661  m_pHScrollbar->ExtendedShow(bShow);
662 }
663 
665 {
666  assert(m_pHScrollbar && "Scrollbar invalid");
667  return m_pHScrollbar->IsVisible( false ) || m_pHScrollbar->IsAuto();
668 }
669 
670 void SwView::ShowVScrollbar(bool bShow)
671 {
672  assert(m_pVScrollbar && "Scrollbar invalid");
673  m_pVScrollbar->ExtendedShow(bShow);
674 }
675 
677 {
678  assert(m_pVScrollbar && "Scrollbar invalid");
679  return m_pVScrollbar->IsVisible( false );
680 }
681 
682 void SwView::EnableHScrollbar(bool bEnable)
683 {
684  if (m_bHScrollbarEnabled != bEnable)
685  {
686  m_bHScrollbarEnabled = bEnable;
688  }
689 }
690 
691 void SwView::EnableVScrollbar(bool bEnable)
692 {
693  if (m_bVScrollbarEnabled != bEnable)
694  {
695  m_bVScrollbarEnabled = bEnable;
697  }
698 }
699 
700 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
Definition: edfld.cxx:64
long GetLeft() const
SfxViewFrame * GetViewFrame() const
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:240
long Width() const
#define MINZOOM
Definition: view.hxx:82
FieldUnit
#define NID_GRF
Definition: workctrl.hxx:38
void SetActive(bool bOn=true)
void GetHRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:593
void SetReadonly(bool bSet)
Definition: viewopt.hxx:436
#define NID_POSTIT
Definition: workctrl.hxx:44
static sal_uInt16 GetMoveType()
Definition: viewmdi.cxx:643
SdrView * GetDrawView()
Definition: vnew.cxx:375
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:218
SfxViewFrame * GetFrame() const
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:478
#define NID_BKM
Definition: workctrl.hxx:37
bool GotoPrevTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
Definition: trvltbl.cxx:480
sal_uInt16 GetNextPrevPageNum(bool bNext=true)
Definition: crsrsh.cxx:1244
bool GotoNextFootnoteAnchor()
Definition: trvlfnfl.cxx:327
#define NID_MARK
Definition: workctrl.hxx:43
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:183
void SetViewLayout(sal_uInt16 nColumns, bool bBookMode, bool bViewOnly=false)
Definition: viewmdi.cxx:220
long Height() const
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:570
bool MoveFieldType(const SwFieldType *pFieldType, const bool bNext, const SwFieldIds nResType=SwFieldIds::Unknown, const bool bAddSetExpressionFieldsToInputFields=true)
Definition: crstrvl.cxx:714
#define NID_SEL
Definition: workctrl.hxx:41
VclPtr< SvxRuler > m_pHRuler
Definition: view.hxx:200
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
Definition: docbm.cxx:474
Provides access to the marks of a document.
void SetViewLayoutColumns(sal_uInt16 nNew)
Definition: viewopt.hxx:454
#define NID_TABLE_FORMULA
Definition: workctrl.hxx:47
void Height(long nNew)
Definition: swrect.hxx:189
#define NID_OUTL
Definition: workctrl.hxx:40
bool GotoFootnoteAnchor()
jump from footnote to anchor
Definition: trvlfnfl.cxx:156
void EnterStdMode()
Definition: select.cxx:550
SwEditWin & GetEditWin()
Definition: view.hxx:403
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
void Invalidate(sal_uInt16 nId)
bool GotoNxtPrvTableFormula(bool bNext=true, bool bOnlyErrors=false)
Jump to next/previous table formula Optionally it is possible to also jump to broken formulas...
Definition: crstrvl.cxx:416
bool GotoNextFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
Independent selecting of flys.
Definition: fesh.hxx:413
UseOnPage GetUseOn() const
Definition: pagedesc.hxx:332
void SetVisArea(const tools::Rectangle &, bool bUpdateScrollbar=true)
Definition: viewport.cxx:195
#define NID_SRCH_REP
Definition: workctrl.hxx:45
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:518
void SwapPam()
Definition: crsrsh.cxx:967
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
bool IsAuto() const
Definition: scroll.hxx:49
vcl::Window & GetWindow() const
bool IsReadonly() const
Definition: viewopt.hxx:435
const SwView & GetView() const
Definition: wrtsh.hxx:428
void InvalidateBorder()
void Top(const long nTop)
Definition: swrect.hxx:202
bool m_bVScrollbarEnabled
Definition: view.hxx:195
bool IsVisible(bool bReal) const
Definition: scroll.hxx:39
void setX(long nX)
bool GotoFootnoteText()
jump from content to footnote
Definition: trvlfnfl.cxx:83
SfxFrame & GetFrame() const
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2582
SAL_DLLPRIVATE void SetZoom_(const Size &rEditSz, SvxZoomType eZoomType, short nFactor, bool bViewOnly)
Definition: viewmdi.cxx:83
void setY(long nY)
void CreateVRuler()
Definition: viewmdi.cxx:598
void KillVRuler()
Definition: viewmdi.cxx:607
#define FN_NEXT_BOOKMARK
Definition: cmdid.h:113
GotoObjFlags
values can be combined via logical or
Definition: fesh.hxx:86
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
virtual bool IsDesignMode() const
Class for automated call of Start- and EndAction().
Definition: editsh.hxx:1020
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:565
void SetZoomType(SvxZoomType eZoom_)
Definition: viewopt.hxx:544
bool HasSelection() const
Definition: wrtsh.hxx:141
#define SW_MOD()
Definition: swmodule.hxx:256
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
#define NID_INDEX_ENTRY
Definition: workctrl.hxx:46
sal_uInt16 GetPageCnt()
Definition: crsrsh.cxx:1282
bool IsViewLayoutBookMode() const
Definition: viewopt.hxx:451
static sal_Int32 m_nActMark
Definition: view.hxx:157
const long nLeftOfst
Definition: view.hxx:78
bool GoNextPrevCursorSetSearchLabel(const bool bNext)
Definition: crsrsh.cxx:1385
SfxBindings & GetBindings()
long Bottom() const
#define NID_REG
Definition: workctrl.hxx:36
#define NID_TABLE_FORMULA_ERROR
Definition: workctrl.hxx:48
void ShowVScrollbar(bool bShow)
Definition: viewmdi.cxx:670
bool GotoPrevOutline()
jump to previous node with outline num.
Definition: crstrvl.cxx:1092
bool IsHScrollbarVisible() const
Definition: viewmdi.cxx:664
#define NID_FTN
Definition: workctrl.hxx:42
static void SetMoveType(sal_uInt16 nSet)
Definition: viewmdi.cxx:648
IMPL_LINK(SwView, WindowChildEventListener, VclWindowEvent &, rEvent, void)
Definition: viewmdi.cxx:273
DocumentType const eType
void EnableHScrollbar(bool bEnable)
Definition: viewmdi.cxx:682
void CreateTab()
Definition: viewmdi.cxx:556
VclPtr< SvxRuler > m_pVRuler
Definition: view.hxx:200
static void SetSearchLabel(const SearchLabel &rSL)
SAL_DLLPRIVATE void CalcVisArea(const Size &rPixelSz)
Definition: viewport.cxx:764
#define NID_DRW
Definition: workctrl.hxx:34
void ShowHScrollbar(bool bShow)
Definition: viewmdi.cxx:658
bool GotoPrevFootnoteAnchor()
Definition: trvlfnfl.cxx:332
Rect of current page.
bool GotoObj(bool bNext, GotoObjFlags eType=GotoObjFlags::DrawAny)
Definition: feshview.cxx:1650
void EnableVScrollbar(bool bEnable)
Definition: viewmdi.cxx:691
void SetDesignMode(bool _bDesignMode)
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
#define NID_OLE
Definition: workctrl.hxx:39
void GotoMark(const ::sw::mark::IMark *const pMark)
Definition: wrtsh3.cxx:133
bool GotoNextRegion(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosRegion, bool bInReadOnly)
Definition: trvlreg.cxx:104
void SetZoom(SvxZoomType eZoomType, short nFactor=100, bool bViewOnly=false)
Definition: viewmdi.cxx:72
void Bottom(const long nBottom)
Definition: swrect.hxx:207
#define NID_PGE
Definition: workctrl.hxx:33
bool MoveRegion(SwWhichRegion, SwMoveFnCollection const &)
Definition: trvlreg.cxx:232
void SetViewLayoutBookMode(bool bNew)
Definition: viewopt.hxx:452
#define NID_CTRL
Definition: workctrl.hxx:35
VclPtr< SwScrollbar > m_pVScrollbar
Definition: view.hxx:191
virtual bool IsTextEdit() const final override
bool GotoPrevFly(GotoObjFlags eType=GotoObjFlags::FlyAny)
Definition: fesh.hxx:415
#define NID_TBL
Definition: workctrl.hxx:31
Rect covering the pages area.
SwMoveFnCollection const & fnTableStart
Definition: paminit.cxx:52
void MoveCursor(bool bWithSelect=false)
Definition: move.cxx:70
bool IsInPlace() const
bool m_bShowAtResize
Definition: view.hxx:229
bool IsVScrollbarVisible() const
Definition: viewmdi.cxx:676
void LockView(bool b)
Definition: viewsh.hxx:465
bool MoveTable(SwWhichTable, SwMoveFnCollection const &)
Definition: trvltbl.cxx:681
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:898
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:253
... page will be formatted if required.
static VclPtr< reference_type > Create(Arg &&...arg)
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:579
VclPtr< SwScrollbar > m_pHScrollbar
Definition: view.hxx:191
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:623
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:477
void EndTextEdit()
Deletes object if required.
Definition: feshview.cxx:1218
void * p
static sal_uInt16 m_nMoveType
Definition: view.hxx:156
#define FN_FORMAT_PAGE_DLG
Definition: cmdid.h:310
vcl::Window * GetWindow() const
void GetVRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:588
long GetRight() const
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:413
bool GotoPrevRegion(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosRegion, bool bInReadOnly)
Definition: trvlreg.cxx:31
bool IsActive() const
#define FN_REPEAT_SEARCH
Definition: cmdid.h:103
bool GotoPage(sal_uInt16 nPage, bool bRecord)
Definition: move.cxx:569
reference_type * get() const
bool GotoNxtPrvTOXMark(bool bNext=true)
jump to next/previous index marker
Definition: crstrvl.cxx:531
SAL_DLLPRIVATE bool UpdateScrollbars()
Definition: viewport.cxx:1151
bool GotoNextTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
Definition: trvltbl.cxx:560
void SetModified()
Definition: usrpref.hxx:157
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
Definition: select.cxx:701
SvxZoomType
void ForceUpdate()
void KillTab()
Definition: viewmdi.cxx:564
std::map< OUString, OUString > aParameters
void ExtendedShow(bool bVisible=true)
Definition: scroll.cxx:74
#define DOCUMENTBORDER
Definition: swtypes.hxx:82
#define FN_PREV_BOOKMARK
Definition: cmdid.h:114
SAL_DLLPRIVATE void CreateScrollbar(bool bHori)
Definition: viewmdi.cxx:296
bool m_bHScrollbarEnabled
Definition: view.hxx:194
#define MAX_MARKS
Definition: view.hxx:85
#define NID_FRM
Definition: workctrl.hxx:32
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:236
sal_uInt16 GetViewLayoutColumns() const
Definition: viewopt.hxx:453
#define FN_POSTIT
Definition: cmdid.h:208
void HideCursor()
Definition: crsrsh.cxx:2397
Definition: view.hxx:146
long Y() const
static void SetActMark(sal_Int32 nSet)
Definition: viewmdi.cxx:653
bool GotoNextOutline()
jump to next node with outline num.
Definition: crstrvl.cxx:1026
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
SwMoveFnCollection const & fnRegionStart
Definition: paminit.cxx:55