LibreOffice Module sw (master)  1
pview.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 <config_wasm_strip.h>
21 
22 #include <sfx2/objface.hxx>
23 #include <vcl/help.hxx>
24 #include <vcl/commandevent.hxx>
25 #include <vcl/settings.hxx>
26 #include <vcl/svapp.hxx>
27 #include <vcl/syswin.hxx>
28 #include <vcl/weld.hxx>
29 
30 #include <svl/whiter.hxx>
31 #include <svl/slstitm.hxx>
32 #include <svl/eitem.hxx>
33 #include <sfx2/printer.hxx>
34 #include <sfx2/bindings.hxx>
35 #include <sfx2/request.hxx>
36 #include <sfx2/dispatch.hxx>
37 #include <editeng/paperinf.hxx>
38 #include <svx/svdview.hxx>
39 #include <svx/zoomslideritem.hxx>
40 #include <tools/svborder.hxx>
41 #include <osl/diagnose.h>
42 
43 #include <globdoc.hxx>
44 #include <wdocsh.hxx>
45 #include <pvprtdat.hxx>
46 #include <swmodule.hxx>
47 #include <wrtsh.hxx>
48 #include <docsh.hxx>
49 #include <viewopt.hxx>
50 #include <doc.hxx>
52 #include <pview.hxx>
53 #include <view.hxx>
54 #include <scroll.hxx>
55 #include <prtopt.hxx>
56 #include <usrpref.hxx>
57 #include "viewfunc.hxx"
58 
59 #include <helpids.h>
60 #include <cmdid.h>
61 #include <strings.hrc>
62 
63 #define ShellClass_SwPagePreview
64 #include <sfx2/msg.hxx>
65 #include <swslots.hxx>
66 #include <pagepreviewlayout.hxx>
67 
68 #include <svx/svxdlg.hxx>
69 
70 #include <memory>
71 #include <vcl/EnumContext.hxx>
73 
74 using namespace ::com::sun::star;
76 {
80 }
81 
83 
84 void SwPagePreview::InitInterface_Impl()
85 {
86  GetStaticInterface()->RegisterPopupMenu("preview");
87  GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
88  SfxVisibilityFlags::Standard|SfxVisibilityFlags::Client|SfxVisibilityFlags::FullScreen|SfxVisibilityFlags::ReadonlyDoc,
89  ToolbarId::PView_Toolbox);
90 }
91 
92 
93 #define SWVIEWFLAGS SfxViewShellFlags::HAS_PRINTOPTIONS
94 
95 #define MIN_PREVIEW_ZOOM 25
96 #define MAX_PREVIEW_ZOOM 600
97 
98 static sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, bool bZoomIn)
99 {
100  static const sal_uInt16 aZoomArr[] =
101  {
102  25, 50, 75, 100, 150, 200, 400, 600
103  };
104  const int nZoomArrSize = static_cast<int>(SAL_N_ELEMENTS(aZoomArr));
105  if (bZoomIn)
106  {
107  for(sal_uInt16 i : aZoomArr)
108  {
109  if(nCurrentZoom < i)
110  return i;
111  }
112  }
113  else
114  {
115  for(int i = nZoomArrSize - 1; i >= 0; --i)
116  {
117  if(nCurrentZoom > aZoomArr[i] || !i)
118  return aZoomArr[i];
119  }
120  }
121  return bZoomIn ? MAX_PREVIEW_ZOOM : MIN_PREVIEW_ZOOM;
122 };
123 
124 static void lcl_InvalidateZoomSlots(SfxBindings& rBindings)
125 {
126  static sal_uInt16 const aInval[] =
127  {
128  SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN, SID_ATTR_ZOOMSLIDER, FN_PREVIEW_ZOOM, FN_STAT_ZOOM,
129  0
130  };
131  rBindings.Invalidate( aInval );
132 }
133 
134 namespace {
135 
136 // At first the zoom dialog
137 class SwPreviewZoomDlg : public weld::GenericDialogController
138 {
140  std::unique_ptr<weld::SpinButton> m_xRowEdit;
141  std::unique_ptr<weld::SpinButton> m_xColEdit;
142 
143 public:
144  SwPreviewZoomDlg(SwPagePreviewWin& rParent)
145  : GenericDialogController(rParent.GetFrameWeld(), "modules/swriter/ui/previewzoomdialog.ui", "PreviewZoomDialog")
146  , m_rParent(rParent)
147  , m_xRowEdit(m_xBuilder->weld_spin_button("rows"))
148  , m_xColEdit(m_xBuilder->weld_spin_button("cols"))
149  {
150  m_xRowEdit->set_value(rParent.GetRow());
151  m_xColEdit->set_value(rParent.GetCol());
152  }
153 
154  void execute()
155  {
156  if (run() == RET_OK)
157  {
158  m_rParent.CalcWish(sal_uInt8(m_xRowEdit->get_value()), sal_uInt8(m_xColEdit->get_value()));
159  }
160  }
161 };
162 
163 }
164 
165 // all for SwPagePreviewWin
167  : Window(pParent, WinBits(WB_CLIPCHILDREN))
168  , mpViewShell(nullptr)
169  , mrView(rPView)
170  , mbCalcScaleForPreviewLayout(true)
171  , maPaintedPreviewDocRect(tools::Rectangle(0,0,0,0))
172  , mpPgPreviewLayout(nullptr)
173 {
174  GetOutDev()->SetOutDevViewType( OutDevViewType::PrintPreview );
176  GetOutDev()->SetFillColor( GetBackground().GetColor() );
177  GetOutDev()->SetLineColor( GetBackground().GetColor());
178  SetMapMode( MapMode(MapUnit::MapTwip) );
179 
180  const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(false);
181  mnRow = pUsrPref->GetPagePrevRow(); // 1 row
182  mnCol = pUsrPref->GetPagePrevCol(); // 1 column
183  mnSttPage = USHRT_MAX;
184 }
185 
187 {
188 }
189 
191 {
192  if (!mpViewShell || !mpViewShell->GetLayout())
193  return;
194 
195  if (USHRT_MAX == mnSttPage) // was never calculated ? (Init-Phase!)
196  {
197  // This is the size to which I always relate.
198  if (!maPxWinSize.Height() || !maPxWinSize.Width())
200 
201  tools::Rectangle aRect(rRenderContext.LogicToPixel(rRect));
204  SetSelectedPage(1);
205  mpPgPreviewLayout->Paint(rRenderContext, rRenderContext.PixelToLogic(aRect));
207  }
208  else
209  {
210  MapMode aMM(rRenderContext.GetMapMode());
211  aMM.SetScaleX(maScale);
212  aMM.SetScaleY(maScale);
213  rRenderContext.SetMapMode(aMM);
215  mpPgPreviewLayout->Paint(rRenderContext, rRect);
217  }
218 }
219 
221 {
222  if( !mpViewShell || !mpViewShell->GetLayout() )
223  return;
224 
225  const sal_uInt8 nOldCol = mnCol;
226  mnRow = nNewRow;
227  mnCol = nNewCol;
228  const sal_uInt16 nPages = mnRow * mnCol;
229  const sal_uInt16 nLastSttPg = mrView.GetPageCount()+1 > nPages
230  ? mrView.GetPageCount()+1 - nPages : 0;
231  if( mnSttPage > nLastSttPg )
232  mnSttPage = nLastSttPg;
233 
238  SetPagePreview(mnRow, mnCol);
240 
241  // If changes have taken place at the columns, the special case "single column"
242  // must be considered and corrected if necessary.
243  if( (1 == nOldCol) != (1 == mnCol) )
245 
246  // Order must be maintained!
247  // additional invalidate page status.
248  static sal_uInt16 aInval[] =
249  {
250  SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN,
252  FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
255  0
256  };
257  SfxBindings& rBindings = mrView.GetViewFrame()->GetBindings();
258  rBindings.Invalidate( aInval );
259  rBindings.Update( FN_SHOW_TWO_PAGES );
260  rBindings.Update( FN_SHOW_MULTIPLE_PAGES );
261  // adjust scrollbars
263 }
264 
265 // mnSttPage is Absolute
266 bool SwPagePreviewWin::MovePage( int eMoveMode )
267 {
268  // number of pages up
269  const sal_uInt16 nPages = mnRow * mnCol;
270  sal_uInt16 nNewSttPage = mnSttPage;
271  const sal_uInt16 nPageCount = mrView.GetPageCount();
272  const sal_uInt16 nDefSttPg = GetDefSttPage();
273  bool bPaintPageAtFirstCol = true;
274 
275  switch( eMoveMode )
276  {
277  case MV_PAGE_UP:
278  {
279  const sal_uInt16 nRelSttPage = mpPgPreviewLayout->ConvertAbsoluteToRelativePageNum( mnSttPage );
280  const sal_uInt16 nNewAbsSttPage = nRelSttPage - nPages > 0 ?
281  mpPgPreviewLayout->ConvertRelativeToAbsolutePageNum( nRelSttPage - nPages ) :
282  nDefSttPg;
283  nNewSttPage = nNewAbsSttPage;
284 
285  const sal_uInt16 nRelSelPage = mpPgPreviewLayout->ConvertAbsoluteToRelativePageNum( SelectedPage() );
286  const sal_uInt16 nNewRelSelPage = nRelSelPage - nPages > 0 ?
287  nRelSelPage - nPages :
288  1;
290 
291  break;
292  }
293  case MV_PAGE_DOWN:
294  {
295  const sal_uInt16 nRelSttPage = mpPgPreviewLayout->ConvertAbsoluteToRelativePageNum( mnSttPage );
296  const sal_uInt16 nNewAbsSttPage = mpPgPreviewLayout->ConvertRelativeToAbsolutePageNum( nRelSttPage + nPages );
297  nNewSttPage = std::min(nNewAbsSttPage, nPageCount);
298 
299  const sal_uInt16 nRelSelPage = mpPgPreviewLayout->ConvertAbsoluteToRelativePageNum( SelectedPage() );
300  const sal_uInt16 nNewAbsSelPage = mpPgPreviewLayout->ConvertRelativeToAbsolutePageNum( nRelSelPage + nPages );
301  SetSelectedPage( std::min(nNewAbsSelPage, nPageCount) );
302 
303  break;
304  }
305  case MV_DOC_STT:
306  nNewSttPage = nDefSttPg;
307  SetSelectedPage( mpPgPreviewLayout->ConvertRelativeToAbsolutePageNum( nNewSttPage ? nNewSttPage : 1 ) );
308  break;
309  case MV_DOC_END:
310  // correct calculation of new start page.
311  nNewSttPage = nPageCount;
312  SetSelectedPage( nPageCount );
313  break;
314 
315  case MV_SELPAGE:
316  // <nNewSttPage> and <SelectedPage()> are already set.
317  // not start at first column, only if the
318  // complete preview layout columns doesn't fit into window.
320  bPaintPageAtFirstCol = false;
321  break;
322  case MV_SCROLL:
323  // check, if paint page at first column
324  // has to be avoided
327  bPaintPageAtFirstCol = false;
328  break;
329  case MV_NEWWINSIZE:
330  // nothing special to do.
331  break;
332  case MV_CALC:
333  // re-init page preview layout.
335 
336  // correct calculation of new start page.
337  if( nNewSttPage > nPageCount )
338  nNewSttPage = nPageCount;
339 
340  // correct selected page number
341  if( SelectedPage() > nPageCount )
342  SetSelectedPage( nNewSttPage ? nNewSttPage : 1 );
343  }
344 
345  mpPgPreviewLayout->Prepare( nNewSttPage, Point(0,0), maPxWinSize,
346  nNewSttPage,
347  maPaintedPreviewDocRect, bPaintPageAtFirstCol );
348  if( nNewSttPage == mnSttPage &&
349  eMoveMode != MV_SELPAGE )
350  return false;
351 
352  SetPagePreview(mnRow, mnCol);
353  mnSttPage = nNewSttPage;
354 
355  // additional invalidate page status.
356  static sal_uInt16 aInval[] =
357  {
358  FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
359  FN_STAT_PAGE, 0
360  };
361 
362  SfxBindings& rBindings = mrView.GetViewFrame()->GetBindings();
363  rBindings.Invalidate( aInval );
364 
365  return true;
366 }
367 
368 void SwPagePreviewWin::SetWinSize( const Size& rNewSize )
369 {
370  // We always want the size as pixel units.
371  maPxWinSize = LogicToPixel( rNewSize );
372 
373  if( USHRT_MAX == mnSttPage )
374  {
377  }
378 
380  {
383  }
387  {
390  }
393 }
394 
395 OUString SwPagePreviewWin::GetStatusStr( sal_uInt16 nPageCnt ) const
396 {
397  // show physical and virtual page number of
398  // selected page, if it's visible.
399  const sal_uInt16 nPageNum = mpPgPreviewLayout->IsPageVisible( mpPgPreviewLayout->SelectedPage() )
400  ? mpPgPreviewLayout->SelectedPage() : std::max<sal_uInt16>(mnSttPage, 1);
401 
402  OUString aStatusStr;
403  const sal_uInt16 nVirtPageNum = mpPgPreviewLayout->GetVirtPageNumByPageNum( nPageNum );
404  if( nVirtPageNum && nVirtPageNum != nPageNum )
405  {
406  aStatusStr = OUString::number(nVirtPageNum) + " " ;
407  }
408  return aStatusStr + OUString::number(nPageNum) + " / " + OUString::number(nPageCnt);
409 }
410 
412 {
413  const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode();
414  bool bHandled = false;
415  if(!rKeyCode.GetModifier())
416  {
417  sal_uInt16 nSlot = 0;
418  switch(rKeyCode.GetCode())
419  {
420  case KEY_ADD : nSlot = SID_ZOOM_OUT; break;
421  case KEY_ESCAPE: nSlot = FN_CLOSE_PAGEPREVIEW; break;
422  case KEY_SUBTRACT : nSlot = SID_ZOOM_IN; break;
423  }
424  if(nSlot)
425  {
426  bHandled = true;
428  nSlot, SfxCallMode::ASYNCHRON );
429  }
430  }
431  if( !bHandled && !mrView.KeyInput( rKEvt ) )
432  Window::KeyInput( rKEvt );
433 }
434 
436 {
437  bool bCallBase = true;
438  switch( rCEvt.GetCommand() )
439  {
440  case CommandEventId::ContextMenu:
442  bCallBase = false;
443  break;
444 
445  case CommandEventId::Wheel:
446  case CommandEventId::StartAutoScroll:
447  case CommandEventId::AutoScroll:
448  {
449  const CommandWheelData* pData = rCEvt.GetWheelData();
450  if( pData )
451  {
452  const CommandWheelData aDataNew(pData->GetDelta(),pData->GetNotchDelta(),COMMAND_WHEEL_PAGESCROLL,
453  pData->GetMode(),pData->GetModifier(),pData->IsHorz(), pData->IsDeltaPixel());
454  const CommandEvent aEvent( rCEvt.GetMousePosPixel(),rCEvt.GetCommand(),rCEvt.IsMouseEvent(),&aDataNew);
455  bCallBase = !mrView.HandleWheelCommands( aEvent );
456  }
457  else
458  bCallBase = !mrView.HandleWheelCommands( rCEvt );
459  }
460  break;
461  default:
462  ;
463  }
464 
465  if( bCallBase )
466  Window::Command( rCEvt );
467 }
468 
470 {
471  // consider single-click to set selected page
472  if( MOUSE_LEFT != ( rMEvt.GetModifier() + rMEvt.GetButtons() ) )
473  return;
474 
475  Point aPreviewPos( PixelToLogic( rMEvt.GetPosPixel() ) );
476  Point aDocPos;
477  bool bPosInEmptyPage;
478  sal_uInt16 nNewSelectedPage;
479  bool bIsDocPos =
481  aDocPos, bPosInEmptyPage, nNewSelectedPage );
482  if ( bIsDocPos && rMEvt.GetClicks() == 2 )
483  {
484  // close page preview, set new cursor position and switch to
485  // normal view.
486  OUString sNewCursorPos = OUString::number( aDocPos.X() ) + ";" +
487  OUString::number( aDocPos.Y() ) + ";";
488  mrView.SetNewCursorPos( sNewCursorPos );
489 
490  SfxViewFrame *pTmpFrame = mrView.GetViewFrame();
491  pTmpFrame->GetBindings().Execute( SID_VIEWSHELL0, nullptr,
492  SfxCallMode::ASYNCHRON );
493  }
494  else if ( bIsDocPos || bPosInEmptyPage )
495  {
496  // show clicked page as the selected one
497  mpPgPreviewLayout->MarkNewSelectedPage( nNewSelectedPage );
498  GetViewShell()->ShowPreviewSelection( nNewSelectedPage );
499  // adjust position at vertical scrollbar.
501  {
502  mrView.SetVScrollbarThumbPos( nNewSelectedPage );
503  }
504  // invalidate page status.
505  static sal_uInt16 aInval[] =
506  {
507  FN_STAT_PAGE, 0
508  };
509  SfxBindings& rBindings = mrView.GetViewFrame()->GetBindings();
510  rBindings.Invalidate( aInval );
511  }
512 }
513 
514 // Set user prefs or view options
515 
517 {
518  SwMasterUsrPref *pOpt = const_cast<SwMasterUsrPref *>(SW_MOD()->GetUsrPref(false));
519 
520  if (nRow != pOpt->GetPagePrevRow() || nCol != pOpt->GetPagePrevCol())
521  {
522  pOpt->SetPagePrevRow( nRow );
523  pOpt->SetPagePrevCol( nCol );
524  pOpt->SetModified();
525 
526  // Update scrollbar!
528  }
529 }
530 
533 {
535 }
536 
538 void SwPagePreviewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum )
539 {
540  mpPgPreviewLayout->SetSelectedPage( _nSelectedPageNum );
541 }
542 
544 bool SwPagePreviewWin::SetBookPreviewMode( const bool _bBookPreview )
545 {
546  return mpPgPreviewLayout->SetBookPreviewMode( _bBookPreview,
547  mnSttPage,
549 }
550 
552 {
553  Window::DataChanged( rDCEvt );
554 
555  switch( rDCEvt.GetType() )
556  {
557  case DataChangedEventType::SETTINGS:
558  // Rearrange the scrollbars or trigger resize, because the
559  // size of the scrollbars may have be changed. Also the
560  // size of the scrollbars has to be retrieved from the settings
561  // out of the resize handler.
562  if( rDCEvt.GetFlags() & AllSettingsFlags::STYLE )
563  mrView.InvalidateBorder(); // Scrollbar widths
564  // zoom has to be disabled if Accessibility support is switched on
566  break;
567 
568  case DataChangedEventType::PRINTER:
569  case DataChangedEventType::DISPLAY:
570  case DataChangedEventType::FONTS:
571  case DataChangedEventType::FONTSUBSTITUTION:
572  mrView.GetDocShell()->UpdateFontList(); // Font change
574  if ( mpViewShell->GetWin() )
576  break;
577  default: break;
578  }
579 }
580 
582 void SwPagePreview::ExecPgUpAndPgDown( const bool _bPgUp,
583  SfxRequest* _pReq )
584 {
585  SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout();
586  // check, if top/bottom of preview is *not* already visible.
587  if( pPagePreviewLay->GetWinPagesScrollAmount( _bPgUp ? -1 : 1 ) != 0 )
588  {
589  if ( pPagePreviewLay->DoesPreviewLayoutRowsFitIntoWindow() &&
590  pPagePreviewLay->DoesPreviewLayoutColsFitIntoWindow() )
591  {
592  const int eMvMode = _bPgUp ?
595  if ( ChgPage( eMvMode ) )
597  }
598  else
599  {
600  SwTwips nScrollAmount;
601  sal_uInt16 nNewSelectedPageNum = 0;
602  const sal_uInt16 nVisPages = m_pViewWin->GetRow() * m_pViewWin->GetCol();
603  if( _bPgUp )
604  {
605  if ( pPagePreviewLay->DoesPreviewLayoutRowsFitIntoWindow() )
606  {
607  nScrollAmount = pPagePreviewLay->GetWinPagesScrollAmount( -1 );
608  if ( (m_pViewWin->SelectedPage() - nVisPages) > 0 )
609  nNewSelectedPageNum = m_pViewWin->SelectedPage() - nVisPages;
610  else
611  nNewSelectedPageNum = 1;
612  }
613  else
614  nScrollAmount = - std::min( m_pViewWin->GetOutDev()->GetOutputSize().Height(),
616  }
617  else
618  {
619  if ( pPagePreviewLay->DoesPreviewLayoutRowsFitIntoWindow() )
620  {
621  nScrollAmount = pPagePreviewLay->GetWinPagesScrollAmount( 1 );
622  if ( (m_pViewWin->SelectedPage() + nVisPages) <= mnPageCount )
623  nNewSelectedPageNum = m_pViewWin->SelectedPage() + nVisPages;
624  else
625  nNewSelectedPageNum = mnPageCount;
626  }
627  else
628  nScrollAmount = std::min( m_pViewWin->GetOutDev()->GetOutputSize().Height(),
629  ( pPagePreviewLay->GetPreviewDocSize().Height() -
631  }
632  m_pViewWin->Scroll( 0, nScrollAmount );
633  if ( nNewSelectedPageNum != 0 )
634  {
635  m_pViewWin->SetSelectedPage( nNewSelectedPageNum );
636  }
637  ScrollViewSzChg();
638  // additional invalidate page status.
639  static sal_uInt16 aInval[] =
640  {
641  FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
642  FN_STAT_PAGE, 0
643  };
644  SfxBindings& rBindings = GetViewFrame()->GetBindings();
645  rBindings.Invalidate( aInval );
647  }
648  }
649 
650  if ( _pReq )
651  _pReq->Done();
652 }
653 
654 // Then all for the SwPagePreview
656 {
657  int eMvMode = SwPagePreviewWin::MV_DOC_END;
658  sal_uInt8 nRow = 1;
659  bool bRefresh = true;
660 
661  switch(rReq.GetSlot())
662  {
663  case SID_REFRESH_VIEW:
664  case FN_STAT_PAGE:
665  case FN_STAT_ZOOM:
666  break;
667 
669  {
670  const SfxItemSet *pArgs = rReq.GetArgs();
671  if( pArgs && pArgs->Count() >= 2 )
672  {
673  sal_uInt8 nCols = static_cast<sal_uInt8>(pArgs->Get(SID_ATTR_TABLE_COLUMN).GetValue());
674  sal_uInt8 nRows = static_cast<sal_uInt8>(pArgs->Get(SID_ATTR_TABLE_ROW).GetValue());
675  m_pViewWin->CalcWish( nRows, nCols );
676 
677  }
678  else
679  {
680  SwPreviewZoomDlg aDlg(*m_pViewWin);
681  aDlg.execute();
682  }
683  }
684  break;
685  case FN_SHOW_BOOKVIEW:
686  {
687  const SfxItemSet* pArgs = rReq.GetArgs();
688  const SfxPoolItem* pItem;
689  bool bBookPreview = GetViewShell()->GetViewOptions()->IsPagePrevBookview();
690  if( pArgs && SfxItemState::SET == pArgs->GetItemState( FN_SHOW_BOOKVIEW, false, &pItem ) )
691  {
692  bBookPreview = static_cast< const SfxBoolItem* >( pItem )->GetValue();
693  const_cast<SwViewOption*>(GetViewShell()->GetViewOptions())->SetPagePrevBookview( bBookPreview );
694  // cast is not gentleman like, but it's common use in writer and in this case
695  }
696  if ( m_pViewWin->SetBookPreviewMode( bBookPreview ) )
697  {
698  // book preview mode changed. Thus, adjust scrollbars and
699  // invalidate corresponding states.
700  ScrollViewSzChg();
701  static sal_uInt16 aInval[] =
702  {
703  FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
705  };
706  SfxBindings& rBindings = GetViewFrame()->GetBindings();
707  rBindings.Invalidate( aInval );
709  }
710 
711  }
712  break;
713  case FN_SHOW_TWO_PAGES:
714  m_pViewWin->CalcWish( nRow, 2 );
715  break;
716 
717  case FN_SHOW_SINGLE_PAGE:
718  m_pViewWin->CalcWish( nRow, 1 );
719  break;
720 
721  case FN_PREVIEW_ZOOM:
722  case SID_ATTR_ZOOM:
723  {
724  const SfxItemSet *pArgs = rReq.GetArgs();
726  if(!pArgs)
727  {
729  const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
730  SvxZoomItem aZoom( pVOpt->GetZoomType(), pVOpt->GetZoom() );
731  aZoom.SetValueSet(
732  SvxZoomEnableFlags::N50|
733  SvxZoomEnableFlags::N75|
734  SvxZoomEnableFlags::N100|
735  SvxZoomEnableFlags::N150|
736  SvxZoomEnableFlags::N200|
737  SvxZoomEnableFlags::WHOLEPAGE);
738  aCoreSet.Put( aZoom );
739 
741  pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(GetViewFrame()->GetFrameWeld(), aCoreSet));
742  pDlg->SetLimits( MINZOOM, MAXZOOM );
743 
744  if( pDlg->Execute() != RET_CANCEL )
745  pArgs = pDlg->GetOutputItemSet();
746  }
747  if( pArgs )
748  {
749  SvxZoomType eType = SvxZoomType::PERCENT;
750  sal_uInt16 nZoomFactor = USHRT_MAX;
751  if(const SvxZoomItem* pZoomItem = pArgs->GetItemIfSet(SID_ATTR_ZOOM))
752  {
753  eType = pZoomItem->GetType();
754  nZoomFactor = pZoomItem->GetValue();
755  }
756  else if(const SfxUInt16Item* pPreviewItem = pArgs->GetItemIfSet(FN_PREVIEW_ZOOM))
757  nZoomFactor = pPreviewItem->GetValue();
758  if(USHRT_MAX != nZoomFactor)
759  SetZoom(eType, nZoomFactor);
760  }
761  }
762  break;
763  case SID_ATTR_ZOOMSLIDER :
764  {
765  const SfxItemSet *pArgs = rReq.GetArgs();
766  const SvxZoomSliderItem* pItem;
767 
768  if ( pArgs && (pItem = pArgs->GetItemIfSet(SID_ATTR_ZOOMSLIDER ) ) )
769  {
770  const sal_uInt16 nCurrentZoom = pItem->GetValue();
771  SetZoom( SvxZoomType::PERCENT, nCurrentZoom );
772  }
773  }
774  break;
775  case SID_ZOOM_IN:
776  case SID_ZOOM_OUT:
777  {
778  const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
779  SetZoom(SvxZoomType::PERCENT,
780  lcl_GetNextZoomStep(pVOpt->GetZoom(), SID_ZOOM_IN == rReq.GetSlot()));
781  }
782  break;
783  case FN_CHAR_LEFT:
784  case FN_CHAR_RIGHT:
785  case FN_LINE_UP:
786  case FN_LINE_DOWN:
787  {
788  SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout();
789  sal_uInt16 nNewSelectedPage;
790  sal_uInt16 nNewStartPage;
791  Point aNewStartPos;
792  sal_Int16 nHoriMove = 0;
793  sal_Int16 nVertMove = 0;
794  switch(rReq.GetSlot())
795  {
796  case FN_CHAR_LEFT: nHoriMove = -1; break;
797  case FN_CHAR_RIGHT: nHoriMove = 1; break;
798  case FN_LINE_UP: nVertMove = -1; break;
799  case FN_LINE_DOWN: nVertMove = 1; break;
800  }
801  pPagePreviewLay->CalcStartValuesForSelectedPageMove( nHoriMove, nVertMove,
802  nNewSelectedPage, nNewStartPage, aNewStartPos );
803  if ( m_pViewWin->SelectedPage() != nNewSelectedPage )
804  {
805  if ( pPagePreviewLay->IsPageVisible( nNewSelectedPage ) )
806  {
807  pPagePreviewLay->MarkNewSelectedPage( nNewSelectedPage );
808  // adjust position at vertical scrollbar.
809  SetVScrollbarThumbPos( nNewSelectedPage );
810  bRefresh = false;
811  }
812  else
813  {
814  m_pViewWin->SetSelectedPage( nNewSelectedPage );
815  m_pViewWin->SetSttPage( nNewStartPage );
817  }
818  GetViewShell()->ShowPreviewSelection( nNewSelectedPage );
819  // invalidate page status.
820  static sal_uInt16 aInval[] =
821  {
822  FN_STAT_PAGE, 0
823  };
824  SfxBindings& rBindings = GetViewFrame()->GetBindings();
825  rBindings.Invalidate( aInval );
826  rReq.Done();
827  }
828  else
829  {
830  bRefresh = false;
831  }
832  break;
833  }
834  case FN_PAGEUP:
835  case FN_PAGEDOWN:
836  {
837  ExecPgUpAndPgDown( rReq.GetSlot() == FN_PAGEUP, &rReq );
838  break;
839  }
841  {
842  const SfxItemSet *pArgs = rReq.GetArgs();
843  if( pArgs && pArgs->Count())
844  {
845  sal_uInt16 nPageNum = static_cast<const SfxUInt16Item &>(pArgs->Get(SID_JUMP_TO_SPECIFIC_PAGE)).GetValue();
846 
847  if( nPageNum > 0 && nPageNum <= mnPageCount )
848  {
849  m_pViewWin->SetSttPage( nPageNum);
850  m_pViewWin->SetSelectedPage( nPageNum );
852  ScrollViewSzChg();
853  }
854  }
855  }
856  break;
857  case FN_START_OF_LINE:
860  [[fallthrough]];
861  case FN_END_OF_LINE:
862  case FN_END_OF_DOCUMENT:
864  {
865  bool bRet = ChgPage( eMvMode );
866  // return value for Basic
867  rReq.SetReturnValue(SfxBoolItem(rReq.GetSlot(), !bRet));
868 
869  bRefresh = bRet;
870  rReq.Done();
871  }
872  break;
873 
875  {
877  // The thing with the orientation
878  if(pPPVPD)
879  {
880  SfxPrinter* pPrinter = GetPrinter( true );
881  if((pPrinter->GetOrientation() == Orientation::Landscape)
882  != pPPVPD->GetLandscape())
883  pPrinter->SetOrientation(pPPVPD->GetLandscape() ? Orientation::Landscape : Orientation::Portrait);
884  }
886  m_bNormalPrint = false;
887  rReq.SetSlot( SID_PRINTDOC );
890  return;
891  }
892  case SID_PRINTDOCDIRECT:
893  case SID_PRINTDOC:
895  m_bNormalPrint = true;
897  return;
899  case SID_PRINTPREVIEW:
900  // print preview is now always in the same frame as the tab view
901  // -> always switch this frame back to normal view
902  // (ScTabViewShell ctor reads stored view data)
903  GetViewFrame()->GetDispatcher()->Execute( SID_VIEWSHELL0, SfxCallMode::ASYNCHRON );
904  break;
905  case FN_INSERT_BREAK:
906  {
907  sal_uInt16 nSelPage = m_pViewWin->SelectedPage();
908  //if a dummy page is selected (e.g. a non-existing right/left page)
909  //the direct neighbor is used
910  if(GetViewShell()->IsDummyPage( nSelPage ) && GetViewShell()->IsDummyPage( --nSelPage ))
911  nSelPage +=2;
912  m_nNewPage = nSelPage;
913  SfxViewFrame *pTmpFrame = GetViewFrame();
914  pTmpFrame->GetBindings().Execute( SID_VIEWSHELL0, nullptr,
915  SfxCallMode::ASYNCHRON );
916  }
917  break;
918  default:
919  OSL_ENSURE(false, "wrong dispatcher");
920  return;
921  }
922 
923  if( bRefresh )
925 }
926 
928 {
929  SfxWhichIter aIter(rSet);
930  sal_uInt16 nWhich = aIter.FirstWhich();
931  OSL_ENSURE(nWhich, "empty set");
932  SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout();
933 
934  while(nWhich)
935  {
936  switch(nWhich)
937  {
938  case SID_BROWSER_MODE:
939  case FN_PRINT_LAYOUT:
940  rSet.DisableItem(nWhich);
941  break;
943  {
944  if ( pPagePreviewLay->IsPageVisible( 1 ) )
945  rSet.DisableItem(nWhich);
946  break;
947  }
948  case FN_END_OF_DOCUMENT:
949  {
950  if ( pPagePreviewLay->IsPageVisible( mnPageCount ) )
951  rSet.DisableItem(nWhich);
952  break;
953  }
954  case FN_PAGEUP:
955  {
956  if( pPagePreviewLay->GetWinPagesScrollAmount( -1 ) == 0 )
957  rSet.DisableItem(nWhich);
958  break;
959  }
960  case FN_PAGEDOWN:
961  {
962  if( pPagePreviewLay->GetWinPagesScrollAmount( 1 ) == 0 )
963  rSet.DisableItem(nWhich);
964  break;
965  }
966 
967  case FN_STAT_PAGE:
968  {
969  std::vector<OUString> aStringList
970  {
972  OUString()
973  };
975  }
976  break;
977 
978  case SID_ATTR_ZOOM:
979  case FN_STAT_ZOOM:
980  {
981  const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
982  SvxZoomItem aZoom(pVOpt->GetZoomType(), pVOpt->GetZoom());
983  aZoom.SetValueSet(
984  SvxZoomEnableFlags::N50|
985  SvxZoomEnableFlags::N75|
986  SvxZoomEnableFlags::N100|
987  SvxZoomEnableFlags::N150|
988  SvxZoomEnableFlags::N200);
989  rSet.Put( aZoom );
990  }
991  break;
992  case SID_ATTR_ZOOMSLIDER :
993  {
994  const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
995  const sal_uInt16 nCurrentZoom = pVOpt->GetZoom();
996  SvxZoomSliderItem aZoomSliderItem( nCurrentZoom, MINZOOM, MAXZOOM );
997  aZoomSliderItem.AddSnappingPoint( 100 );
998  rSet.Put( aZoomSliderItem );
999  }
1000  break;
1001  case FN_PREVIEW_ZOOM:
1002  {
1003  const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
1004  rSet.Put(SfxUInt16Item(nWhich, pVOpt->GetZoom()));
1005  }
1006  break;
1007  case SID_ZOOM_IN:
1008  case SID_ZOOM_OUT:
1009  {
1010  const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
1011  if((SID_ZOOM_IN == nWhich && pVOpt->GetZoom() >= MAX_PREVIEW_ZOOM) ||
1012  (SID_ZOOM_OUT == nWhich && pVOpt->GetZoom() <= MIN_PREVIEW_ZOOM))
1013  {
1014  rSet.DisableItem(nWhich);
1015  }
1016  }
1017  break;
1019  // should never be disabled
1020  break;
1021  case FN_SHOW_BOOKVIEW:
1022  {
1024  rSet.Put(SfxBoolItem(nWhich, b));
1025  }
1026  break;
1027 
1028  case FN_SHOW_TWO_PAGES:
1029  if( 2 == m_pViewWin->GetCol() && 1 == m_pViewWin->GetRow() )
1030  rSet.DisableItem( nWhich );
1031  break;
1032 
1033  case FN_PRINT_PAGEPREVIEW:
1034  // has the same status like the normal printing
1035  {
1036  const SfxPoolItem* pItem;
1038  GetSlotState( SID_PRINTDOC, SfxViewShell::GetInterface(), &aSet );
1039  if( SfxItemState::DISABLED == aSet.GetItemState( SID_PRINTDOC, false ))
1040  rSet.DisableItem( nWhich );
1041  else if( SfxItemState::SET == aSet.GetItemState( SID_PRINTDOC,
1042  false, &pItem ))
1043  {
1044  const_cast<SfxPoolItem*>(pItem)->SetWhich( FN_PRINT_PAGEPREVIEW );
1045  rSet.Put( *pItem );
1046  }
1047  }
1048  break;
1049 
1050  case SID_PRINTPREVIEW:
1051  rSet.Put( SfxBoolItem( nWhich, true ) );
1052  break;
1053 
1054  case SID_PRINTDOC:
1055  case SID_PRINTDOCDIRECT:
1056  GetSlotState( nWhich, SfxViewShell::GetInterface(), &rSet );
1057  break;
1058  }
1059  nWhich = aIter.NextWhich();
1060  }
1061 }
1062 
1064 {
1065  SfxWhichIter aIter(rSet);
1066  sal_uInt16 nWhich = aIter.FirstWhich();
1067 
1068  while (nWhich)
1069  {
1070  rSet.DisableItem(nWhich);
1071  nWhich = aIter.NextWhich();
1072  }
1073 }
1074 
1076 {
1077  if ( GetViewShell()->HasDrawView() )
1079 
1080  m_bNormalPrint = true;
1081 
1082  // Check and process the DocSize. The shell could not be found via
1083  // the handler, because the shell is unknown to the SFX management
1084  // within the CTOR phase.
1085 
1086  const SwViewOption * pPrefs = SW_MOD()->GetUsrPref(false);
1087 
1090 
1091  // Update the fields
1092  // ATTENTION: Do cast the EditShell up, to use the SS.
1093  // At the methods the current shell will be queried!
1094  SwEditShell* pESh = dynamic_cast<SwEditShell*>(GetViewShell());
1095  bool bIsModified = pESh != nullptr && pESh->IsModified();
1096 
1097  SwViewOption aOpt( *pPrefs );
1098  aOpt.SetPagePreview(true);
1099  aOpt.SetTab( false );
1100  aOpt.SetBlank( false );
1101  aOpt.SetHardBlank( false );
1102  aOpt.SetParagraph( false );
1103  aOpt.SetLineBreak( false );
1104  aOpt.SetPageBreak( false );
1105  aOpt.SetColumnBreak( false );
1106  aOpt.SetSoftHyph( false );
1107  aOpt.SetFieldName( false );
1108  aOpt.SetPostIts( false );
1109  aOpt.SetShowBookmarks( false );
1110  aOpt.SetShowHiddenChar( false );
1111  aOpt.SetShowHiddenField( false );
1112  aOpt.SetShowHiddenPara( false );
1113  aOpt.SetViewHRuler( false );
1114  aOpt.SetViewVRuler( false );
1115  aOpt.SetGraphic( true );
1116  aOpt.SetTable( true );
1117  aOpt.SetSnap( false );
1118  aOpt.SetGridVisible( false );
1119  aOpt.SetOnlineSpell( false );
1120  aOpt.SetHideWhitespaceMode( false );
1121 
1122  GetViewShell()->ApplyViewOptions( aOpt );
1123 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
1124  GetViewShell()->ApplyAccessibilityOptions(SW_MOD()->GetAccessibilityOptions());
1125 #endif
1126 
1127  // adjust view shell option to the same as for print
1128  SwPrintData const aPrintOptions = *SW_MOD()->GetPrtOptions(false);
1129  GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions );
1130 
1131  GetViewShell()->CalcLayout();
1132  DocSzChgd( GetViewShell()->GetDocSize() );
1133 
1134  if( !bIsModified && pESh != nullptr )
1135  pESh->ResetModified();
1136 }
1137 
1139  SfxViewShell( pViewFrame, SWVIEWFLAGS ),
1140  m_pViewWin( VclPtr<SwPagePreviewWin>::Create(&GetViewFrame()->GetWindow(), *this ) ),
1141  m_nNewPage(USHRT_MAX),
1142  m_sPageStr(SwResId(STR_PAGE)),
1143  m_pHScrollbar(nullptr),
1144  m_pVScrollbar(nullptr),
1145  m_pScrollFill(VclPtr<ScrollBarBox>::Create( &pViewFrame->GetWindow(), WB_SIZEABLE )),
1146  mnPageCount( 0 ),
1147  mbResetFormDesignMode( false ),
1148  mbFormDesignModeToReset( false )
1149 {
1150  SetName("PageView");
1151  SetWindow( m_pViewWin );
1152  CreateScrollbar( true );
1153  CreateScrollbar( false );
1154 
1155  //notify notebookbar change in context
1159  //removelisteners for notebookbar
1160  if (SfxViewFrame* pCurrent = SfxViewFrame::Current())
1161  if (auto& pBar = pCurrent->GetWindow().GetSystemWindow()->GetNotebookBar())
1162  pBar->ControlListenerForCurrentController(false);
1163 
1164  SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
1165  if ( !pOldSh )
1166  {
1167  // Exists already a view on the document?
1168  SfxViewFrame *pF = SfxViewFrame::GetFirst( pObjShell );
1169  if ( pF == pViewFrame )
1170  pF = SfxViewFrame::GetNext( *pF, pObjShell );
1171  if ( pF )
1172  pOldSh = pF->GetViewShell();
1173  }
1174 
1175  SwViewShell *pVS, *pNew;
1176 
1177  if (SwPagePreview* pPagePreview = dynamic_cast<SwPagePreview*>(pOldSh))
1178  pVS = pPagePreview->GetViewShell();
1179  else
1180  {
1181  if (SwView* pView = dynamic_cast<SwView *>(pOldSh))
1182  {
1183  pVS = pView->GetWrtShellPtr();
1184  // save the current ViewData of the previous SwView
1185  pOldSh->WriteUserData( m_sSwViewData );
1186  }
1187  else
1188  pVS = GetDocShell()->GetWrtShell();
1189  if( pVS )
1190  {
1191  // Set the current page as the first.
1192  sal_uInt16 nPhysPg, nVirtPg;
1193  static_cast<SwCursorShell*>(pVS)->GetPageNum( nPhysPg, nVirtPg, true, false );
1194  if( 1 != m_pViewWin->GetCol() && 1 == nPhysPg )
1195  --nPhysPg;
1196  m_pViewWin->SetSttPage( nPhysPg );
1197  }
1198  }
1199 
1200  // for form shell remember design mode of draw view
1201  // of previous view shell
1202  if ( pVS && pVS->HasDrawView() )
1203  {
1204  mbResetFormDesignMode = true;
1206  }
1207 
1208  if( pVS )
1209  pNew = new SwViewShell( *pVS, m_pViewWin, nullptr, VSHELLFLAG_ISPREVIEW );
1210  else
1211  pNew = new SwViewShell(
1212  *static_cast<SwDocShell*>(pViewFrame->GetObjectShell())->GetDoc(),
1213  m_pViewWin, nullptr, nullptr, VSHELLFLAG_ISPREVIEW );
1214 
1215  m_pViewWin->SetViewShell( pNew );
1216  pNew->SetSfxViewShell( this );
1217  Init();
1218 }
1219 
1221 {
1222  SetWindow( nullptr );
1223  SwViewShell* pVShell = m_pViewWin->GetViewShell();
1224  pVShell->SetWin(nullptr);
1225  delete pVShell;
1226 
1228  if (SfxViewFrame* pCurrent = SfxViewFrame::Current())
1229  if (auto& pBar = pCurrent->GetWindow().GetSystemWindow()->GetNotebookBar())
1230  pBar->ControlListenerForCurrentController(true); // start listening now
1234 }
1235 
1237 {
1238  return dynamic_cast<SwDocShell*>( GetViewFrame()->GetObjectShell() );
1239 }
1240 
1242 {
1243  vcl::Window *pMDI = &GetViewFrame()->GetWindow();
1244  VclPtr<SwScrollbar>& ppScrollbar = bHori ? m_pHScrollbar : m_pVScrollbar;
1245 
1246  assert(!ppScrollbar); //check beforehand!
1247 
1248  ppScrollbar = VclPtr<SwScrollbar>::Create( pMDI, bHori );
1249 
1250  ScrollDocSzChg();
1251  ppScrollbar->EnableDrag();
1252  ppScrollbar->SetEndScrollHdl( LINK( this, SwPagePreview, EndScrollHdl ));
1253 
1254  ppScrollbar->SetScrollHdl( LINK( this, SwPagePreview, ScrollHdl ));
1255 
1256  InvalidateBorder();
1257  ppScrollbar->ExtendedShow();
1258 }
1259 
1260 bool SwPagePreview::ChgPage( int eMvMode, bool bUpdateScrollbar )
1261 {
1263  bool bChg = m_pViewWin->MovePage( eMvMode ) ||
1264  eMvMode == SwPagePreviewWin::MV_CALC ||
1266  m_aVisArea = m_pViewWin->PixelToLogic( aPixVisArea );
1267 
1268  if( bChg )
1269  {
1270  // Update statusbar
1271  SfxBindings& rBindings = GetViewFrame()->GetBindings();
1272 
1273  if( bUpdateScrollbar )
1274  {
1275  ScrollViewSzChg();
1276 
1277  static sal_uInt16 aInval[] =
1278  {
1279  FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT,
1281  };
1282  rBindings.Invalidate( aInval );
1283  }
1284  std::vector<OUString> aStringList
1285  {
1287  OUString()
1288  };
1290  }
1291  return bChg;
1292 }
1293 
1294 // From here, everything was taken from the SwView.
1296 {
1298  const tools::Long nTmp = rSet.GetScrollBarSize();
1299  if ( m_pVScrollbar->IsVisible( true ) )
1300  rToFill.Right() = nTmp;
1301  if ( m_pHScrollbar->IsVisible( true ) )
1302  rToFill.Bottom() = nTmp;
1303  SetBorderPixel( rToFill );
1304 }
1305 
1306 void SwPagePreview::InnerResizePixel( const Point &rOfst, const Size &rSize, bool )
1307 {
1308  SvBorder aBorder;
1309  CalcAndSetBorderPixel( aBorder );
1310  tools::Rectangle aRect( rOfst, rSize );
1311  aRect += aBorder;
1312  ViewResizePixel( *m_pViewWin->GetOutDev(), aRect.TopLeft(), aRect.GetSize(),
1315 
1316  // Never set EditWin !
1317  // Never set VisArea !
1318 }
1319 
1320 void SwPagePreview::OuterResizePixel( const Point &rOfst, const Size &rSize )
1321 {
1322  SvBorder aBorder;
1323  CalcAndSetBorderPixel( aBorder );
1324 
1325  // Never set EditWin !
1326 
1327  Size aTmpSize( m_pViewWin->GetOutputSizePixel() );
1328  Point aBottomRight( m_pViewWin->PixelToLogic( Point( aTmpSize.Width(), aTmpSize.Height() ) ) );
1329  SetVisArea( tools::Rectangle( Point(), aBottomRight ) );
1330 
1331  // Call of the DocSzChgd-Method of the scrollbars is necessary,
1332  // because from the maximum scroll range half the height of the
1333  // VisArea is always deducted.
1334  if ( m_pVScrollbar && !aTmpSize.IsEmpty() )
1335  {
1336  ScrollDocSzChg();
1337  }
1338 
1339  SvBorder aBorderNew;
1340  CalcAndSetBorderPixel( aBorderNew );
1343 }
1344 
1346 {
1347  const Point aTopLeft(AlignToPixel(rRect.TopLeft()));
1348  const Point aBottomRight(AlignToPixel(rRect.BottomRight()));
1349  tools::Rectangle aLR(aTopLeft,aBottomRight);
1350 
1351  if(aLR == m_aVisArea)
1352  return;
1353  // No negative position, no negative size
1354 
1355  if(aLR.Top() < 0)
1356  {
1357  aLR.AdjustBottom(std::abs(aLR.Top()) );
1358  aLR.SetTop( 0 );
1359  }
1360 
1361  if(aLR.Left() < 0)
1362  {
1363  aLR.AdjustRight(std::abs(aLR.Left()) );
1364  aLR.SetLeft( 0 );
1365  }
1366  if(aLR.Right() < 0) aLR.SetRight( 0 );
1367  if(aLR.Bottom() < 0) aLR.SetBottom( 0 );
1368  if(aLR == m_aVisArea ||
1369  // Ignore empty rectangle
1370  ( 0 == aLR.Bottom() - aLR.Top() && 0 == aLR.Right() - aLR.Left() ) )
1371  return;
1372 
1373  if( aLR.Left() > aLR.Right() || aLR.Top() > aLR.Bottom() )
1374  return;
1375 
1376  // Before the data can be changed call an update if necessary.
1377  // Thereby ensured, that adjacent paints are correctly converted into
1378  // document coordinates.
1379  // As a precaution, we do this only when at the shell runs an action,
1380  // because then we do not really paint but the rectangles are just
1381  // bookmarked (in document coordinates).
1382  if( GetViewShell()->ActionPend() )
1384 
1385  // Set at View-Win the current size
1386  m_aVisArea = aLR;
1387  m_pViewWin->SetWinSize( aLR.GetSize() );
1389 
1391 }
1392 
1393 IMPL_LINK( SwPagePreview, ScrollHdl, ScrollBar *, p, void )
1394 {
1395  SwScrollbar* pScrollbar = static_cast<SwScrollbar*>(p);
1396  if(!GetViewShell())
1397  return;
1398  if( !pScrollbar->IsHoriScroll() &&
1399  pScrollbar->GetType() == ScrollType::Drag &&
1401  GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow())
1402  {
1403  // Scroll how many pages??
1404  OUString sStateStr(m_sPageStr);
1405  tools::Long nThmbPos = pScrollbar->GetThumbPos();
1406  if( 1 == m_pViewWin->GetCol() || !nThmbPos )
1407  ++nThmbPos;
1408  sStateStr += OUString::number( nThmbPos );
1409  Point aPos = pScrollbar->GetParent()->OutputToScreenPixel(
1410  pScrollbar->GetPosPixel());
1411  aPos.setY( pScrollbar->OutputToScreenPixel(pScrollbar->GetPointerPosPixel()).Y() );
1412  tools::Rectangle aRect;
1413  aRect.SetLeft( aPos.X() -8 );
1414  aRect.SetRight( aRect.Left() );
1415  aRect.SetTop( aPos.Y() );
1416  aRect.SetBottom( aRect.Top() );
1417 
1418  Help::ShowQuickHelp(pScrollbar, aRect, sStateStr,
1419  QuickHelpFlags::Right|QuickHelpFlags::VCenter);
1420 
1421  }
1422  else
1423  EndScrollHdl( pScrollbar );
1424 }
1425 
1426 IMPL_LINK( SwPagePreview, EndScrollHdl, ScrollBar *, p, void )
1427 {
1428  SwScrollbar* pScrollbar = static_cast<SwScrollbar*>(p);
1429  if(!GetViewShell())
1430  return;
1431 
1432  // boolean to avoid unnecessary invalidation of the window.
1433  bool bInvalidateWin = true;
1434 
1435  if( !pScrollbar->IsHoriScroll() ) // scroll vertically
1436  {
1437  if ( Help::IsQuickHelpEnabled() )
1438  Help::ShowQuickHelp(pScrollbar, tools::Rectangle(), OUString());
1439  if ( GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow() )
1440  {
1441  // Scroll how many pages ??
1442  const sal_uInt16 nThmbPos = o3tl::narrowing<sal_uInt16>(pScrollbar->GetThumbPos());
1443  // adjust to new preview functionality
1444  if( nThmbPos != m_pViewWin->SelectedPage() )
1445  {
1446  // consider case that page <nThmbPos>
1447  // is already visible
1448  SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout();
1449  if ( pPagePreviewLay->IsPageVisible( nThmbPos ) )
1450  {
1451  pPagePreviewLay->MarkNewSelectedPage( nThmbPos );
1452  // invalidation of window is unnecessary
1453  bInvalidateWin = false;
1454  }
1455  else
1456  {
1457  // consider whether layout columns
1458  // fit or not.
1459  if ( !pPagePreviewLay->DoesPreviewLayoutColsFitIntoWindow() )
1460  {
1461  m_pViewWin->SetSttPage( nThmbPos );
1462  m_pViewWin->SetSelectedPage( nThmbPos );
1463  ChgPage( SwPagePreviewWin::MV_SCROLL, false );
1464  // update scrollbars
1465  ScrollViewSzChg();
1466  }
1467  else
1468  {
1469  // correct scroll amount
1470  const sal_Int16 nPageDiff = nThmbPos - m_pViewWin->SelectedPage();
1471  const sal_uInt16 nVisPages = m_pViewWin->GetRow() * m_pViewWin->GetCol();
1472  sal_Int16 nWinPagesToScroll = nPageDiff / nVisPages;
1473  if ( nPageDiff % nVisPages )
1474  {
1475  // decrease/increase number of preview pages to scroll
1476  nPageDiff < 0 ? --nWinPagesToScroll : ++nWinPagesToScroll;
1477  }
1478  m_pViewWin->SetSelectedPage( nThmbPos );
1479  m_pViewWin->Scroll( 0, pPagePreviewLay->GetWinPagesScrollAmount( nWinPagesToScroll ) );
1480  }
1481  }
1482  // update accessibility
1483  GetViewShell()->ShowPreviewSelection( nThmbPos );
1484  }
1485  else
1486  {
1487  // invalidation of window is unnecessary
1488  bInvalidateWin = false;
1489  }
1490  }
1491  else
1492  {
1493  tools::Long nThmbPos = pScrollbar->GetThumbPos();
1494  m_pViewWin->Scroll(0, nThmbPos - m_pViewWin->GetPaintedPreviewDocRect().Top());
1495  }
1496  }
1497  else
1498  {
1499  tools::Long nThmbPos = pScrollbar->GetThumbPos();
1500  m_pViewWin->Scroll(nThmbPos - m_pViewWin->GetPaintedPreviewDocRect().Left(), 0);
1501  }
1502  // additional invalidate page status.
1503  static sal_uInt16 aInval[] =
1504  {
1505  FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
1506  FN_STAT_PAGE, 0
1507  };
1508  SfxBindings& rBindings = GetViewFrame()->GetBindings();
1509  rBindings.Invalidate( aInval );
1510  // control invalidation of window
1511  if ( bInvalidateWin )
1512  {
1513  m_pViewWin->Invalidate();
1514  }
1515 }
1516 
1517 Point SwPagePreview::AlignToPixel(const Point &rPt) const
1518 {
1519  return m_pViewWin->PixelToLogic( m_pViewWin->LogicToPixel( rPt ) );
1520 }
1521 
1522 void SwPagePreview::DocSzChgd( const Size &rSz )
1523 {
1524  if( m_aDocSize == rSz )
1525  return;
1526 
1527  m_aDocSize = rSz;
1528 
1529  // #i96726#
1530  // Due to the multiple page layout it is needed to trigger recalculation
1531  // of the page preview layout, even if the count of pages is not changing.
1533 
1534  if( m_aVisArea.GetWidth() )
1535  {
1537  ScrollDocSzChg();
1538 
1540  }
1541 }
1542 
1544 {
1545  if(!GetViewShell())
1546  return ;
1547 
1548  bool bShowVScrollbar = false, bShowHScrollbar = false;
1549 
1550  if(m_pVScrollbar)
1551  {
1552  if(GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow())
1553  {
1554  //vertical scrolling by row
1555  // adjust to new preview functionality
1556  const sal_uInt16 nVisPages = m_pViewWin->GetRow() * m_pViewWin->GetCol();
1557 
1558  m_pVScrollbar->SetVisibleSize( nVisPages );
1559  // set selected page as scroll bar position,
1560  // if it is visible.
1561  SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout();
1562  if ( pPagePreviewLay->IsPageVisible( m_pViewWin->SelectedPage() ) )
1563  {
1565  }
1566  else
1567  {
1569  }
1571  m_pVScrollbar->SetPageSize( nVisPages );
1572  // calculate and set scrollbar range
1573  Range aScrollbarRange( 1, mnPageCount );
1574  // increase range by one, because left-top-corner is left blank.
1575  ++aScrollbarRange.Max();
1576  // increase range in order to access all pages
1577  aScrollbarRange.Max() += ( nVisPages - 1 );
1578  m_pVScrollbar->SetRange( aScrollbarRange );
1579 
1580  bShowVScrollbar = nVisPages < mnPageCount;
1581  }
1582  else //vertical scrolling by pixel
1583  {
1585  const Size& rPreviewSize =
1587  m_pVScrollbar->SetRangeMax(rPreviewSize.Height()) ;
1588  tools::Long nVisHeight = rDocRect.GetHeight();
1589  m_pVScrollbar->SetVisibleSize( nVisHeight );
1590  m_pVScrollbar->SetThumbPos( rDocRect.Top() );
1591  m_pVScrollbar->SetLineSize( nVisHeight / 10 );
1592  m_pVScrollbar->SetPageSize( nVisHeight / 2 );
1593 
1594  bShowVScrollbar = true;
1595  }
1596 
1597  if (!mbVScrollbarEnabled)
1598  bShowVScrollbar = false;
1599 
1600  ShowVScrollbar(bShowVScrollbar);
1601  }
1602  if(m_pHScrollbar)
1603  {
1605  const Size& rPreviewSize =
1607  Range aRange(0,0);
1608 
1609  if(rDocRect.GetWidth() < rPreviewSize.Width())
1610  {
1611  bShowHScrollbar = true;
1612 
1613  tools::Long nVisWidth = rDocRect.GetWidth();
1614  tools::Long nThumb = rDocRect.Left();
1615  aRange = Range(0, rPreviewSize.Width());
1616 
1617  m_pHScrollbar->SetRange( aRange );
1618  m_pHScrollbar->SetVisibleSize( nVisWidth );
1619  m_pHScrollbar->SetThumbPos( nThumb );
1620  m_pHScrollbar->SetLineSize( nVisWidth / 10 );
1621  m_pHScrollbar->SetPageSize( nVisWidth / 2 );
1622  }
1623 
1624  if (!mbHScrollbarEnabled)
1625  bShowHScrollbar = false;
1626 
1627  ShowHScrollbar(bShowHScrollbar);
1628  }
1629  m_pScrollFill->Show(bShowVScrollbar && bShowHScrollbar);
1630 }
1631 
1633 {
1634  ScrollViewSzChg();
1635 }
1636 
1637 // All about printing
1639 {
1641 }
1642 
1644 {
1645  SwViewShell &rSh = *GetViewShell();
1646  SfxPrinter* pOld = rSh.getIDocumentDeviceAccess().getPrinter( false );
1647  if ( pOld && pOld->IsPrinting() )
1648  return SFX_PRINTERROR_BUSY;
1649 
1650  SwEditShell &rESh = static_cast<SwEditShell&>(rSh); //Buh...
1651  if( ( SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP ) & nDiffFlags )
1652  {
1653  rSh.getIDocumentDeviceAccess().setPrinter( pNew, true, true );
1654  if( nDiffFlags & SfxPrinterChangeFlags::PRINTER )
1655  rESh.SetModified();
1656  }
1657  if ( ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS ) == SfxPrinterChangeFlags::OPTIONS )
1658  ::SetPrinter( &rSh.getIDocumentDeviceAccess(), pNew, false );
1659 
1660  const bool bChgOri = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION);
1661  const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE);
1662  if ( bChgOri || bChgSize )
1663  {
1664  rESh.StartAllAction();
1665  if ( bChgOri )
1666  rSh.ChgAllPageOrientation( pNew->GetOrientation() );
1667  if ( bChgSize )
1668  {
1669  Size aSz( SvxPaperInfo::GetPaperSize( pNew ) );
1670  rSh.ChgAllPageSize( aSz );
1671  }
1672  if( !m_bNormalPrint )
1674  rESh.SetModified();
1675  rESh.EndAllAction();
1676 
1677  static sal_uInt16 aInval[] =
1678  {
1679  SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE,
1680  SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0
1681  };
1682 #if OSL_DEBUG_LEVEL > 0
1683  {
1684  const sal_uInt16* pPtr = aInval + 1;
1685  do {
1686  OSL_ENSURE( *(pPtr - 1) < *pPtr, "wrong sorting!" );
1687  } while( *++pPtr );
1688  }
1689 #endif
1690 
1691  GetViewFrame()->GetBindings().Invalidate(aInval);
1692  }
1693 
1694  return 0;
1695 }
1696 
1698 {
1699  return true;
1700 }
1701 
1702 std::unique_ptr<SfxTabPage> SwPagePreview::CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController,
1703  const SfxItemSet &rOptions)
1704 {
1705  return ::CreatePrintOptionsPage(pPage, pController, rOptions, !m_bNormalPrint);
1706 }
1707 
1709 {
1710  mpViewShell = pShell;
1711  if ( mpViewShell && mpViewShell->IsPreview() )
1712  {
1714  }
1715 }
1716 
1718 {
1719  // #i24183#
1721  {
1722  mpPgPreviewLayout->Repaint( tools::Rectangle( rRect.Pos(), rRect.SSize() ) );
1723  }
1724 }
1725 
1730 void SwPagePreviewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor,
1731  const SvxZoomType _eZoomType )
1732 {
1733  // #i19975# consider zoom type
1734  if ( _eZoomType == SvxZoomType::WHOLEPAGE )
1735  {
1736  mnRow = 1;
1737  mnCol = 1;
1744  }
1745  else if ( _nZoomFactor != 0 )
1746  {
1747  // calculate new scaling and set mapping mode appropriately.
1748  Fraction aNewScale( _nZoomFactor, 100 );
1749  MapMode aNewMapMode = GetMapMode();
1750  aNewMapMode.SetScaleX( aNewScale );
1751  aNewMapMode.SetScaleY( aNewScale );
1752  SetMapMode( aNewMapMode );
1753 
1754  // calculate new start position for preview paint
1755  Size aNewWinSize = PixelToLogic( maPxWinSize );
1756  Point aNewPaintStartPos =
1757  mpPgPreviewLayout->GetPreviewStartPosForNewScale( aNewScale, maScale, aNewWinSize );
1758 
1759  // remember new scaling and prepare preview paint
1760  // Note: paint of preview will be performed by a corresponding invalidate
1761  // due to property changes.
1762  maScale = aNewScale;
1763  mpPgPreviewLayout->Prepare( 0, aNewPaintStartPos, maPxWinSize,
1765  }
1766 
1767 }
1768 
1775 {
1776  maPaintedPreviewDocRect.Move(nXMove, nYMove);
1780 
1781 }
1782 
1784 {
1785  bool bOk = false;
1786  const CommandWheelData* pWData = rCEvt.GetWheelData();
1787  if( pWData && CommandWheelMode::ZOOM == pWData->GetMode() )
1788  {
1789  //only the Preference shouldn't control the Zoom, it is better to detect AT tools running. So the bridge can be used here
1791  {
1792  sal_uInt16 nFactor = GetViewShell()->GetViewOptions()->GetZoom();
1793  const sal_uInt16 nOffset = 10;
1794  if( 0L > pWData->GetDelta() )
1795  {
1796  nFactor -= nOffset;
1797  if(nFactor < MIN_PREVIEW_ZOOM)
1798  nFactor = MIN_PREVIEW_ZOOM;
1799  }
1800  else
1801  {
1802  nFactor += nOffset;
1803  if(nFactor > MAX_PREVIEW_ZOOM)
1804  nFactor = MAX_PREVIEW_ZOOM;
1805  }
1806  SetZoom(SvxZoomType::PERCENT, nFactor);
1807  }
1808  bOk = true;
1809  }
1810  else
1812  return bOk;
1813 }
1814 
1815 uno::Reference< css::accessibility::XAccessible >
1817 {
1818  SolarMutexGuard aGuard; // this should have happened already!!!
1819 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
1820  OSL_ENSURE( GetViewShell() != nullptr, "We need a view shell" );
1821  css::uno::Reference< css::accessibility::XAccessible > xAcc = GetAccessible( false );
1822  if (xAcc.is())
1823  {
1824  return xAcc;
1825  }
1826  if (mpViewShell)
1827  {
1828  css::uno::Reference< css::accessibility::XAccessible > xAccPreview = mpViewShell->CreateAccessiblePreview();
1829  SetAccessible(xAccPreview);
1830  }
1831 #endif
1832  return GetAccessible( false );
1833 }
1834 
1836 {
1837  GetViewShell()->ApplyAccessibilityOptions(rAccessibilityOptions);
1838 }
1839 
1841 {
1842  m_pHScrollbar->Show(bShow);
1843  InvalidateBorder();
1844 }
1845 
1847 {
1848  m_pVScrollbar->Show(bShow);
1849  InvalidateBorder();
1850 }
1851 
1853 {
1854  if (mbHScrollbarEnabled != bEnable)
1855  {
1856  mbHScrollbarEnabled = bEnable;
1857  ScrollViewSzChg();
1858  }
1859 }
1860 
1862 {
1863  if (mbVScrollbarEnabled != bEnable)
1864  {
1865  mbVScrollbarEnabled = bEnable;
1866  ScrollViewSzChg();
1867  }
1868 }
1869 
1870 void SwPagePreview::SetZoom(SvxZoomType eType, sal_uInt16 nFactor)
1871 {
1872  SwViewShell& rSh = *GetViewShell();
1873  SwViewOption aOpt(*rSh.GetViewOptions());
1874  // perform action only on changes of zoom or zoom type.
1875  if ( aOpt.GetZoom() != nFactor ||
1876  aOpt.GetZoomType() != eType )
1877  {
1878  aOpt.SetZoom(nFactor);
1879  aOpt.SetZoomType(eType);
1880  rSh.ApplyViewOptions( aOpt );
1882  // #i19975# also consider zoom type
1883  m_pViewWin->AdjustPreviewToNewZoom( nFactor, eType );
1884  ScrollViewSzChg();
1885  }
1886 }
1887 
1889 void SwPagePreview::SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos )
1890 {
1891  if ( m_pVScrollbar )
1892  {
1893  m_pVScrollbar->SetThumbPos( _nNewThumbPos );
1894  }
1895 }
1896 
1897 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual Point GetPosPixel() const
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxViewFrame * GetViewFrame() const
const Fraction & GetScaleX() const
#define MAXZOOM
Definition: view.hxx:81
void SetLineBreak(bool b)
Definition: viewopt.hxx:255
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
void setOutputToWindow(bool bOutputToWindow)
Definition: viewsh.cxx:132
void SetNewCursorPos(const OUString &rStr)
Definition: pview.hxx:256
bool SetBookPreviewMode(const bool _bEnableBookPreview, sal_uInt16 &_onStartPageNum, tools::Rectangle &_orDocPreviewPaintRect)
enable/disable book preview
bool m_bNormalPrint
Definition: pview.hxx:186
#define FN_CLOSE_PAGEPREVIEW
Definition: cmdid.h:855
void MarkNewSelectedPage(const sal_uInt16 _nSelectedPage)
paint to mark new selected page
#define MINZOOM
Definition: view.hxx:80
Point GetPointerPosPixel()
SwViewShell * GetViewShell() const
Definition: pview.hxx:234
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2214
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
#define FN_SHOW_MULTIPLE_PAGES
Definition: cmdid.h:852
void SetSoftHyph(bool b)
Definition: viewopt.hxx:266
void ShowPreviewSelection(sal_uInt16 nSelPage)
Definition: viewpg.cxx:40
#define SFX_IMPL_INTERFACE(Class, SuperClass)
SdrView * GetDrawView()
Definition: vnew.cxx:373
Point GetPreviewStartPosForNewScale(const Fraction &_aNewScale, const Fraction &_aOldScale, const Size &_aNewWinSize) const
calculate start position for new scale
Provides the VCL widget that is used for the main area of the File -> Print Preview window...
Definition: pview.hxx:46
sal_uInt16 GetVirtPageNumByPageNum(sal_uInt16 _nPageNum) const
get virtual page number by its physical page number
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
OUString m_sPageStr
Definition: pview.hxx:173
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:506
void SetState(const SfxItemSet &rSet)
#define FN_PREVIEW_ZOOM
Definition: cmdid.h:180
void ShowHScrollbar(bool bShow)
Definition: pview.cxx:1840
virtual void CalcLayout()
Definition: viewsh.cxx:1082
virtual void InnerResizePixel(const Point &rOfs, const Size &rSize, bool inplaceEditModeChange) override
Definition: pview.cxx:1306
std::string GetValue
void UpdateFontList()
Definition: docshini.cxx:414
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
Definition: pview.cxx:1816
SwPagePreviewWin(vcl::Window *pParent, SwPagePreview &rView)
Definition: pview.cxx:166
VclPtr< SwPagePreviewWin > m_pViewWin
Definition: pview.hxx:165
constexpr tools::Long Left() const
OUString m_sSwViewData
Definition: pview.hxx:167
std::unique_ptr< sal_Int32[]> pData
View of a document.
Definition: pview.hxx:161
virtual ~SwPagePreview() override
Definition: pview.cxx:1220
void SetSelectedPage(sal_uInt16 _nSelectedPageNum)
set selected page number in document preview
Definition: pview.cxx:538
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
Definition: legacyitem.cxx:32
SfxDispatcher * GetDispatcher()
bool Prepare(const sal_uInt16 _nProposedStartPageNum, const Point &rProposedStartPos, const Size &_rPxWinSize, sal_uInt16 &_onStartPageNum, tools::Rectangle &_orDocPreviewPaintRect, const bool _bStartWithPageAtFirstCol=true)
prepare paint of page preview
static SvxAbstractDialogFactory * Create()
void AdjustOptionsForPagePreview(SwPrintData const &rPrintOptions)
adjust view options for page preview
Definition: viewpg.cxx:50
long Long
void disposeAndClear()
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
const tools::Rectangle & GetPaintedPreviewDocRect() const
Definition: pview.hxx:139
bool IsDesignMode() const
bool IsModified() const
Changes in document?
Definition: edws.cxx:65
void Scroll(tools::Long nXMove, tools::Long nYMove, ScrollFlags nFlags=ScrollFlags::NONE) override
pixel scrolling - horizontally always or vertically when less than the desired number of rows fits in...
Definition: pview.cxx:1774
bool IsPreviewPosInDocPreviewPage(const Point &rPreviewPos, Point &_orDocPos, bool &_obPosInEmptyPage, sal_uInt16 &_onPageNum) const
checks, if given position is inside a shown document page
void SetPagePreview(sal_uInt8 nRow, sal_uInt8 nCol)
Definition: pview.cxx:516
bool HasDrawView() const
Definition: vnew.cxx:358
sal_uInt16 FirstWhich()
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: pview.cxx:190
const MapMode & GetMapMode() const
static void StateUndo(SfxItemSet &)
Definition: pview.cxx:1063
sal_uInt16 GetCode() const
Fraction maScale
Definition: pview.hxx:53
void Execute(SfxRequest &)
Definition: pview.cxx:655
SwPagePreview & mrView
Definition: pview.hxx:54
DataChangedEventType GetType() const
void Done(bool bRemove=false)
void Pos(const Point &rNew)
Definition: swrect.hxx:171
virtual SfxBindings & GetBindings() override
void SetHelpId(const OString &)
#define FN_STAT_PAGE
Definition: cmdid.h:842
const CommandWheelData * GetWheelData() const
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
void SetModified()
Definition: edws.cxx:70
sal_uInt16 ConvertRelativeToAbsolutePageNum(sal_uInt16 _nRelPageNum) const
Convert relative to absolute page numbers (see PrintEmptyPages)
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
void SetHardBlank(bool b)
Definition: viewopt.hxx:233
bool mbCalcScaleForPreviewLayout
Definition: pview.hxx:55
SwNodeOffset abs(const SwNodeOffset &a)
Definition: nodeoffset.hxx:34
void SetRangeMax(tools::Long nNewRange)
void SetAnimationEnabled(bool bEnable=true)
constexpr sal_uInt16 KEY_ADD
virtual SfxObjectShell * GetObjectShell() override
void SetShowHiddenChar(bool b)
Definition: viewopt.hxx:325
void PaintImmediately()
bool HandleScrollCommand(const CommandEvent &rCmd, ScrollBar *pHScrl, ScrollBar *pVScrl)
void EndAllAction()
Definition: edws.cxx:97
RET_CANCEL
void SetMapMode()
virtual const SfxItemSet * GetOutputItemSet() const =0
bool IsHorz() const
#define FN_SHOW_SINGLE_PAGE
Definition: cmdid.h:857
void SetBorderPixel(const SvBorder &rBorder)
void SetColumnBreak(bool b)
Definition: viewopt.hxx:261
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
bool IsPageVisible(const sal_uInt16 _nPageNum) const
determines, if page with given page number is visible in preview
sal_uInt16 NextWhich()
void ReInit()
method to adjust page preview layout to document changes
void SetPagePrevRow(sal_uInt8 n)
Definition: viewopt.hxx:460
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:546
void SetAppPrintOptions(SwViewShell *pSh, bool bWeb)
Definition: viewprt.cxx:317
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
constexpr tools::Long Width() const
#define MIN_PREVIEW_ZOOM
Definition: pview.cxx:95
bool PreviewLayoutValid() const
sal_uInt16 GetClicks() const
sal_Int64 WinBits
void disposeAndReset(reference_type *pBody)
void AddSnappingPoint(sal_Int32 nNew)
vcl::Window & GetWindow() const
void SetSlot(sal_uInt16 nNewSlot)
ScrollFlags
virtual void WriteUserData(OUString &, bool bBrowse=false)
void SetZoom(SvxZoomType eSet, sal_uInt16 nFactor)
Definition: pview.cxx:1870
void SetSelectedPage(sal_uInt16 _nSelectedPageNum)
set selected page number
void InvalidateBorder()
bool mbFormDesignModeToReset
Definition: pview.hxx:191
SfxPrinterChangeFlags
void SetPageSize(tools::Long nNewSize)
sal_uInt16 GetButtons() const
#define SFX_PRINTERROR_BUSY
bool IsVisible(bool bReal) const
Definition: scroll.hxx:39
void SetParagraph(bool b)
Definition: viewopt.hxx:239
sal_uInt16 m_nNewPage
Definition: pview.hxx:171
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
sal_uInt16 mnSttPage
Definition: pview.hxx:49
void InvalidateLayout(bool bSizeChanged)
Definition: viewsh.cxx:2115
SAL_DLLPRIVATE void CreateScrollbar(bool bHori)
Definition: pview.cxx:1241
bool IsMouseEvent() const
AllSettingsFlags GetFlags() const
bool IsHoriScroll() const
Definition: scroll.hxx:46
std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions, bool bPreview)
Definition: viewprt.cxx:294
sal_uInt8 GetCol() const
Definition: pview.hxx:86
Size maPxWinSize
Definition: pview.hxx:52
void ApplyAccessibilityOptions(SvtAccessibilityOptions const &rAccessibilityOptions)
Definition: viewsh.cxx:2641
constexpr tools::Long GetWidth() const
#define SID_JUMP_TO_SPECIFIC_PAGE
Definition: cmdid.h:739
bool IsViewVScrollBar() const
Definition: viewopt.hxx:519
sal_uInt16 GetModifier() const
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
tools::Long & Bottom()
virtual void DataChanged(const DataChangedEvent &) override
Definition: pview.cxx:551
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
void EnableHScrollbar(bool bEnable)
Definition: pview.cxx:1852
void DocSzChgd(const Size &rNewSize)
Definition: pview.cxx:1522
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
SwPagePreviewLayout * PagePreviewLayout()
Definition: viewpg.cxx:35
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
void SetThumbPos(tools::Long nThumbPos)
#define FN_START_OF_LINE
Definition: cmdid.h:658
void SetShowHiddenPara(bool b)
Definition: viewopt.hxx:400
SwDocShell * GetDocShell()
Definition: pview.cxx:1236
#define MOUSE_LEFT
bool SetContextBroadcasterEnabled(const bool bIsEnabled)
void SetLineSize(tools::Long nNewSize)
bool IsDeltaPixel() const
#define FN_LINE_UP
Definition: cmdid.h:656
SfxItemPool & GetPool() const
bool DoesPreviewLayoutRowsFitIntoWindow() const
tools::Rectangle m_aVisArea
Definition: pview.hxx:175
constexpr void SetLeft(tools::Long v)
#define SAL_N_ELEMENTS(arr)
void SetHideWhitespaceMode(bool bMode)
Definition: viewopt.hxx:484
DocumentType eType
void ApplyAccessibilityOptions(SvtAccessibilityOptions const &rAccessibilityOptions)
Definition: pview.cxx:1835
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
bool mbHScrollbarEnabled
Definition: pview.hxx:180
const SwPagePreviewPrtData * GetPreviewPrtData() const
Definition: doc.hxx:1458
SAL_DLLPRIVATE Point AlignToPixel(const Point &rPt) const
Definition: pview.cxx:1517
bool Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rOutRect) const
paint prepared preview
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2779
void ScrollViewSzChg()
Definition: pview.cxx:1543
void ChgAllPageOrientation(Orientation eOri)
Definition: vprint.cxx:203
void SetLineColor()
sal_Int32 GetScrollBarSize() const
#define FN_PAGEUP
Definition: cmdid.h:686
void RepaintCoreRect(const SwRect &rRect)
Definition: pview.cxx:1717
virtual SAL_DLLPRIVATE std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions) override
Definition: pview.cxx:1702
ScrollType GetType() const
sal_uInt16 SelectedPage() const
get selected page number of document preview
Definition: pview.cxx:532
#define FN_CHAR_LEFT
Definition: cmdid.h:654
void CalcStartValuesForSelectedPageMove(const sal_Int16 _nHoriMove, const sal_Int16 _nVertMove, sal_uInt16 &_orNewSelectedPage, sal_uInt16 &_orNewStartPage, Point &_orNewStartPos) const
calculate data to bring new selected page into view.
void SetScaleX(const Fraction &rScaleX)
page preview functionality in the writer
#define SWVIEWFLAGS
Definition: pview.cxx:93
bool mbResetFormDesignMode
Definition: pview.hxx:190
#define SW_MOD()
Definition: swmodule.hxx:255
Point LogicToPixel(const Point &rLogicPt) const
VclPtr< vcl::Window > m_pScrollFill
Definition: pview.hxx:183
VclPtr< SwScrollbar > m_pHScrollbar
Definition: pview.hxx:178
void SetPagePrevCol(sal_uInt8 n)
Definition: viewopt.hxx:462
#define MAX_PREVIEW_ZOOM
Definition: pview.cxx:96
void SetWindow(vcl::Window *pViewPort)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SAL_DLLPRIVATE bool ChgPage(int eMvMode, bool bUpdateScrollbar=true)
Definition: pview.cxx:1260
int i
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
void SetTable(bool b)
Definition: viewopt.hxx:345
void SetOnlineSpell(bool b)
Definition: viewopt.cxx:339
#define FN_PRINT_PAGEPREVIEW
Definition: cmdid.h:854
const MapMode & GetMapMode() const
tools::Long GetNotchDelta() const
static bool IsQuickHelpEnabled()
void SetVisibleSize(tools::Long nNewSize)
void SetShowHiddenField(bool b)
Definition: viewopt.hxx:330
bool ActionPend() const
Definition: viewsh.hxx:196
SfxBindings & GetBindings()
CommandWheelMode GetMode() const
void Repaint(const tools::Rectangle &rInvalidCoreRect) const
repaint pages on page preview
void SetTab(bool b)
Definition: viewopt.hxx:222
void SetRange(const Range &rRange)
void SetSttPage(sal_uInt16 n)
Definition: pview.hxx:96
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
bool IsPreview() const
Definition: viewsh.hxx:493
Size GetPreviewDocSize() const
sal_uInt16 Count() const
Size GetOutputSize() const
void SetPagePreview(bool bSet)
Definition: viewopt.hxx:636
sal_uInt16 GetPageCount() const
Definition: pview.hxx:250
void SetVisArea(const tools::Rectangle &)
Definition: pview.cxx:1345
SAL_DLLPRIVATE void ExecPgUpAndPgDown(const bool _bPgUp, SfxRequest *_pReq)
Helper method to execute SfxRequest FN_PAGE_UP and FN_PAGE_DOWN.
Definition: pview.cxx:582
void SetSfxViewShell(SfxViewShell *pNew)
Definition: viewsh.hxx:447
static SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
constexpr tools::Long Right() const
void SetFillColor()
css::uno::Reference< css::accessibility::XAccessible > CreateAccessiblePreview()
Definition: viewsh.cxx:2571
bool HandleWheelCommands(const CommandEvent &)
Definition: pview.cxx:1783
const AllSettings & GetSettings() const
CommandEventId GetCommand() const
void ShowVScrollbar(bool bShow)
Definition: pview.cxx:1846
sal_uInt16 GetModifier() const
virtual void Command(const CommandEvent &rCEvt) override
Definition: pview.cxx:435
sal_uInt8 mnCol
Definition: pview.hxx:51
void SetVScrollbarThumbPos(const sal_uInt16 _nNewThumbPos)
Adjust position of vertical scrollbar.
Definition: pview.cxx:1889
virtual SAL_DLLPRIVATE sal_uInt16 SetPrinter(SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags=SFX_PRINTER_ALL) override
Definition: pview.cxx:1643
void SetScaleY(const Fraction &rScaleY)
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:225
constexpr tools::Long Top() const
void SetWinSize(const Size &rNewSize)
Definition: pview.cxx:368
OUString GetStatusStr(sal_uInt16 nPageCount) const
Definition: pview.cxx:395
sal_uInt16 SelectedPage()
get selected page number
void SetViewHRuler(bool b)
Definition: viewopt.hxx:603
constexpr void SetRight(tools::Long v)
bool MovePage(int eMoveMode)
Definition: pview.cxx:266
constexpr void SetBottom(tools::Long v)
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
void SetGraphic(bool b)
Definition: viewopt.hxx:335
bool IsPagePrevBookview() const
Definition: viewopt.hxx:474
void SetName(const OUString &rName)
Point PixelToLogic(const Point &rDevicePt) const
void SSize(const Size &rNew)
Definition: swrect.hxx:180
sal_uInt16 GetModifier() const
virtual void KeyInput(const KeyEvent &) override
Definition: pview.cxx:411
sal_uInt8 GetRow() const
Definition: pview.hxx:81
bool GetLandscape() const
Definition: pvprtdat.hxx:63
#define COMMAND_WHEEL_PAGESCROLL
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
#define SFX_VIEW_REGISTRATION(DocClass)
vcl::Window * GetParent() const
SfxItemPool * GetPool() const
SwViewShell * mpViewShell
Definition: pview.hxx:48
virtual void setPrinter(SfxPrinter *pP, bool bDeleteOld, bool bCallPrtDataChanged)=0
Set the printer at the document.
SfxViewShell * GetViewShell() const
constexpr void SetTop(tools::Long v)
tools::Long SwTwips
Definition: swtypes.hxx:51
#define Y
bool mbVScrollbarEnabled
Definition: pview.hxx:181
void SetFieldName(bool b)
Definition: viewopt.hxx:270
SwPagePreviewLayout * mpPgPreviewLayout
Definition: pview.hxx:57
#define SFX_OBJECTBAR_OBJECT
virtual void OuterResizePixel(const Point &rOfs, const Size &rSize) override
Definition: pview.cxx:1320
SwViewShell & GetParentViewShell()
constexpr Point TopLeft() const
static void lcl_InvalidateZoomSlots(SfxBindings &rBindings)
Definition: pview.cxx:124
void SetEndScrollHdl(const Link< ScrollBar *, void > &rLink)
tools::Long GetThumbPos() const
sal_uInt8 GetPagePrevRow() const
Definition: viewopt.hxx:459
SAL_DLLPRIVATE void CalcAndSetBorderPixel(SvBorder &rToFill)
Definition: pview.cxx:1295
constexpr tools::Long Bottom() const
const Point & GetMousePosPixel() const
virtual void SetLimits(sal_uInt16 nMin, sal_uInt16 nMax)=0
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void SetReturnValue(const SfxPoolItem &)
virtual ~SwPagePreviewWin() override
Definition: pview.cxx:186
void Update(sal_uInt16 nId)
WinBits const WB_SIZEABLE
tools::Long & Right()
virtual SAL_DLLPRIVATE SfxPrinter * GetPrinter(bool bCreate=false) override
Definition: pview.cxx:1638
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetNumPages() const
Definition: viewsh.cxx:692
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetSlot() const
static const OUString & GetContextName(const Context eContext)
void ChgAllPageSize(Size const &rSz)
Definition: vprint.cxx:242
sal_uInt8 mnRow
Definition: pview.hxx:50
constexpr Size GetSize() const
Size m_aDocSize
Definition: pview.hxx:174
static SfxViewFrame * Current()
#define FN_END_OF_LINE
Definition: cmdid.h:659
constexpr sal_uInt16 KEY_SUBTRACT
void DisableItem(sal_uInt16 nWhich)
#define FN_START_OF_DOCUMENT
Definition: cmdid.h:660
#define FN_SHOW_BOOKVIEW
Definition: cmdid.h:856
weld::Window * GetFrameWeld() const
void SetViewShell(SwViewShell *pShell)
Definition: pview.cxx:1708
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
#define FN_CHAR_RIGHT
Definition: cmdid.h:655
SAL_DLLPRIVATE void Init()
Definition: pview.cxx:1075
constexpr tools::Long Height() const
void SetValueSet(SvxZoomEnableFlags nValues)
unsigned char sal_uInt8
void SetPageBreak(bool b)
Definition: viewopt.hxx:258
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:428
void CalcWish(sal_uInt8 nNewRow, sal_uInt8 nNewCol)
Definition: pview.cxx:220
constexpr sal_uInt16 KEY_ESCAPE
vcl::Window * GetWin() const
Definition: viewsh.hxx:338
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: pview.cxx:469
constexpr OStringLiteral HID_PAGEPREVIEW
Definition: helpids.h:27
SlideSorterView & mrView
void ResetModified()
Definition: edws.cxx:75
::OutputDevice const * GetOutDev() const
#define FN_PRINT_LAYOUT
Definition: cmdid.h:173
sal_uInt16 GetDefSttPage() const
Definition: pview.hxx:115
IMPL_LINK(SwPagePreview, ScrollHdl, ScrollBar *, p, void)
Definition: pview.cxx:1393
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
#define VSHELLFLAG_ISPREVIEW
Definition: viewsh.hxx:76
static VclPtr< reference_type > Create(Arg &&...arg)
SwTwips GetWinPagesScrollAmount(const sal_Int16 _nWinPagesToScroll) const
determine preview window page scroll amount
static sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, bool bZoomIn)
Definition: pview.cxx:98
void SetPostIts(bool b)
Definition: viewopt.hxx:275
sal_uInt16 mnPageCount
Definition: pview.hxx:185
void GetState(SfxItemSet &)
Definition: pview.cxx:927
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:505
virtual short run()
void * p
#define FN_PAGEDOWN
Definition: cmdid.h:687
const Point & GetPosPixel() const
void ViewResizePixel(const vcl::RenderContext &rRef, const Point &rOfst, const Size &rSize, const Size &rEditSz, SwScrollbar &rVScrollbar, SwScrollbar &rHScrollbar, vcl::Window &rScrollBarBox, SvxRuler *pVRuler=nullptr, SvxRuler *pHRuler=nullptr, bool bVRulerRight=false)
Definition: viewport.cxx:843
SwPagePreview(SfxViewFrame *pFrame, SfxViewShell *)
Definition: pview.cxx:1138
void EnableDrag()
SFX_IMPL_NAMED_VIEWFACTORY(SwPagePreview,"PrintPreview")
Definition: pview.cxx:75
void SetWin(vcl::Window *win)
Definition: viewsh.hxx:341
Size GetOutputSizePixel() const
void SetSnap(bool b)
Definition: viewopt.hxx:360
constexpr Point BottomRight() const
void AdjustPreviewToNewZoom(const sal_uInt16 _nZoomFactor, const SvxZoomType _eZoomType)
Method to adjust preview to a new zoom factor paint of preview is prepared for a new zoom factor Zoom...
Definition: pview.cxx:1730
virtual SfxInterface * GetInterface() const
const std::u16string_view aStringList[]
tools::Long GetDelta() const
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
virtual bool KeyInput(const KeyEvent &rKeyEvent)
const MiscSettings & GetMiscSettings() const
void SetOutDevViewType(OutDevViewType eOutDevViewType)
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
void SetViewVRuler(bool b)
Definition: viewopt.hxx:617
bool GetEnableATToolSupport() const
void SetModified()
Definition: usrpref.hxx:157
Point OutputToScreenPixel(const Point &rPos) const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
virtual SAL_DLLPRIVATE bool HasPrintOptionsPage() const override
Definition: pview.cxx:1697
SvxZoomType
void SetGridVisible(bool b)
Definition: viewopt.hxx:368
void ExtendedShow(bool bVisible=true)
Definition: scroll.cxx:74
XSLTFilter & m_rParent
sal_uInt16 GetSttPage() const
Definition: pview.hxx:91
#define FN_SHOW_TWO_PAGES
Definition: cmdid.h:850
#define FN_LINE_DOWN
Definition: cmdid.h:657
tools::Long Max() const
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
void BroadcastContextForActivation(const bool bIsActivated)
#define FN_STAT_ZOOM
Definition: cmdid.h:844
const Wallpaper & GetBackground() const
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2172
void Init(const sal_uInt16 _nCols, const sal_uInt16 _nRows, const Size &_rPxWinSize)
init page preview layout
bool IsViewHScrollBar() const
Definition: viewopt.hxx:527
bool DoesPreviewLayoutColsFitIntoWindow() const
void SetShowBookmarks(bool const b)
Definition: viewopt.hxx:242
void SetMapMode()
bool SetBookPreviewMode(const bool _bBookPreview)
Method to enable/disable book preview.
Definition: pview.cxx:544
WinBits const WB_CLIPCHILDREN
sal_uInt8 GetPagePrevCol() const
Definition: viewopt.hxx:461
void SetContextName(const OUString &rsContextName)
void ScrollDocSzChg()
Definition: pview.cxx:1632
sal_uInt16 ConvertAbsoluteToRelativePageNum(sal_uInt16 _nAbsPageNum) const
Convert absolute to relative page numbers (see PrintEmptyPages)
AnyEventRef aEvent
tools::Rectangle maPaintedPreviewDocRect
Definition: pview.hxx:56
Definition: view.hxx:144
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
SwViewShell * GetViewShell() const
Definition: pview.hxx:76
VclPtr< SwScrollbar > m_pVScrollbar
Definition: pview.hxx:179
void EnableVScrollbar(bool bEnable)
Definition: pview.cxx:1861
bool m_bDetectedRangeSegmentation false
void SetBlank(bool b)
Definition: viewopt.hxx:228
constexpr tools::Long GetHeight() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)